listen 3.0.4 → 3.0.5

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: 0c7fe2432921c30a0fc8bd2552a7bd2bac7b62b1
4
- data.tar.gz: b0fab87bbb62064ab57b6ddf9c8c9e08a9fa4d6a
3
+ metadata.gz: 4b59a31bbecd30ab120fd1275ecf8efab7fb40b6
4
+ data.tar.gz: 112070345fa8127b6963b527c5f117de8913f40a
5
5
  SHA512:
6
- metadata.gz: fcf5fda1fd7cd0a63652d481cf2570f724cad065fa3ff63d7fc81cf02f74f6fb3856c97625fbcbe5a067d8b4a30e15ca03d2a60f48556b7400af7e5e535e866d
7
- data.tar.gz: 6bd097ccf35884c62428ee1271c4b695ba90236adde490d39d44cbf18f883026599abdd30b11059c155d468b4b04e51401cf974998d70741360119d2f6ab2605
6
+ metadata.gz: baa38667f71ae00c579bce1be611f463b76810ce03bc7cbb854792809edba260b1f096ab431d95de84283a2c6ee6a18b4e3218d3ed34a5ccc4b0231a23edd62c
7
+ data.tar.gz: 89e5dbc7c8872f97fc18227b243966dc5ec56a5fbecae1a4ee586652121abf943f74fdaf73a80a4487daf3c7d32e26659c5b7c6bcf38a1508c2b58056333fd2f
@@ -85,12 +85,19 @@ module Listen
85
85
  end
86
86
  end
87
87
 
88
+ def stop
89
+ _stop
90
+ end
91
+
88
92
  def self.usable?
89
93
  const_get('OS_REGEXP') =~ RbConfig::CONFIG['target_os']
90
94
  end
91
95
 
92
96
  private
93
97
 
98
+ def _stop
99
+ end
100
+
94
101
  def _timed(title)
95
102
  start = Time.now.to_f
96
103
  yield
@@ -50,7 +50,7 @@ module Listen
50
50
  _log :debug, "fsevent: running worker: #{worker.inspect}"
51
51
  worker.run
52
52
  rescue
53
- _log_exception 'fsevent: running worker failed: %s: %s'
53
+ _log_exception 'fsevent: running worker failed: %s:%s called from: %s', caller
54
54
  end
55
55
 
56
56
  def _run_workers_in_background(workers)
@@ -97,6 +97,10 @@ module Listen
97
97
  def _dir_event?(event)
98
98
  event.flags.include?(:isdir)
99
99
  end
100
+
101
+ def _stop
102
+ @worker.close
103
+ end
100
104
  end
101
105
  end
102
106
  end
@@ -27,7 +27,7 @@ module Listen
27
27
  end
28
28
 
29
29
  def stop
30
- # TODO: does nothing
30
+ adapter.stop
31
31
  end
32
32
 
33
33
  def min_delay_between_events
@@ -20,10 +20,16 @@ module Listen
20
20
  rel_path, options.inspect, previous.inspect, current.inspect)
21
21
  end
22
22
 
23
- current.each do |full_path|
24
- type = detect_type(full_path)
25
- item_rel_path = full_path.relative_path_from(dir).to_s
26
- _change(snapshot, type, item_rel_path, options)
23
+ begin
24
+ current.each do |full_path|
25
+ type = ::File.lstat(full_path.to_s).directory? ? :dir : :file
26
+ item_rel_path = full_path.relative_path_from(dir).to_s
27
+ _change(snapshot, type, item_rel_path, options)
28
+ end
29
+ rescue Errno::ENOENT
30
+ # The directory changed meanwhile, so rescan it
31
+ current = Set.new(path.children)
32
+ retry
27
33
  end
28
34
 
29
35
  # TODO: this is not tested properly
@@ -66,15 +72,5 @@ module Listen
66
72
  opts.delete(:recursive)
67
73
  snapshot.invalidate(type, path, opts)
68
74
  end
69
-
70
- def self.detect_type(full_path)
71
- # TODO: should probably check record first
72
- stat = ::File.lstat(full_path.to_s)
73
- stat.directory? ? :dir : :file
74
- rescue Errno::ENOENT
75
- # TODO: ok, it should really check the record here
76
- # report as dir for scanning
77
- :dir
78
- end
79
75
  end
80
76
  end
@@ -11,7 +11,7 @@ module Listen
11
11
 
12
12
  Directory: %s
13
13
 
14
- is already begin watched through: %s
14
+ is already being watched through: %s
15
15
 
16
16
  MORE INFO: #{WIKI}
17
17
  EOS
@@ -1,3 +1,3 @@
1
1
  module Listen
2
- VERSION = '3.0.4'
2
+ VERSION = '3.0.5'
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.4
4
+ version: 3.0.5
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-11-04 00:00:00.000000000 Z
11
+ date: 2015-11-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rb-fsevent