Class: Listen::Adapters::Windows
- Inherits:
-
Listen::Adapter
- Object
- Listen::Adapter
- Listen::Adapters::Windows
- Defined in:
- lib/listen/adapters/windows.rb
Overview
Adapter implementation for Windows ‘fchange`.
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) ⇒ Windows
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) ⇒ Windows
Initialize the Adapter. See Listen::Adapter#initialize for more info.
12 13 14 15 16 |
# File 'lib/listen/adapters/windows.rb', line 12 def initialize(directory, = {}, &callback) super @changed_dirs = Set.new init_worker end |
Class Method Details
.usable? ⇒ Boolean
Check if the adapter is usable on the current OS.
37 38 39 40 41 42 43 44 |
# File 'lib/listen/adapters/windows.rb', line 37 def self.usable? return false unless RbConfig::CONFIG['target_os'] =~ /mswin|mingw/i require 'rb-fchange' true rescue LoadError false end |
Instance Method Details
#start ⇒ Object
Start the adapter.
20 21 22 23 24 |
# File 'lib/listen/adapters/windows.rb', line 20 def start super Thread.new { @worker.run } poll_changed_dirs end |
#stop ⇒ Object
Stop the adapter.
28 29 30 31 |
# File 'lib/listen/adapters/windows.rb', line 28 def stop super @worker.stop end |