Skip to content

Commit

Permalink
Update debug message in darwin handler
Browse files Browse the repository at this point in the history
  • Loading branch information
mynyml committed Aug 22, 2010
1 parent b254211 commit 8b9e2ed
Showing 1 changed file with 18 additions and 8 deletions.
26 changes: 18 additions & 8 deletions lib/watchr/event_handlers/darwin.rb
@@ -1,6 +1,23 @@
module Watchr module Watchr
module EventHandler module EventHandler


class ::FSEvents
# Same as Watch.debug, but prefixed with [fsevents] instead.
#
# @example
#
# FSEvents.debug('missfired')
#
# @param [String] message
# debug message to print
#
# @return [nil]
#
def self.debug(msg)
puts "[fsevents] #{msg}" if Watchr.options.debug
end
end

# FSEvents based event handler for Darwin/OSX # FSEvents based event handler for Darwin/OSX
# #
# Uses ruby-fsevents (http://github.com/sandro/ruby-fsevent) # Uses ruby-fsevents (http://github.com/sandro/ruby-fsevent)
Expand Down Expand Up @@ -63,14 +80,7 @@ def detect_change(dir)
type = nil type = nil
path = paths.find {|path| type = event_type(path) } path = paths.find {|path| type = event_type(path) }


if type == :accessed || type.nil? FSEvents.debug("event detection error") if 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 update_reference_times
[path, type] [path, type]
Expand Down

0 comments on commit 8b9e2ed

Please sign in to comment.