Class: Pike::Tasks::Command::Local
- Inherits:
-
Object
- Object
- Pike::Tasks::Command::Local
- Defined in:
- lib/pike/tasks/command/local.rb
Instance Method Summary collapse
- #bundler(cmd, var_string, do_not_use) ⇒ Object
- #cd(new_cwd) ⇒ Object
-
#initialize(task) ⇒ Local
constructor
A new instance of Local.
- #run(cmd) ⇒ Object
Constructor Details
#initialize(task) ⇒ Local
Returns a new instance of Local.
5 6 7 |
# File 'lib/pike/tasks/command/local.rb', line 5 def initialize(task) @task = task end |
Instance Method Details
#bundler(cmd, var_string, do_not_use) ⇒ Object
29 30 31 |
# File 'lib/pike/tasks/command/local.rb', line 29 def bundler(cmd, var_string, do_not_use) run("#{var_string} bundle #{cmd}") end |
#cd(new_cwd) ⇒ Object
21 22 23 24 25 26 27 |
# File 'lib/pike/tasks/command/local.rb', line 21 def cd(new_cwd) begin return Dir.chdir new_cwd rescue Exception => e Main.error(e) end end |
#run(cmd) ⇒ Object
9 10 11 12 13 14 15 16 17 18 19 |
# File 'lib/pike/tasks/command/local.rb', line 9 def run(cmd) re = `#{cmd} 2>&1` Logger.log re if $? != 0 Main.error(re) end re end |