listen 3.0.2 → 3.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/listen/adapter/darwin.rb +4 -2
- data/lib/listen/event/loop.rb +4 -2
- data/lib/listen/event/queue.rb +3 -1
- data/lib/listen/logger.rb +1 -1
- data/lib/listen/record.rb +2 -1
- data/lib/listen/version.rb +1 -1
- 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: 00459a29639db27606681aa701f668d53134b3f8
|
4
|
+
data.tar.gz: a181ae4cf18614fd7622c668c1959eb51403674d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9a6946eb30532c847e6b6a059f99b50c7d1c7a51c77471fb65f864486d83a094e5a16ff725091ddd988cedbdf598fc333db7537ff2c36d4b4446178fc620dca3
|
7
|
+
data.tar.gz: b2a0b44994e84253bffe43872c309bef6e83edb65837ddc1d98d166c017f346f5ad835e00c042d39abddf7dedf5b7b954e090137fd7e6d0179cdac542cca3d14
|
@@ -1,3 +1,4 @@
|
|
1
|
+
require 'thread'
|
1
2
|
require 'listen/internals/thread_pool'
|
2
3
|
|
3
4
|
module Listen
|
@@ -17,7 +18,7 @@ module Listen
|
|
17
18
|
require 'rb-fsevent'
|
18
19
|
opts = { latency: options.latency }
|
19
20
|
|
20
|
-
@workers ||= Queue.new
|
21
|
+
@workers ||= ::Queue.new
|
21
22
|
@workers << FSEvent.new.tap do |worker|
|
22
23
|
worker.watch(dir.to_s, opts, &callback)
|
23
24
|
end
|
@@ -28,9 +29,10 @@ module Listen
|
|
28
29
|
def _run
|
29
30
|
first = @workers.pop
|
30
31
|
until @workers.empty?
|
32
|
+
next_worker = @workers.pop
|
31
33
|
Listen::Internals::ThreadPool.add do
|
32
34
|
begin
|
33
|
-
|
35
|
+
next_worker.run
|
34
36
|
rescue
|
35
37
|
_log_exception 'run() in extra thread(s) failed: %s: %s'
|
36
38
|
end
|
data/lib/listen/event/loop.rb
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
require 'thread'
|
2
|
+
|
1
3
|
require 'timeout'
|
2
4
|
require 'listen/event/processor'
|
3
5
|
|
@@ -13,7 +15,7 @@ module Listen
|
|
13
15
|
@config = config
|
14
16
|
@wait_thread = nil
|
15
17
|
@state = :paused
|
16
|
-
@reasons =
|
18
|
+
@reasons = ::Queue.new
|
17
19
|
end
|
18
20
|
|
19
21
|
def wakeup_on_event
|
@@ -35,7 +37,7 @@ module Listen
|
|
35
37
|
|
36
38
|
def setup
|
37
39
|
# TODO: use a Fiber instead?
|
38
|
-
q =
|
40
|
+
q = ::Queue.new
|
39
41
|
@wait_thread = Internals::ThreadPool.add do
|
40
42
|
_wait_for_changes(q, config)
|
41
43
|
end
|
data/lib/listen/event/queue.rb
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
require 'thread'
|
2
|
+
|
1
3
|
module Listen
|
2
4
|
module Event
|
3
5
|
class Queue
|
@@ -12,7 +14,7 @@ module Listen
|
|
12
14
|
end
|
13
15
|
|
14
16
|
def initialize(config, &block)
|
15
|
-
@event_queue =
|
17
|
+
@event_queue = ::Queue.new
|
16
18
|
@block = block
|
17
19
|
@config = config
|
18
20
|
end
|
data/lib/listen/logger.rb
CHANGED
data/lib/listen/record.rb
CHANGED
@@ -1,3 +1,4 @@
|
|
1
|
+
require 'thread'
|
1
2
|
require 'listen/record/entry'
|
2
3
|
require 'listen/record/symlink_detector'
|
3
4
|
|
@@ -62,7 +63,7 @@ module Listen
|
|
62
63
|
# TODO: test other permissions
|
63
64
|
# TODO: test with mixed encoding
|
64
65
|
symlink_detector = SymlinkDetector.new
|
65
|
-
remaining = Queue.new
|
66
|
+
remaining = ::Queue.new
|
66
67
|
remaining << Entry.new(root, nil, nil)
|
67
68
|
_fast_build_dir(remaining, symlink_detector) until remaining.empty?
|
68
69
|
end
|
data/lib/listen/version.rb
CHANGED
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: 3.0.
|
4
|
+
version: 3.0.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: 2015-07-
|
11
|
+
date: 2015-07-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rb-fsevent
|