summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/net/ssh/multi/pending_connection.rb22
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