Class: Shipper::Executor
- Inherits:
-
Object
- Object
- Shipper::Executor
- Defined in:
- lib/shipper/executor.rb
Instance Attribute Summary collapse
-
#host_bash ⇒ Object
Returns the value of attribute host_bash.
-
#path ⇒ Object
Returns the value of attribute path.
Instance Method Summary collapse
- #cd(new_location) ⇒ Object
- #exec(cmd) ⇒ Object
-
#initialize(host_bash = nil, path = nil) ⇒ Executor
constructor
A new instance of Executor.
Constructor Details
#initialize(host_bash = nil, path = nil) ⇒ Executor
10 11 12 13 |
# File 'lib/shipper/executor.rb', line 10 def initialize(host_bash = nil, path = nil) @host_bash = host_bash @path = path || Dir.pwd end |
Instance Attribute Details
#host_bash ⇒ Object
Returns the value of attribute host_bash.
8 9 10 |
# File 'lib/shipper/executor.rb', line 8 def host_bash @host_bash end |
#path ⇒ Object
Returns the value of attribute path.
8 9 10 |
# File 'lib/shipper/executor.rb', line 8 def path @path end |
Instance Method Details
#cd(new_location) ⇒ Object
19 20 21 |
# File 'lib/shipper/executor.rb', line 19 def cd(new_location) @path = new_location end |
#exec(cmd) ⇒ Object
15 16 17 |
# File 'lib/shipper/executor.rb', line 15 def exec(cmd) host_bash ? exec_host(cmd) : exec_local(cmd) end |