Class: Dizby::LocalTunnelStrategy
- Inherits:
-
Object
- Object
- Dizby::LocalTunnelStrategy
- Includes:
- TunnelableLocal
- Defined in:
- lib/dizby/tunnel/local_strategy.rb
Instance Method Summary collapse
-
#initialize(server_port) ⇒ LocalTunnelStrategy
constructor
A new instance of LocalTunnelStrategy.
- #read(stream)
- #write(ssh, stream)
Methods included from TunnelableLocal
Constructor Details
#initialize(server_port) ⇒ LocalTunnelStrategy
Returns a new instance of LocalTunnelStrategy.
14 15 16 |
# File 'lib/dizby/tunnel/local_strategy.rb', line 14 def initialize(server_port) @server_port = server_port end |
Instance Method Details
#read(stream)
24 25 26 27 28 |
# File 'lib/dizby/tunnel/local_strategy.rb', line 24 def read(stream) local_tunnel = stream.gets.chomp.to_i [local_tunnel, nil] end |
#write(ssh, stream)
18 19 20 21 22 |
# File 'lib/dizby/tunnel/local_strategy.rb', line 18 def write(ssh, stream) local_tunnel = create_local_tunnel(ssh, @server_port) stream.puts local_tunnel end |