em-dir-watcher 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/lib/em-dir-watcher/platform/nix.rb +15 -13
- metadata +2 -2
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.0.
|
1
|
+
0.0.4
|
@@ -3,21 +3,23 @@ module EMDirWatcher
|
|
3
3
|
module Platform
|
4
4
|
module NIX
|
5
5
|
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
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
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
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
|
|