Class: Guard::Keepgoing
- Inherits:
-
Plugin
- Object
- Plugin
- Guard::Keepgoing
- Defined in:
- lib/guard/keepgoing.rb
Overview
Guard plugin for keepgoing, which will load the file it is given as an option,
on start and on modification.
Instance Attribute Summary collapse
-
#runs ⇒ Object
readonly
Returns the value of attribute runs.
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ Keepgoing
constructor
A new instance of Keepgoing.
- #run_all ⇒ Object
- #run_on_modifications(_paths) ⇒ Object
- #start ⇒ Object
Constructor Details
#initialize(options = {}) ⇒ Keepgoing
Returns a new instance of Keepgoing.
9 10 11 12 13 |
# File 'lib/guard/keepgoing.rb', line 9 def initialize( = {}) opts = .dup @runs = 0 super(opts) # important to call + avoid passing options Guard doesn't understand end |
Instance Attribute Details
#runs ⇒ Object (readonly)
Returns the value of attribute runs.
7 8 9 |
# File 'lib/guard/keepgoing.rb', line 7 def runs @runs end |
Instance Method Details
#run_all ⇒ Object
22 23 24 |
# File 'lib/guard/keepgoing.rb', line 22 def run_all do_run end |
#run_on_modifications(_paths) ⇒ Object
26 27 28 29 |
# File 'lib/guard/keepgoing.rb', line 26 def run_on_modifications(_paths) puts "Press Ctrl+C to quit keepgoing. Just edit and save away, you can do this 🎉\n\n" if clear_screen_on_reload? do_run end |
#start ⇒ Object
15 16 17 18 19 20 |
# File 'lib/guard/keepgoing.rb', line 15 def start @runs = 1 puts "Hi! I'll keepgoing until you press Ctrl+C. Just edit and save away, you can do this 🎉\n\n" setup_interrupt_handler run_all end |