Class: Observr::EventHandler::Darwin
- Inherits:
-
FSEvent
- Object
- FSEvent
- Observr::EventHandler::Darwin
- Includes:
- Base
- Defined in:
- lib/observr/event_handlers/darwin.rb
Overview
FSEvents based event handler for Darwin/OSX
Uses ruby-fsevents (github.com/sandro/ruby-fsevent)
Instance Method Summary collapse
-
#initialize ⇒ Darwin
constructor
A new instance of Darwin.
-
#listen(monitored_paths) ⇒ undefined
Enter listening loop.
-
#refresh(monitored_paths) ⇒ undefined
Rebuild file bindings.
Methods included from Base
Constructor Details
#initialize ⇒ Darwin
Returns a new instance of Darwin.
28 29 30 31 |
# File 'lib/observr/event_handlers/darwin.rb', line 28 def initialize super self.latency = 0.2 end |
Instance Method Details
#listen(monitored_paths) ⇒ undefined
Enter listening loop. Will block control flow until application is explicitly stopped/killed.
38 39 40 41 |
# File 'lib/observr/event_handlers/darwin.rb', line 38 def listen(monitored_paths) register_paths(monitored_paths) start end |
#refresh(monitored_paths) ⇒ undefined
Rebuild file bindings. Will detach all current bindings, and reattach the ‘monitored_paths`
51 52 53 54 |
# File 'lib/observr/event_handlers/darwin.rb', line 51 def refresh(monitored_paths) register_paths(monitored_paths) restart end |