Permalink
Browse files

Only notify on detected change

In certain cases an event is triggered but no change is detected. Avoid notifying controller in those cases, so as to avoid exception
  • Loading branch information...
1 parent c56409b commit 30e94b96494efe8bcf3e561850b79d9b727cef73 mynyml committed Jul 5, 2010
Showing with 4 additions and 1 deletion.
  1. +4 −1 lib/watchr/event_handlers/darwin.rb
View
5 lib/watchr/event_handlers/darwin.rb
@@ -20,7 +20,10 @@ def refresh(monitored_paths)
private
def on_change(dirs)
- dirs.each {|dir| notify(*detect_change_in(dir)) }
+ dirs.each do |dir|
+ path, type = detect_change(dir)
+ notify(path, type) unless path.nil?
+ end
end
def detect_change_in(dir)

0 comments on commit 30e94b9

Please sign in to comment.