Class: Prb::CommandRunner
- Inherits:
-
Object
- Object
- Prb::CommandRunner
- Defined in:
- lib/prb/command_runner.rb
Instance Method Summary collapse
-
#initialize(opts) ⇒ CommandRunner
constructor
A new instance of CommandRunner.
- #resume ⇒ Object
- #start ⇒ Object
- #stop ⇒ Object
Constructor Details
#initialize(opts) ⇒ CommandRunner
Returns a new instance of CommandRunner.
3 4 5 |
# File 'lib/prb/command_runner.rb', line 3 def initialize(opts) @opts = Opts.new(opts) end |
Instance Method Details
#resume ⇒ Object
22 23 24 |
# File 'lib/prb/command_runner.rb', line 22 def resume send_request('resume') end |
#start ⇒ Object
7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
# File 'lib/prb/command_runner.rb', line 7 def start if running?(@opts.port) puts "A prb server is already running." exit(1) end Process.daemon() if @opts.daemonize? app = Prb::Server.new(@opts) Rack::Server.start( app: app, Port: @opts.port ) end |
#stop ⇒ Object
26 27 28 |
# File 'lib/prb/command_runner.rb', line 26 def stop send_request('stop') end |