Class: Guard::Passenger
- Defined in:
- lib/guard/passenger.rb,
lib/guard/passenger/pinger.rb,
lib/guard/passenger/runner.rb
Defined Under Namespace
Instance Attribute Summary collapse
-
#cli_start ⇒ Object
readonly
Returns the value of attribute cli_start.
-
#notification ⇒ Object
readonly
Returns the value of attribute notification.
-
#ping ⇒ Object
readonly
Returns the value of attribute ping.
-
#running ⇒ Object
readonly
Returns the value of attribute running.
-
#sudo ⇒ Object
readonly
Returns the value of attribute sudo.
Instance Method Summary collapse
-
#initialize(watchers = [], options = {}) ⇒ Passenger
constructor
= Guard methods = =================.
-
#reload ⇒ Object
Call with Ctrl-Z signal.
-
#run_on_changes(paths = {}) ⇒ Object
Call on file(s) modifications.
- #running? ⇒ Boolean
- #standalone? ⇒ Boolean
-
#start ⇒ Object
Call once when guard starts.
-
#stop ⇒ Object
Call with Ctrl-C signal (when Guard quit).
Constructor Details
#initialize(watchers = [], options = {}) ⇒ Passenger
Guard methods =
25 26 27 28 29 30 31 32 33 34 35 36 37 |
# File 'lib/guard/passenger.rb', line 25 def initialize(watchers = [], = {}) super @standalone = [:standalone].nil? ? true : [:standalone] @cli_start = init_cli() @cli_stop = cli_stop @notification = [:notification].nil? ? true : [:notification] @ping = [:ping].eql?(true) ? '/' : [:ping] @sudo = [:sudo] || '' @sudo = @sudo.eql?(true) ? 'sudo' : @sudo end |
Instance Attribute Details
#cli_start ⇒ Object (readonly)
Returns the value of attribute cli_start.
11 12 13 |
# File 'lib/guard/passenger.rb', line 11 def cli_start @cli_start end |
#notification ⇒ Object (readonly)
Returns the value of attribute notification.
11 12 13 |
# File 'lib/guard/passenger.rb', line 11 def notification @notification end |
#ping ⇒ Object (readonly)
Returns the value of attribute ping.
11 12 13 |
# File 'lib/guard/passenger.rb', line 11 def ping @ping end |
#running ⇒ Object (readonly)
Returns the value of attribute running.
11 12 13 |
# File 'lib/guard/passenger.rb', line 11 def running @running end |
#sudo ⇒ Object (readonly)
Returns the value of attribute sudo.
11 12 13 |
# File 'lib/guard/passenger.rb', line 11 def sudo @sudo end |
Instance Method Details
#reload ⇒ Object
Call with Ctrl-Z signal
59 60 61 |
# File 'lib/guard/passenger.rb', line 59 def reload restart_and_ping end |
#run_on_changes(paths = {}) ⇒ Object
Call on file(s) modifications
64 65 66 |
# File 'lib/guard/passenger.rb', line 64 def run_on_changes(paths = {}) restart_and_ping end |
#running? ⇒ Boolean
17 18 19 |
# File 'lib/guard/passenger.rb', line 17 def running? @running end |
#standalone? ⇒ Boolean
13 14 15 |
# File 'lib/guard/passenger.rb', line 13 def standalone? @standalone end |
#start ⇒ Object
Call once when guard starts
40 41 42 43 44 45 46 47 |
# File 'lib/guard/passenger.rb', line 40 def start UI.info 'Guard::Passenger is running!' if standalone? running = Runner.start_passenger(cli_start, @sudo) else true end end |
#stop ⇒ Object
Call with Ctrl-C signal (when Guard quit)
50 51 52 53 54 55 56 |
# File 'lib/guard/passenger.rb', line 50 def stop if standalone? && running? UI.info 'Stopping Passenger...' Runner.stop_passenger(cli_stop, @sudo) end true end |