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 +4 -4
- data/README.md +3 -0
- data/lib/listen/listener.rb +2 -1
- data/lib/listen/version.rb +1 -1
- data/spec/lib/listen/listener_spec.rb +3 -1
- data/spec/support/acceptance_helper.rb +2 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c1becf59266f1a4dfdae77c1fe433948ddf3906b
|
4
|
+
data.tar.gz: d76d3ef28a4c8ac95661b21c6bbf604ecab56869
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
|
data/lib/listen/listener.rb
CHANGED
@@ -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
|
138
|
+
sleep options[:wait_for_delay]
|
138
139
|
end
|
139
140
|
|
140
141
|
_terminate_actors
|
data/lib/listen/version.rb
CHANGED
@@ -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
|
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.
|
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-
|
11
|
+
date: 2013-10-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: celluloid
|