Class: Net::SSH::Multi::PendingConnection::ForwardRecording

Inherits:
Object
  • Object
show all
Defined in:
lib/knife-zero/net_ssh_multi_patch.rb

Instance Method Summary collapse

Constructor Details

#initializeForwardRecording

Returns a new instance of ForwardRecording.



12
13
14
# File 'lib/knife-zero/net_ssh_multi_patch.rb', line 12

def initialize
  @recordings = []
end

Instance Method Details

#remote(port, host, remote_port, remote_host = "127.0.0.1") ⇒ Object



16
17
18
# File 'lib/knife-zero/net_ssh_multi_patch.rb', line 16

def remote(port, host, remote_port, remote_host="127.0.0.1")
  @recordings << [:remote, port, host, remote_port, remote_host]
end

#replay_on(session) ⇒ Object



20
21
22
23
# File 'lib/knife-zero/net_ssh_multi_patch.rb', line 20

def replay_on(session)
  forward = session.forward
  @recordings.each {|args| forward.send *args}
end