listen 2.1.2 → 2.2.0

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: 3180ffbcfea6081549f77f8de2c76672e9dadaa2
4
- data.tar.gz: d082a4d5a997a4c685478cb4e1d35b6cc17985f8
3
+ metadata.gz: c1becf59266f1a4dfdae77c1fe433948ddf3906b
4
+ data.tar.gz: d76d3ef28a4c8ac95661b21c6bbf604ecab56869
5
5
  SHA512:
6
- metadata.gz: 98ea7c391b7a68aead8022e6f103bec045080085af8e035fe84e00395af4d95d2c0d3b9f96841dd911a2fbf9ea4d6197e8ee4d668a1fa38dc8533c77aef6f149
7
- data.tar.gz: 45399c9d694fa991608655368dfe734fe8c4af0a04bca05e207eabd715b22b6d76764909dfae62911ffd24be38de2d45ff7a7a4d7a78762817efd79c95b82b07
6
+ metadata.gz: 6cd16d944719dac5cda7bfae7254b47cbd77c2e32083305ebecaeb115d200ef246fc5366a923d413424549bc875891075f200fb4e0a6a3bfcac850bf642f80db
7
+ data.tar.gz: 9119e9c3995d0b74d668132722971926bbd10dda5a76d223fe828c234461dcb036185de06a72408b24f8fef9599cacdddfdb532db071a90c8b3c941cab4d54bb
data/README.md CHANGED
@@ -116,6 +116,9 @@ ignore!: %r{/foo/bar} # Same as ignore options, but ov
116
116
  latency: 0.5 # Set the delay (**in seconds**) between checking for changes
117
117
  # default: 0.25 sec (1.0 sec for polling)
118
118
 
119
+ wait_for_delay: 4 # Set the delay (**in seconds**) between calls to the callback when changes exist
120
+ # default: 0.10 sec
121
+
119
122
  force_polling: true # Force the use of the polling adapter
120
123
  # default: none
121
124
 
@@ -100,6 +100,7 @@ module Listen
100
100
  def _init_options(options = {})
101
101
  { debug: false,
102
102
  latency: nil,
103
+ wait_for_delay: 0.1,
103
104
  force_polling: false,
104
105
  polling_fallback_message: nil }.merge(options)
105
106
  end
@@ -134,7 +135,7 @@ module Listen
134
135
  unless changes.all? { |_,v| v.empty? }
135
136
  block.call(changes[:modified], changes[:added], changes[:removed])
136
137
  end
137
- sleep 0.1
138
+ sleep options[:wait_for_delay]
138
139
  end
139
140
 
140
141
  _terminate_actors
@@ -1,3 +1,3 @@
1
1
  module Listen
2
- VERSION = '2.1.2'
2
+ VERSION = '2.2.0'
3
3
  end
@@ -37,15 +37,17 @@ describe Listen::Listener do
37
37
  expect(listener.options).to eq({
38
38
  debug: false,
39
39
  latency: nil,
40
+ wait_for_delay: 0.1,
40
41
  force_polling: false,
41
42
  polling_fallback_message: nil })
42
43
  end
43
44
 
44
45
  it "sets new options on initialize" do
45
- listener = Listen::Listener.new('lib', latency: 1.234)
46
+ listener = Listen::Listener.new('lib', latency: 1.234, wait_for_delay: 0.85)
46
47
  expect(listener.options).to eq({
47
48
  debug: false,
48
49
  latency: 1.234,
50
+ wait_for_delay: 0.85,
49
51
  force_polling: false,
50
52
  polling_fallback_message: nil })
51
53
  end
@@ -1,9 +1,9 @@
1
1
  def listen
2
- sleep 0.25 # wait for changes
2
+ sleep 0.5 # wait for changes
3
3
  sleep_until_next_second
4
4
  reset_changes
5
5
  yield
6
- sleep 0.25 # wait for changes
6
+ sleep 0.5 # wait for changes
7
7
  @changes
8
8
  end
9
9
 
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.1.2
4
+ version: 2.2.0
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: 2013-10-28 00:00:00.000000000 Z
11
+ date: 2013-10-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: celluloid