class Pushapp::Tasks::Base
Attributes
logger[R]
options[R]
Public Class Methods
new(options={})
click to toggle source
# File lib/pushapp/tasks/base.rb, line 10 def initialize options={} @options = options @logger = Pushapp::Logger.new end
register_as(name)
click to toggle source
# File lib/pushapp/tasks/base.rb, line 39 def self.register_as name Pushapp::Config.register_task name, self end
Public Instance Methods
app_name_from_path()
click to toggle source
# File lib/pushapp/tasks/base.rb, line 35 def app_name_from_path options[:remote].path ? options[:remote].path.split('/').last : nil end
env()
click to toggle source
# File lib/pushapp/tasks/base.rb, line 18 def env Hash[env_options.map {|k, v| [k.to_s, v.to_s] }] end
env_options()
click to toggle source
# File lib/pushapp/tasks/base.rb, line 22 def env_options options[:env] || {} end
inspect()
click to toggle source
# File lib/pushapp/tasks/base.rb, line 43 def inspect options[:task_name] end
run()
click to toggle source
# File lib/pushapp/tasks/base.rb, line 15 def run end
sudo()
click to toggle source
# File lib/pushapp/tasks/base.rb, line 26 def sudo options[:sudo] || 'sudo' end
system(cmd)
click to toggle source
# File lib/pushapp/tasks/base.rb, line 30 def system cmd logger.debug cmd Pipe.run cmd end