Added a debug message when running run_on_change

So the debug mode is a little more useful...

Also added timestamp in debug print
This commit is contained in:
Rémy Coutable 2011-07-21 01:21:04 +02:00
parent 76c2977b67
commit a318e03ad1
2 changed files with 5 additions and 2 deletions

View File

@ -43,7 +43,10 @@ module Guard
def run_on_change_for_all_guards(files)
guards.each do |guard|
paths = Watcher.match_files(guard, files)
supervised_task(guard, :run_on_change, paths) unless paths.empty?
unless paths.empty?
UI.debug "#{guard.class.name}#run_on_change with #{paths.inspect}"
supervised_task(guard, :run_on_change, paths)
end
end
# Reparse the whole directory to catch new files modified during the guards run

View File

@ -26,7 +26,7 @@ module Guard
def debug(message, options = {})
unless ENV["GUARD_ENV"] == "test"
reset_line if options[:reset]
puts "DEBUG: #{message}" if ::Guard.options && ::Guard.options[:debug]
puts "DEBUG (#{Time.now.strftime('%T')}): #{message}" if ::Guard.options && ::Guard.options[:debug]
end
end