Class: Guard::RackRunner
- Inherits:
-
Object
- Object
- Guard::RackRunner
- Defined in:
- lib/guard/rack/runner.rb
Instance Attribute Summary collapse
-
#options ⇒ Object
readonly
Returns the value of attribute options.
-
#pid ⇒ Object
readonly
Returns the value of attribute pid.
Instance Method Summary collapse
-
#initialize(options) ⇒ RackRunner
constructor
A new instance of RackRunner.
- #restart ⇒ Object
- #start ⇒ Object
- #stop ⇒ Object
Constructor Details
#initialize(options) ⇒ RackRunner
Returns a new instance of RackRunner.
10 11 12 |
# File 'lib/guard/rack/runner.rb', line 10 def initialize() @options = end |
Instance Attribute Details
#options ⇒ Object (readonly)
Returns the value of attribute options.
8 9 10 |
# File 'lib/guard/rack/runner.rb', line 8 def @options end |
#pid ⇒ Object (readonly)
Returns the value of attribute pid.
8 9 10 |
# File 'lib/guard/rack/runner.rb', line 8 def pid @pid end |
Instance Method Details
#restart ⇒ Object
34 35 36 |
# File 'lib/guard/rack/runner.rb', line 34 def restart stop && start end |
#start ⇒ Object
14 15 16 17 18 |
# File 'lib/guard/rack/runner.rb', line 14 def start kill_unmanaged_pid! if [:force_run] @pid = run_rack_command! true end |
#stop ⇒ Object
20 21 22 23 24 25 26 27 28 29 30 31 32 |
# File 'lib/guard/rack/runner.rb', line 20 def stop # Rely on kill_unmanaged_pid if there's no pid return true unless @pid exitstatus = kill(@pid) @pid = nil if exitstatus && exitstatus != 0 UI.info "Rackup exited with non-zero exit status (#{exitstatus}) whilst trying to stop." return false end true end |