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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 31cbd0621bbc7503ca3a3239d6af0a796944ec97
4
- data.tar.gz: a8c58b2604188b167c3f8f9ae31d34aa3ffd593a
3
+ metadata.gz: 00459a29639db27606681aa701f668d53134b3f8
4
+ data.tar.gz: a181ae4cf18614fd7622c668c1959eb51403674d
5
5
  SHA512:
6
- metadata.gz: f08ecd2918a8ae98493be6ffdf2f8062c2cedc835b780a59d55f0225d4a062b92712e1c7eb756879efd9fe29917e0f7d667e5a36a0abc4c8433bf7ee02c2565f
7
- data.tar.gz: fb4b454fe90e5eb549420dbe3745d12a4edeea9e3df5613e39817d9dfad7c835b624b60644b972c9c3ab4e2e59fec83cc17af807ac667952718b1873dd5fea31
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
- @workers.pop.run
35
+ next_worker.run
34
36
  rescue
35
37
  _log_exception 'run() in extra thread(s) failed: %s: %s'
36
38
  end
@@ -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 = Thread::Queue.new
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 = Thread::Queue.new
40
+ q = ::Queue.new
39
41
  @wait_thread = Internals::ThreadPool.add do
40
42
  _wait_for_changes(q, config)
41
43
  end
@@ -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 = Thread::Queue.new
17
+ @event_queue = ::Queue.new
16
18
  @block = block
17
19
  @config = config
18
20
  end
data/lib/listen/logger.rb CHANGED
@@ -1,6 +1,6 @@
1
1
  module Listen
2
2
  def self.logger
3
- @logger
3
+ @logger ||= nil
4
4
  end
5
5
 
6
6
  def self.logger=(logger)
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
@@ -1,3 +1,3 @@
1
1
  module Listen
2
- VERSION = '3.0.2'
2
+ VERSION = '3.0.3'
3
3
  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: 3.0.2
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-08 00:00:00.000000000 Z
11
+ date: 2015-07-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rb-fsevent