Adapter implementation for Mac OS X `FSEvents`.
The default delay between checking for changes.
# File lib/listen/adapter/darwin.rb, line 13 def _configure(dir, &callback) require 'rb-fsevent' @worker ||= FSEvent.new opts = { latency: options.latency } @worker.watch(dir.to_s, opts, &callback) end
# File lib/listen/adapter/darwin.rb, line 24 def _process_event(dir, event) event.each do |path| new_path = Pathname.new(path.sub(/\/$/, '')) _log :debug, "fsevent: #{new_path}" # TODO: does this preserve symlinks? rel_path = new_path.relative_path_from(dir).to_s _queue_change(:dir, dir, rel_path, recursive: true) end end
# File lib/listen/adapter/darwin.rb, line 20 def _run @worker.run end