diff options
author | sawanoboly <sawanoboriyu@higanworks.com> | 2015-09-25 17:19:11 +0900 |
---|---|---|
committer | sawanoboly <sawanoboriyu@higanworks.com> | 2015-09-25 17:19:11 +0900 |
commit | 4f5083f1505e9005158cb36a8f4a9f0535fa25b8 (patch) | |
tree | 12d53a9e1fd112215325827bda7bc57edf1f2477 | |
parent | 5b668d5ef34102c9ac159a8f21c889fdc7f99f1b (diff) | |
download | net-ssh-multi-4f5083f1505e9005158cb36a8f4a9f0535fa25b8.tar.gz |
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 |