em-dir-watcher 0.0.3 → 0.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.3
1
+ 0.0.4
@@ -3,21 +3,23 @@ module EMDirWatcher
3
3
  module Platform
4
4
  module NIX
5
5
 
6
- # monkey-patch to set latency to 0
7
- module FssmFSEventsMonkeyPatch
8
- def patched_add_handler(handler, preload=true)
9
- @handlers[handler.path.to_s] = handler
10
-
11
- fsevent = Rucola::FSEvents.new(handler.path.to_s, {:latency => 0.0}) do |events|
12
- events.each do |event|
13
- handler.refresh(event.path)
6
+ if FSSM::Support.backend == 'FSEvents'
7
+ # monkey-patch to set latency to 0
8
+ module FssmFSEventsMonkeyPatch
9
+ def patched_add_handler(handler, preload=true)
10
+ @handlers[handler.path.to_s] = handler
11
+
12
+ fsevent = Rucola::FSEvents.new(handler.path.to_s, {:latency => 0.0}) do |events|
13
+ events.each do |event|
14
+ handler.refresh(event.path)
15
+ end
14
16
  end
15
- end
16
17
 
17
- fsevent.create_stream
18
- handler.refresh(nil, true) if preload
19
- fsevent.start
20
- @fsevents << fsevent
18
+ fsevent.create_stream
19
+ handler.refresh(nil, true) if preload
20
+ fsevent.start
21
+ @fsevents << fsevent
22
+ end
21
23
  end
22
24
  end
23
25
 
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 0
8
- - 3
9
- version: 0.0.3
8
+ - 4
9
+ version: 0.0.4
10
10
  platform: ruby
11
11
  authors:
12
12
  - Andrey Tarantsov