Class: Guard::Shell
- Inherits:
-
Plugin
- Object
- Plugin
- Guard::Shell
- Defined in:
- lib/guard/shell.rb
Instance Method Summary collapse
- #available_watchers ⇒ Object
-
#run_all ⇒ Object
Call #run_on_change for all files which match this guard.
-
#run_on_modifications(res) ⇒ Object
Print the result of the command(s), if there are results to be printed.
-
#start ⇒ Object
Calls #run_all if the :all_on_start option is present.
-
#stop ⇒ Object
Defined only to make callback(:stop_begin) and callback(:stop_end) working.
Instance Method Details
#available_watchers ⇒ Object
30 31 32 |
# File 'lib/guard/shell.rb', line 30 def available_watchers watchers end |
#run_all ⇒ Object
Call #run_on_change for all files which match this guard.
17 18 19 20 21 22 23 |
# File 'lib/guard/shell.rb', line 17 def run_all available_watchers.each do |watcher| output = watcher.call_action([]) run_on_modifications(output) end end |
#run_on_modifications(res) ⇒ Object
Print the result of the command(s), if there are results to be printed.
26 27 28 |
# File 'lib/guard/shell.rb', line 26 def run_on_modifications(res) $stdout.puts res if res end |
#start ⇒ Object
Calls #run_all if the :all_on_start option is present.
8 9 10 |
# File 'lib/guard/shell.rb', line 8 def start run_all if [:all_on_start] end |
#stop ⇒ Object
Defined only to make callback(:stop_begin) and callback(:stop_end) working
13 14 |
# File 'lib/guard/shell.rb', line 13 def stop end |