Class: Phase::SSH::Backend

Inherits:
SSHKit::Backend::Netssh
  • Object
show all
Defined in:
lib/phase/kit/ssh/backend.rb

Instance Method Summary collapse

Constructor Details

#initialize(host, options = {}) ⇒ Backend

Returns a new instance of Backend.



4
5
6
7
8
# File 'lib/phase/kit/ssh/backend.rb', line 4

def initialize(host, options = {})
  # BUG: Backend::Netssh doesn't assign @pool when subclassed.
  self.class.pool = ::SSHKit::Backend::ConnectionPool.new
  @host = host
end

Instance Method Details

#on_remote_host(remote_host, &block) ⇒ Object



10
11
12
13
# File 'lib/phase/kit/ssh/backend.rb', line 10

def on_remote_host(remote_host, &block)
  @remote_host = remote_host
  yield
end

#run(&block) ⇒ Object



15
16
17
# File 'lib/phase/kit/ssh/backend.rb', line 15

def run(&block)
  instance_exec(host, &block)
end