listen 3.1.2 → 3.1.3

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c83fc5197518ce26c9de43ff1289e8c5c3ee7f7b
4
- data.tar.gz: d54ba768d057a1ed6023208b7382732b6a7509b8
3
+ metadata.gz: 816167305bd875d1942d087b9b203127bc3180a8
4
+ data.tar.gz: f018951d041163380bf9508be60bcaa1b000a1f7
5
5
  SHA512:
6
- metadata.gz: 1f1b592df753ac3a2b69cc8a79cea9c966669fba3e1384b61b101d989464dda234d9ef9334007212b017b316eeadafcc5ed4195bb838ae42dcf287e50a584aeb
7
- data.tar.gz: e0489b648d6d2b4c5ed0d2b06b232d4b46edba3ea715b15b383da262e3bb8124b59f9c30d0f6af6ca05467156852aacd61ae2d5dfca1ed998cfe7c42aa8689b6
6
+ metadata.gz: bbfa4d4ed6e784352374ea063f7538d2cce8fb9111597d0609be4fa64cc718eaff91d49aa3e55dbe4ac2024ec9da69ccde4400303b34d7b9bee7a0f64ac17d7c
7
+ data.tar.gz: d0adf5030f9074aa9132b464ba1069b35c1156cdd0bb8fc801ac8b6b9cde32e1569233a664504bb83b6858d274dd8564a06a3c92a44174dff2e613d1e6585ebd
@@ -35,7 +35,9 @@ module Listen
35
35
  end
36
36
 
37
37
  def _run
38
+ Thread.current[:listen_blocking_read_thread] = true
38
39
  @worker.run
40
+ Thread.current[:listen_blocking_read_thread] = false
39
41
  end
40
42
 
41
43
  def _process_event(dir, event)
@@ -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.children)
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.children)
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
- killed.pop.join until killed.empty?
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
@@ -15,7 +15,7 @@ module Listen
15
15
 
16
16
  def children
17
17
  child_relative = _join
18
- (Dir.entries(sys_path) - %w(. ..)).map do |name|
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
@@ -1,3 +1,3 @@
1
1
  module Listen
2
- VERSION = '3.1.2'.freeze
2
+ VERSION = '3.1.3'.freeze
3
3
  end
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.2
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-04-30 00:00:00.000000000 Z
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.3
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.3
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.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.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.3.5
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.3.5
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.4
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.4.5.1
148
+ rubygems_version: 2.5.1
137
149
  signing_key:
138
150
  specification_version: 4
139
151
  summary: Listen to file modifications