Class: Listen::Adapter::Base
- Inherits:
-
Object
- Object
- Listen::Adapter::Base
show all
- Includes:
- Celluloid
- Defined in:
- lib/listen/adapter/base.rb
Constant Summary
collapse
- DEFAULT_LATENCY =
The default delay between checking for changes.
0.1
Instance Attribute Summary collapse
Class Method Summary
collapse
Instance Method Summary
collapse
Constructor Details
#initialize(listener) ⇒ Base
Returns a new instance of Base.
12
13
14
|
# File 'lib/listen/adapter/base.rb', line 12
def initialize(listener)
@listener = listener
end
|
Instance Attribute Details
#listener ⇒ Object
Returns the value of attribute listener.
10
11
12
|
# File 'lib/listen/adapter/base.rb', line 10
def listener
@listener
end
|
Class Method Details
.usable? ⇒ Boolean
16
17
18
|
# File 'lib/listen/adapter/base.rb', line 16
def self.usable?
raise NotImplementedError
end
|
Instance Method Details
#_directories_path ⇒ Object
30
31
32
|
# File 'lib/listen/adapter/base.rb', line 30
def _directories_path
listener.directories.map(&:to_s)
end
|
#_latency ⇒ Object
26
27
28
|
# File 'lib/listen/adapter/base.rb', line 26
def _latency
listener.options[:latency] || DEFAULT_LATENCY
end
|
#_notify_change(path, options) ⇒ Object
34
35
36
37
|
# File 'lib/listen/adapter/base.rb', line 34
def _notify_change(path, options)
sleep 0.01 until listener.registry[:change_pool]
listener.registry[:change_pool].async.change(path, options) if listener.listen?
end
|
#start ⇒ Object
20
21
22
|
# File 'lib/listen/adapter/base.rb', line 20
def start
raise NotImplementedError
end
|