diff options
author | Miklós Fazekas <mfazekas@szemafor.com> | 2016-03-11 08:59:44 +0100 |
---|---|---|
committer | Miklós Fazekas <mfazekas@szemafor.com> | 2016-03-11 08:59:44 +0100 |
commit | 9682f42c3020254edefdbc66acf421858163f005 (patch) | |
tree | 50ed9e449955cb564e2bde72b415acf02e935218 | |
parent | dc9c6e79d2572d355cf6d67a7d8a3c3b22d23d12 (diff) | |
parent | 1da3d4876a09f3b7932b32b58a309cfbbde1726a (diff) | |
download | net-ssh-multi-9682f42c3020254edefdbc66acf421858163f005.tar.gz |
Merge pull request #11 from higanworks/keep_forwarding_in_pending_connection
Represents a forward action
-rw-r--r-- | lib/net/ssh/multi/pending_connection.rb | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/lib/net/ssh/multi/pending_connection.rb b/lib/net/ssh/multi/pending_connection.rb index 6af0fac..268ae3c 100644 --- a/lib/net/ssh/multi/pending_connection.rb +++ b/lib/net/ssh/multi/pending_connection.rb @@ -31,6 +31,28 @@ module Net; module SSH; module Multi end end + # Represents a #forward action. + class ForwardRecording + def initialize + @recordings = [] + end + + def remote(port, host, remote_port, remote_host="127.0.0.1") + @recordings << [:remote, port, host, remote_port, remote_host] + end + + def replay_on(session) + forward = session.forward + @recordings.each {|args| forward.send *args} + end + end + + def forward + forward = ForwardRecording.new + @recordings << forward + forward + end + # Represents a #send_global_request action. class SendGlobalRequestRecording #:nodoc: attr_reader :type, :extra, :callback |