listen 2.7.1 → 2.7.2
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/listen/adapter/linux.rb +3 -1
- data/lib/listen/version.rb +1 -1
- data/spec/lib/listen/adapter/linux_spec.rb +20 -0
- data/spec/support/acceptance_helper.rb +3 -2
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c2b82792fadddb794945b7796d42a8c35d3dabfc
|
4
|
+
data.tar.gz: e5f725bb1c8446f51fd54285c0c48f26d0740a67
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7441734e63b119c9139b4272c512a7bd34a6ab7e507dfdf99c7483a70108959fafc96c1e0b489dafe9648b41f77b58141efbb3c91c14889291590d03298319d3
|
7
|
+
data.tar.gz: 0d00f5195e985526a4697dda89d1e1015f2b39f0e2c4c9b776a91f92ecfae13f8ce4e207b0f17ee80bd5e024c3ff75d5b816a6877324d9c6d6f96d8aa9590e6b
|
data/lib/listen/adapter/linux.rb
CHANGED
@@ -14,7 +14,7 @@ module Listen
|
|
14
14
|
# The message to show when the limit of inotify watchers is not enough
|
15
15
|
#
|
16
16
|
INOTIFY_LIMIT_MESSAGE = <<-EOS.gsub(/^\s*/, '')
|
17
|
-
Listen error: unable to monitor directories for changes.
|
17
|
+
FATAL: Listen error: unable to monitor directories for changes.
|
18
18
|
|
19
19
|
Please head to https://github.com/guard/listen/wiki/Increasing-the-amount-of-inotify-watchers
|
20
20
|
for information on how to solve this issue.
|
@@ -33,6 +33,8 @@ module Listen
|
|
33
33
|
worker = _init_worker
|
34
34
|
Thread.new { worker.run }
|
35
35
|
rescue Errno::ENOSPC
|
36
|
+
STDERR.puts INOTIFY_LIMIT_MESSAGE
|
37
|
+
STDERR.flush
|
36
38
|
abort(INOTIFY_LIMIT_MESSAGE)
|
37
39
|
end
|
38
40
|
|
data/lib/listen/version.rb
CHANGED
@@ -17,6 +17,26 @@ describe Listen::Adapter::Linux do
|
|
17
17
|
expect(defined?(INotify)).to be_true
|
18
18
|
end
|
19
19
|
end
|
20
|
+
|
21
|
+
# workaround: Celluloid ignores SystemExit exception messages
|
22
|
+
describe "inotify limit message" do
|
23
|
+
let(:adapter) { described_class.new(listener) }
|
24
|
+
let(:expected_message) { described_class.const_get('INOTIFY_LIMIT_MESSAGE') }
|
25
|
+
|
26
|
+
before do
|
27
|
+
allow_any_instance_of(INotify::Notifier).to receive(:watch).and_raise(Errno::ENOSPC)
|
28
|
+
allow(listener).to receive(:directories) { [ 'foo/dir' ] }
|
29
|
+
end
|
30
|
+
|
31
|
+
it "should be show before calling abort" do
|
32
|
+
expect(STDERR).to receive(:puts).with(expected_message)
|
33
|
+
|
34
|
+
# Expect RuntimeError here, for the sake of unit testing (actual
|
35
|
+
# handling depends on Celluloid supervisor setup, which is beyond the
|
36
|
+
# scope of adapter tests)
|
37
|
+
expect{adapter.start}.to raise_error RuntimeError, expected_message
|
38
|
+
end
|
39
|
+
end
|
20
40
|
end
|
21
41
|
|
22
42
|
if darwin?
|
@@ -24,8 +24,9 @@ end
|
|
24
24
|
|
25
25
|
def relative_path(changes)
|
26
26
|
changes.map do |change|
|
27
|
-
|
28
|
-
|
27
|
+
unfrozen_copy = change.dup
|
28
|
+
[paths].flatten.each { |path| unfrozen_copy.gsub!(%r{#{path.to_s}/}, '') }
|
29
|
+
unfrozen_copy
|
29
30
|
end
|
30
31
|
end
|
31
32
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: listen
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.7.
|
4
|
+
version: 2.7.2
|
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: 2014-
|
11
|
+
date: 2014-04-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: celluloid
|
@@ -207,7 +207,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
207
207
|
version: '0'
|
208
208
|
requirements: []
|
209
209
|
rubyforge_project:
|
210
|
-
rubygems_version: 2.2.
|
210
|
+
rubygems_version: 2.2.2
|
211
211
|
signing_key:
|
212
212
|
specification_version: 4
|
213
213
|
summary: Listen to file modifications
|