Class: Listen::Adapters::Darwin
- Inherits:
-
Listen::Adapter
- Object
- Listen::Adapter
- Listen::Adapters::Darwin
- Defined in:
- lib/listen/adapters/darwin.rb
Overview
Adapter implementation for Mac OS X ‘FSEvents`.
Constant Summary
Constants inherited from Listen::Adapter
Listen::Adapter::DEFAULT_LATENCY, Listen::Adapter::POLLING_FALLBACK_MESSAGE
Instance Attribute Summary
Attributes inherited from Listen::Adapter
Class Method Summary collapse
-
.usable? ⇒ Boolean
Check if the adapter is usable on the current OS.
Instance Method Summary collapse
-
#initialize(directory, options = {}, &callback) ⇒ Darwin
constructor
Initialize the Adapter.
-
#start ⇒ Object
Start the adapter.
-
#stop ⇒ Object
Stop the adapter.
Methods inherited from Listen::Adapter
Constructor Details
#initialize(directory, options = {}, &callback) ⇒ Darwin
Initialize the Adapter. See Listen::Adapter#initialize for more info.
10 11 12 13 |
# File 'lib/listen/adapters/darwin.rb', line 10 def initialize(directory, = {}, &callback) super init_worker end |
Class Method Details
.usable? ⇒ Boolean
Check if the adapter is usable on the current OS.
33 34 35 36 37 38 39 40 |
# File 'lib/listen/adapters/darwin.rb', line 33 def self.usable? return false unless RbConfig::CONFIG['target_os'] =~ /darwin(1.+)?$/i require 'rb-fsevent' true rescue LoadError false end |
Instance Method Details
#start ⇒ Object
Start the adapter.
17 18 19 20 |
# File 'lib/listen/adapters/darwin.rb', line 17 def start super @worker.run end |
#stop ⇒ Object
Stop the adapter.
24 25 26 27 |
# File 'lib/listen/adapters/darwin.rb', line 24 def stop super @worker.stop end |