Class: Tunnel::Config

Inherits:
OpenStruct
  • Object
show all
Defined in:
lib/tunnel/config.rb

Instance Method Summary collapse

Instance Method Details

#ssh_commandObject



15
16
17
18
# File 'lib/tunnel/config.rb', line 15

def ssh_command
  "ssh %s -p %s -nNT -g -R *:%s:0.0.0.0:%s %s@%s" %
  [ verbose_flag, ssh_port, remote_port, local_port, remote_user, remote_host ]
end

#to_sObject



10
11
12
13
# File 'lib/tunnel/config.rb', line 10

def to_s
  "[ %s ] %s:%s -> 0.0.0.0:%s" %
  [ name, remote_host, remote_port, local_port ]
end

#to_yaml(opts = {}) ⇒ Object



6
7
8
# File 'lib/tunnel/config.rb', line 6

def to_yaml(opts={})
  @table.to_yaml(opts)
end

#verbose_flagObject



20
21
22
# File 'lib/tunnel/config.rb', line 20

def verbose_flag
  self.verbose ? '-v' : ''
end