Class: Guard::Shell

Inherits:
Guard
  • Object
show all
Defined in:
lib/guard/shell.rb

Constant Summary collapse

VERSION =
'0.5.1'

Instance Method Summary collapse

Instance Method Details

#run_allObject

Call #run_on_change for all files which match this guard.



16
17
18
# File 'lib/guard/shell.rb', line 16

def run_all
  run_on_changes(Watcher.match_files(self, Dir.glob('{,**/}*{,.*}').uniq))
end

#run_on_changes(res) ⇒ Object

Print the result of the command(s), if there are results to be printed.



21
22
23
# File 'lib/guard/shell.rb', line 21

def run_on_changes(res)
  puts res if res
end

#startObject

Calls #run_all if the :all_on_start option is present.



11
12
13
# File 'lib/guard/shell.rb', line 11

def start
  run_all if options[:all_on_start]
end