rb-inotify 0.11.0 → 0.11.1
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.
- checksums.yaml +4 -4
- data/lib/rb-inotify/notifier.rb +6 -11
- data/lib/rb-inotify/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f0606a3b14ba7783689483410651837223b0a9d2967572cd768c421db22462bb
|
4
|
+
data.tar.gz: 28425a8d1c6c7067f365499185ef9916c0c9892fa467f74f5adbfc18039e4b19
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f8b727242e12cb3debd140ac9b3e45a114f77c0642f33faa252f258360113ccf1fa16fb4c08ed1c16772884aef22d913ce394d3a4bf2be8a0754865a09e39f13
|
7
|
+
data.tar.gz: '02940752a3b3c8b44a465b71300290d60b910def4a56dfac8949a8f69379b8b58b01d278e58cb99c138eb8a6187fb8f44307efae15c9a3bf7c265991f90aebb4'
|
data/lib/rb-inotify/notifier.rb
CHANGED
@@ -24,10 +24,8 @@ module INotify
|
|
24
24
|
# # Nothing happens until you run the notifier!
|
25
25
|
# notifier.run
|
26
26
|
class Notifier
|
27
|
-
# A list of directories that should never be recursively watched.
|
28
|
-
#
|
29
27
|
# * Files in `/dev/fd` sometimes register as directories, but are not enumerable.
|
30
|
-
|
28
|
+
NON_RECURSIVE = "/dev/fd"
|
31
29
|
|
32
30
|
# A hash from {Watcher} ids to the instances themselves.
|
33
31
|
#
|
@@ -198,20 +196,17 @@ module INotify
|
|
198
196
|
def watch(path, *flags, &callback)
|
199
197
|
return Watcher.new(self, path, *flags, &callback) unless flags.include?(:recursive)
|
200
198
|
|
201
|
-
|
199
|
+
dont_follow = flags.include?(:dont_follow)
|
202
200
|
|
203
|
-
|
201
|
+
Dir.each_child(path) do |base|
|
204
202
|
d = File.join(path, base)
|
205
|
-
|
206
|
-
next if
|
207
|
-
next if
|
208
|
-
next if flags.include?(:dont_follow) && File.symlink?(d)
|
209
|
-
next if !File.directory?(d)
|
203
|
+
next unless File.directory?(d)
|
204
|
+
next if dont_follow && File.symlink?(d)
|
205
|
+
next if NON_RECURSIVE == d
|
210
206
|
|
211
207
|
watch(d, *flags, &callback)
|
212
208
|
end
|
213
209
|
|
214
|
-
dir.close
|
215
210
|
|
216
211
|
rec_flags = [:create, :moved_to]
|
217
212
|
return watch(path, *((flags - [:recursive]) | rec_flags)) do |event|
|
data/lib/rb-inotify/version.rb
CHANGED