Browse files

Update reference times after detected change

  • Loading branch information...
1 parent 30e94b9 commit bc594337352b272616d3c53a41602a70d34a46f9 mynyml committed Jul 5, 2010
Showing with 14 additions and 4 deletions.
  1. +14 −4 lib/watchr/event_handlers/darwin.rb
View
18 lib/watchr/event_handlers/darwin.rb
@@ -26,12 +26,22 @@ def on_change(dirs)
end
end
- def detect_change_in(dir)
+ def detect_change(dir)
paths = monitored_paths_for(dir)
- paths.each do |path|
- type = event_type(path)
- return [path, type] if type
+ type = nil
+ path = paths.find {|path| type = event_type(path) }
+
+ if type == :accessed || type.nil?
+ Watchr.debug "NO CHANGE DETECTED"
+ Watchr.debug "type: #{type.inspect}"
+ Watchr.debug "dir: #{dir.inspect}"
+ Watchr.debug "path: #{path.inspect}"
+ Watchr.debug "refs: #{@reference_times[path].inspect }"
+ Watchr.debug "/ NO CHANGE DETECTED"
end
+
+ update_reference_times
+ [path, type]
end
def event_type(path)

0 comments on commit bc59433

Please sign in to comment.