listen 3.1.2 → 3.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/listen/adapter/linux.rb +2 -0
- data/lib/listen/directory.rb +13 -2
- data/lib/listen/internals/thread_pool.rb +9 -1
- data/lib/listen/record/entry.rb +12 -1
- data/lib/listen/version.rb +1 -1
- metadata +24 -12
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 816167305bd875d1942d087b9b203127bc3180a8
|
4
|
+
data.tar.gz: f018951d041163380bf9508be60bcaa1b000a1f7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bbfa4d4ed6e784352374ea063f7538d2cce8fb9111597d0609be4fa64cc718eaff91d49aa3e55dbe4ac2024ec9da69ccde4400303b34d7b9bee7a0f64ac17d7c
|
7
|
+
data.tar.gz: d0adf5030f9074aa9132b464ba1069b35c1156cdd0bb8fc801ac8b6b9cde32e1569233a664504bb83b6858d274dd8564a06a3c92a44174dff2e613d1e6585ebd
|
data/lib/listen/adapter/linux.rb
CHANGED
data/lib/listen/directory.rb
CHANGED
@@ -12,7 +12,7 @@ module Listen
|
|
12
12
|
|
13
13
|
# TODO: use children(with_directory: false)
|
14
14
|
path = dir + rel_path
|
15
|
-
current = Set.new(path
|
15
|
+
current = Set.new(_children(path))
|
16
16
|
|
17
17
|
Listen::Logger.debug do
|
18
18
|
format('%s: %s(%s): %s -> %s',
|
@@ -28,7 +28,7 @@ module Listen
|
|
28
28
|
end
|
29
29
|
rescue Errno::ENOENT
|
30
30
|
# The directory changed meanwhile, so rescan it
|
31
|
-
current = Set.new(path
|
31
|
+
current = Set.new(_children(path))
|
32
32
|
retry
|
33
33
|
end
|
34
34
|
|
@@ -72,5 +72,16 @@ module Listen
|
|
72
72
|
opts.delete(:recursive)
|
73
73
|
snapshot.invalidate(type, path, opts)
|
74
74
|
end
|
75
|
+
|
76
|
+
def self._children(path)
|
77
|
+
return path.children unless RUBY_ENGINE == 'jruby'
|
78
|
+
|
79
|
+
# JRuby inconsistency workaround, see:
|
80
|
+
# https://github.com/jruby/jruby/issues/3840
|
81
|
+
exists = path.exist?
|
82
|
+
directory = path.directory?
|
83
|
+
return path.children unless exists && !directory
|
84
|
+
raise Errno::ENOTDIR, path.to_s
|
85
|
+
end
|
75
86
|
end
|
76
87
|
end
|
@@ -13,8 +13,16 @@ module Listen
|
|
13
13
|
return if @threads.empty? # return to avoid using possibly stubbed Queue
|
14
14
|
|
15
15
|
killed = Queue.new
|
16
|
+
# You can't kill a read on a descriptor in JRuby, so let's just
|
17
|
+
# ignore running threads (listen rb-inotify waiting for disk activity
|
18
|
+
# before closing) pray threads die faster than they are created...
|
19
|
+
limit = RUBY_ENGINE == 'jruby' ? [1] : []
|
20
|
+
|
16
21
|
killed << @threads.pop.kill until @threads.empty?
|
17
|
-
|
22
|
+
until killed.empty?
|
23
|
+
th = killed.pop
|
24
|
+
th.join(*limit) unless th[:listen_blocking_read_thread]
|
25
|
+
end
|
18
26
|
end
|
19
27
|
end
|
20
28
|
end
|
data/lib/listen/record/entry.rb
CHANGED
@@ -15,7 +15,7 @@ module Listen
|
|
15
15
|
|
16
16
|
def children
|
17
17
|
child_relative = _join
|
18
|
-
(
|
18
|
+
(_entries(sys_path) - %w(. ..)).map do |name|
|
19
19
|
Entry.new(@root, child_relative, name)
|
20
20
|
end
|
21
21
|
end
|
@@ -48,6 +48,17 @@ module Listen
|
|
48
48
|
args = [@relative, @name].compact
|
49
49
|
args.empty? ? nil : ::File.join(*args)
|
50
50
|
end
|
51
|
+
|
52
|
+
def _entries(dir)
|
53
|
+
return Dir.entries(dir) unless RUBY_ENGINE == 'jruby'
|
54
|
+
|
55
|
+
# JRuby inconsistency workaround, see:
|
56
|
+
# https://github.com/jruby/jruby/issues/3840
|
57
|
+
exists = ::File.exist?(dir)
|
58
|
+
directory = ::File.directory?(dir)
|
59
|
+
return Dir.entries(dir) unless exists && !directory
|
60
|
+
raise Errno::ENOTDIR, dir
|
61
|
+
end
|
51
62
|
end
|
52
63
|
end
|
53
64
|
end
|
data/lib/listen/version.rb
CHANGED
metadata
CHANGED
@@ -1,33 +1,42 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: listen
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.1.
|
4
|
+
version: 3.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Thibaud Guillaume-Gentil
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-05-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rb-fsevent
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '0.9'
|
17
20
|
- - ">="
|
18
21
|
- !ruby/object:Gem::Version
|
19
|
-
version: 0.9.
|
22
|
+
version: 0.9.7
|
20
23
|
type: :runtime
|
21
24
|
prerelease: false
|
22
25
|
version_requirements: !ruby/object:Gem::Requirement
|
23
26
|
requirements:
|
27
|
+
- - "~>"
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: '0.9'
|
24
30
|
- - ">="
|
25
31
|
- !ruby/object:Gem::Version
|
26
|
-
version: 0.9.
|
32
|
+
version: 0.9.7
|
27
33
|
- !ruby/object:Gem::Dependency
|
28
34
|
name: rb-inotify
|
29
35
|
requirement: !ruby/object:Gem::Requirement
|
30
36
|
requirements:
|
37
|
+
- - "~>"
|
38
|
+
- !ruby/object:Gem::Version
|
39
|
+
version: '0.9'
|
31
40
|
- - ">="
|
32
41
|
- !ruby/object:Gem::Version
|
33
42
|
version: 0.9.7
|
@@ -35,6 +44,9 @@ dependencies:
|
|
35
44
|
prerelease: false
|
36
45
|
version_requirements: !ruby/object:Gem::Requirement
|
37
46
|
requirements:
|
47
|
+
- - "~>"
|
48
|
+
- !ruby/object:Gem::Version
|
49
|
+
version: '0.9'
|
38
50
|
- - ">="
|
39
51
|
- !ruby/object:Gem::Version
|
40
52
|
version: 0.9.7
|
@@ -44,28 +56,28 @@ dependencies:
|
|
44
56
|
requirements:
|
45
57
|
- - "~>"
|
46
58
|
- !ruby/object:Gem::Version
|
47
|
-
version: '1.
|
59
|
+
version: '1.2'
|
48
60
|
type: :runtime
|
49
61
|
prerelease: false
|
50
62
|
version_requirements: !ruby/object:Gem::Requirement
|
51
63
|
requirements:
|
52
64
|
- - "~>"
|
53
65
|
- !ruby/object:Gem::Version
|
54
|
-
version: '1.
|
66
|
+
version: '1.2'
|
55
67
|
- !ruby/object:Gem::Dependency
|
56
68
|
name: bundler
|
57
69
|
requirement: !ruby/object:Gem::Requirement
|
58
70
|
requirements:
|
59
|
-
- - "
|
71
|
+
- - "~>"
|
60
72
|
- !ruby/object:Gem::Version
|
61
|
-
version: 1.
|
73
|
+
version: '1.12'
|
62
74
|
type: :development
|
63
75
|
prerelease: false
|
64
76
|
version_requirements: !ruby/object:Gem::Requirement
|
65
77
|
requirements:
|
66
|
-
- - "
|
78
|
+
- - "~>"
|
67
79
|
- !ruby/object:Gem::Version
|
68
|
-
version: 1.
|
80
|
+
version: '1.12'
|
69
81
|
description: The Listen gem listens to file modifications and notifies you about the
|
70
82
|
changes. Works everywhere!
|
71
83
|
email: thibaud@thibaud.gg
|
@@ -125,7 +137,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
125
137
|
version: '2.2'
|
126
138
|
- - ">="
|
127
139
|
- !ruby/object:Gem::Version
|
128
|
-
version: 2.2.
|
140
|
+
version: 2.2.3
|
129
141
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
130
142
|
requirements:
|
131
143
|
- - ">="
|
@@ -133,7 +145,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
133
145
|
version: '0'
|
134
146
|
requirements: []
|
135
147
|
rubyforge_project:
|
136
|
-
rubygems_version: 2.
|
148
|
+
rubygems_version: 2.5.1
|
137
149
|
signing_key:
|
138
150
|
specification_version: 4
|
139
151
|
summary: Listen to file modifications
|