directory_watcher 1.3.0 → 1.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/History.txt +5 -0
- data/lib/directory_watcher.rb +4 -3
- data/lib/directory_watcher/rev_scanner.rb +4 -3
- metadata +2 -2
data/History.txt
CHANGED
data/lib/directory_watcher.rb
CHANGED
@@ -211,7 +211,7 @@ require 'yaml'
|
|
211
211
|
#
|
212
212
|
class DirectoryWatcher
|
213
213
|
|
214
|
-
VERSION = '1.3.
|
214
|
+
VERSION = '1.3.1' # :nodoc:
|
215
215
|
|
216
216
|
# An +Event+ structure contains the _type_ of the event and the file _path_
|
217
217
|
# to which the event pertains. The type can be one of the following:
|
@@ -451,7 +451,7 @@ class DirectoryWatcher
|
|
451
451
|
# already running, this method will return without taking any action.
|
452
452
|
#
|
453
453
|
def start
|
454
|
-
return if running?
|
454
|
+
return self if running?
|
455
455
|
|
456
456
|
load!
|
457
457
|
@scanner.start
|
@@ -462,7 +462,7 @@ class DirectoryWatcher
|
|
462
462
|
# already stopped, this method will return without taking any action.
|
463
463
|
#
|
464
464
|
def stop
|
465
|
-
return unless running?
|
465
|
+
return self unless running?
|
466
466
|
|
467
467
|
@scanner.stop
|
468
468
|
self
|
@@ -487,6 +487,7 @@ class DirectoryWatcher
|
|
487
487
|
File.delete(@persist) if @persist and test(?f, @persist)
|
488
488
|
@scanner.reset pre_load
|
489
489
|
start if was_running
|
490
|
+
self
|
490
491
|
end
|
491
492
|
|
492
493
|
# call-seq:
|
@@ -57,9 +57,6 @@ class DirectoryWatcher::RevScanner < ::DirectoryWatcher::Scanner
|
|
57
57
|
def stop
|
58
58
|
return unless running?
|
59
59
|
|
60
|
-
@thread._rev_loop.stop rescue nil
|
61
|
-
@thread = nil
|
62
|
-
|
63
60
|
@timer.detach
|
64
61
|
@timer = nil
|
65
62
|
|
@@ -67,6 +64,10 @@ class DirectoryWatcher::RevScanner < ::DirectoryWatcher::Scanner
|
|
67
64
|
@watchers.clear
|
68
65
|
|
69
66
|
notify
|
67
|
+
|
68
|
+
@thread._rev_loop.stop rescue nil
|
69
|
+
@thread.kill # for some reason the rev loop is not returning after stopping
|
70
|
+
@thread = nil
|
70
71
|
end
|
71
72
|
|
72
73
|
# :stopdoc:
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: directory_watcher
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.3.
|
4
|
+
version: 1.3.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tim Pease
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2009-10-
|
12
|
+
date: 2009-10-26 00:00:00 -06:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|