Class: WSOC::Runner
- Inherits:
-
Object
- Object
- WSOC::Runner
- Defined in:
- lib/wsoc/runner.rb
Instance Attribute Summary collapse
-
#host ⇒ Object
readonly
Host to run the WSOC server on.
-
#port ⇒ Object
readonly
Port to run the WSOC server on.
Class Method Summary collapse
-
.start(args = ARGV) ⇒ Object
Starts the runner.
Instance Method Summary collapse
-
#initialize ⇒ Runner
constructor
Creates a new runner.
-
#run(*args) ⇒ Object
Runs the runner.
Constructor Details
#initialize ⇒ Runner
Creates a new runner.
40 41 42 43 44 |
# File 'lib/wsoc/runner.rb', line 40 def initialize @host = Config::DEFAULT_HOST @port = Config::DEFAULT_PORT @handler = nil end |
Instance Attribute Details
#host ⇒ Object (readonly)
Host to run the WSOC server on
30 31 32 |
# File 'lib/wsoc/runner.rb', line 30 def host @host end |
#port ⇒ Object (readonly)
Port to run the WSOC server on
33 34 35 |
# File 'lib/wsoc/runner.rb', line 33 def port @port end |
Class Method Details
.start(args = ARGV) ⇒ Object
Starts the runner.
54 55 56 57 |
# File 'lib/wsoc/runner.rb', line 54 def Runner.start(args=ARGV) runner = self.new() runner.run(*args) end |
Instance Method Details
#run(*args) ⇒ Object
Runs the runner.
67 68 69 70 71 72 73 74 75 76 77 78 79 |
# File 'lib/wsoc/runner.rb', line 67 def run(*args) optparse(*args) = { :env => :production, :host => @host, :port => @port } .merge!(:server => @handler) if @handler App.run!() end |