Class: ReverseTunnel::CLI
- Inherits:
-
Object
- Object
- ReverseTunnel::CLI
show all
- Defined in:
- lib/reverse-tunnel/cli.rb
Defined Under Namespace
Classes: Base, Client, Configurator, Global, Server
Instance Attribute Summary collapse
Instance Method Summary
collapse
Constructor Details
#initialize(arguments = []) ⇒ CLI
Returns a new instance of CLI.
6
7
8
|
# File 'lib/reverse-tunnel/cli.rb', line 6
def initialize(arguments = [])
@arguments = arguments
end
|
Instance Attribute Details
#arguments ⇒ Object
Returns the value of attribute arguments.
4
5
6
|
# File 'lib/reverse-tunnel/cli.rb', line 4
def arguments
@arguments
end
|
Instance Method Details
#configurator_class ⇒ Object
161
162
163
|
# File 'lib/reverse-tunnel/cli.rb', line 161
def configure
Global.new(arguments).configure(self)
end
|
#debug=(debug) ⇒ Object
139
140
141
142
|
# File 'lib/reverse-tunnel/cli.rb', line 139
def debug=(debug)
level = debug ? Logger::DEBUG : Logger::INFO
ReverseTunnel.logger.level = level
end
|
#instance ⇒ Object
157
158
159
|
# File 'lib/reverse-tunnel/cli.rb', line 157
def instance
configurator_class.configure(arguments)
end
|
#mode ⇒ Object
10
11
12
|
# File 'lib/reverse-tunnel/cli.rb', line 10
def mode
@mode ||= arguments.shift
end
|
#run ⇒ Object
165
166
167
168
|
# File 'lib/reverse-tunnel/cli.rb', line 165
def run
configure
instance.start
end
|
#syslog=(syslog) ⇒ Object
144
145
146
147
148
149
150
151
|
# File 'lib/reverse-tunnel/cli.rb', line 144
def syslog=(syslog)
if syslog
syslog_logger = Syslog::Logger.new("rtunnel").tap do |logger|
logger.level = ReverseTunnel.logger.level
end
ReverseTunnel.logger = syslog_logger
end
end
|