Skip to content

Commit 9682f42

Browse files
committed
Merge pull request #11 from higanworks/keep_forwarding_in_pending_connection
Represents a forward action
2 parents dc9c6e7 + 1da3d48 commit 9682f42

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

lib/net/ssh/multi/pending_connection.rb

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,28 @@ def replay_on(session)
3131
end
3232
end
3333

34+
# Represents a #forward action.
35+
class ForwardRecording
36+
def initialize
37+
@recordings = []
38+
end
39+
40+
def remote(port, host, remote_port, remote_host="127.0.0.1")
41+
@recordings << [:remote, port, host, remote_port, remote_host]
42+
end
43+
44+
def replay_on(session)
45+
forward = session.forward
46+
@recordings.each {|args| forward.send *args}
47+
end
48+
end
49+
50+
def forward
51+
forward = ForwardRecording.new
52+
@recordings << forward
53+
forward
54+
end
55+
3456
# Represents a #send_global_request action.
3557
class SendGlobalRequestRecording #:nodoc:
3658
attr_reader :type, :extra, :callback

0 commit comments

Comments
 (0)