Class: Shipper::Executor

Inherits:
Object
  • Object
show all
Defined in:
lib/shipper/executor.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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_bashObject

Returns the value of attribute host_bash.



8
9
10
# File 'lib/shipper/executor.rb', line 8

def host_bash
  @host_bash
end

#pathObject

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