Class: Guard::Spring
- Defined in:
- lib/guard/spring.rb,
lib/guard/spring/runner.rb
Defined Under Namespace
Classes: Runner
Instance Attribute Summary collapse
-
#runner ⇒ Object
Returns the value of attribute runner.
Instance Method Summary collapse
-
#initialize(watchers = [], options = {}) ⇒ Spring
constructor
Initialize a Guard.
-
#reload ⇒ Object
Called when ‘reload|r|z + enter` is pressed.
-
#run_all ⇒ Object
Called when just
enteris pressed This method should be principally used for long action like running all specs/tests/… -
#run_on_changes(paths) ⇒ Object
Called on file(s) modifications that the Guard watches.
-
#run_on_removals(paths) ⇒ Object
Called on file(s) deletions that the Guard watches.
-
#start ⇒ Object
Call once when Guard starts.
-
#stop ⇒ Object
Called when ‘stop|quit|exit|s|q|e + enter` is pressed (when Guard quits).
Constructor Details
Instance Attribute Details
#runner ⇒ Object
Returns the value of attribute runner.
8 9 10 |
# File 'lib/guard/spring.rb', line 8 def runner @runner end |
Instance Method Details
#reload ⇒ Object
Called when ‘reload|r|z + enter` is pressed. This method should be mainly used for “reload” (really!) actions like reloading passenger/spork/bundler/…
34 35 36 37 |
# File 'lib/guard/spring.rb', line 34 def reload runner.kill_spring runner.launch_spring('Reload') end |
#run_all ⇒ Object
Called when just enter is pressed This method should be principally used for long action like running all specs/tests/…
42 43 44 |
# File 'lib/guard/spring.rb', line 42 def run_all runner.run_all end |
#run_on_changes(paths) ⇒ Object
Called on file(s) modifications that the Guard watches.
49 50 51 |
# File 'lib/guard/spring.rb', line 49 def run_on_changes(paths) runner.run(paths) end |
#run_on_removals(paths) ⇒ Object
Called on file(s) deletions that the Guard watches.
56 57 58 |
# File 'lib/guard/spring.rb', line 56 def run_on_removals(paths) runner.run_all end |
#start ⇒ Object
Call once when Guard starts. Please override initialize method to init stuff.
20 21 22 23 |
# File 'lib/guard/spring.rb', line 20 def start runner.kill_spring runner.launch_spring('Start') end |
#stop ⇒ Object
Called when ‘stop|quit|exit|s|q|e + enter` is pressed (when Guard quits).
27 28 29 |
# File 'lib/guard/spring.rb', line 27 def stop runner.kill_spring end |