listen 2.0.2 → 2.0.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f1ef71466671d87c8158b8c6950bfa8eb14ea4ed
4
- data.tar.gz: 8b5506ec65a6015c2e54218cc4f0da8c92499788
3
+ metadata.gz: b027cf8c04a390cc6b96926228e2fff2eef7a47c
4
+ data.tar.gz: 9f3ed4ac9ac99325d33240d33284e1aaaad2c25e
5
5
  SHA512:
6
- metadata.gz: 2f11e6f1bae499a53670028cd4d5cf2c5a157f176f27043a29b527cac850c042bc194b2d0256753b33ac97b7b17011a96c75445607d0fd6b9574c98fe5eac8b4
7
- data.tar.gz: 2c48de590e7c2dc80b1d32c546de329c8b117eafc0fbdd7f414021273ec724684d6ca2c8c327b6f651e4c173f2065beae382902aa0b299efda9b3624b3673789
6
+ metadata.gz: 153f0804b8dc9a45a257d017e13ad22b3ca480c28b574adc2ed4dd5584e81f9aaf6a0000ae7c042f1a1b80f99cb160e94a13a4c434b37745d711ff77e3d4fd67
7
+ data.tar.gz: 4e0f61e9594c92772e9123eef689a176ac65a9fb26539275363146b7b58a06cf47a15af8ffc577170720328b68230831536e64368416dd5618898f15829af9d1
@@ -35,7 +35,7 @@ module Listen
35
35
 
36
36
  def _default_ignored_directories_patterns
37
37
  ignored_directories = DEFAULT_IGNORED_DIRECTORIES.map { |d| Regexp.escape(d) }
38
- %r{(?:#{ignored_directories.join('|')})/}
38
+ %r{/(?:#{ignored_directories.join('|')})(/|$)}
39
39
  end
40
40
 
41
41
  def _default_ignored_extensions_patterns
@@ -1,3 +1,3 @@
1
1
  module Listen
2
- VERSION = "2.0.2"
2
+ VERSION = "2.0.3"
3
3
  end
@@ -1,8 +1,14 @@
1
1
  require 'spec_helper'
2
2
 
3
3
  describe Listen::Adapter::Polling do
4
- let(:listener) { double(Listen::Listener, options: {}) }
4
+ let(:listener) { double(Listen::Listener, options: {}, listen?: true) }
5
5
  let(:adapter) { described_class.new(listener) }
6
+ let(:change_pool) { double(Listen::Change, terminate: true) }
7
+ let(:change_pool_async) { double('ChangePoolAsync') }
8
+ before {
9
+ change_pool.stub(:async) { change_pool_async }
10
+ Celluloid::Actor.stub(:[]).with(:listen_change_pool) { change_pool }
11
+ }
6
12
 
7
13
  describe ".usable?" do
8
14
  it "returns always true" do
@@ -18,7 +24,7 @@ describe Listen::Adapter::Polling do
18
24
  }
19
25
 
20
26
  it "notifies change on every listener directories path" do
21
- adapter.should_receive(:_notify_change).with('directory_path', type: 'Dir', recursive: true)
27
+ expect(change_pool_async).to receive(:change).with('directory_path', type: 'Dir', recursive: true)
22
28
  t = Thread.new { adapter.start }
23
29
  sleep 0.01
24
30
  t.kill
@@ -9,26 +9,38 @@ describe Listen::Silencer do
9
9
 
10
10
  context "default ignore" do
11
11
  Listen::Silencer::DEFAULT_IGNORED_DIRECTORIES.each do |dir|
12
- let(:path) { pwd.join(dir) }
12
+ describe do
13
+ let(:path) { pwd.join(dir) }
13
14
 
14
- it "silences default ignored directory: #{dir}" do
15
- expect(silencer.silenced?(path)).to be_true
16
- end
15
+ it "silences default ignored directory: #{dir}" do
16
+ expect(silencer.silenced?(path)).to be_true
17
+ end
18
+
19
+ context "with a directory beginning with the same name" do
20
+ let(:path) { pwd.join("#{dir}foo") }
17
21
 
18
- context "with a directory just containing the same name" do
19
- let(:path) { pwd.join("#{dir}foo") }
22
+ it "doesn't silences default ignored directory: #{dir}foo" do
23
+ expect(silencer.silenced?(path)).to be_false
24
+ end
25
+ end
26
+
27
+ context "with a directory ending with the same name" do
28
+ let(:path) { pwd.join("foo#{dir}") }
20
29
 
21
- it "doesn't silences default ignored directory: #{dir}foo" do
22
- expect(silencer.silenced?(path)).to be_false
30
+ it "doesn't silences default ignored directory: foo#{dir}" do
31
+ expect(silencer.silenced?(path)).to be_false
32
+ end
23
33
  end
24
34
  end
25
35
  end
26
36
 
27
37
  Listen::Silencer::DEFAULT_IGNORED_EXTENSIONS.each do |extension|
28
- let(:path) { pwd.join(extension) }
38
+ describe do
39
+ let(:path) { pwd.join(extension) }
29
40
 
30
- it "silences default ignored extension: #{extension}" do
31
- expect(silencer.silenced?(path)).to be_true
41
+ it "silences default ignored extension: #{extension}" do
42
+ expect(silencer.silenced?(path)).to be_true
43
+ end
32
44
  end
33
45
  end
34
46
  end
@@ -23,12 +23,16 @@ RSpec.configure do |config|
23
23
  end
24
24
  end
25
25
 
26
+ require 'rspec/retry'
27
+ RSpec.configure do |config|
28
+ config.default_retry_count = ci? ? 3 : 1
29
+ end
26
30
 
27
- # Crash loud in tests!
31
+ require 'celluloid/rspec'
28
32
  Thread.abort_on_exception = true
29
33
  Celluloid.logger.level = Logger::ERROR
30
34
 
31
- require 'rspec/retry'
32
- RSpec.configure do |config|
33
- config.default_retry_count = ci? ? 3 : 1
35
+ RSpec.configuration.before(:each) do
36
+ Celluloid.shutdown
37
+ Celluloid.boot
34
38
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: listen
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.2
4
+ version: 2.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Thibaud Guillaume-Gentil
@@ -159,7 +159,6 @@ files:
159
159
  - spec/lib/listen_spec.rb
160
160
  - spec/spec_helper.rb
161
161
  - spec/support/acceptance_helper.rb
162
- - spec/support/actor_helper.rb
163
162
  - spec/support/fixtures_helper.rb
164
163
  - spec/support/platform_helper.rb
165
164
  homepage: https://github.com/guard/listen
@@ -204,6 +203,5 @@ test_files:
204
203
  - spec/lib/listen_spec.rb
205
204
  - spec/spec_helper.rb
206
205
  - spec/support/acceptance_helper.rb
207
- - spec/support/actor_helper.rb
208
206
  - spec/support/fixtures_helper.rb
209
207
  - spec/support/platform_helper.rb
@@ -1,13 +0,0 @@
1
- RSpec.configuration.before(:each) do
2
- Celluloid.logger = nil
3
- Celluloid.shutdown
4
- Celluloid.boot
5
- if RUBY_PLATFORM != "java"
6
- class Celluloid::ActorProxy
7
- unless @rspec_compatible
8
- @rspec_compatible = true
9
- undef_method :should_receive
10
- end
11
- end
12
- end
13
- end