dirwatch 0.0.5 → 0.0.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/dirwatch/executors.rb +9 -1
- data/lib/dirwatch/options/parser.rb +7 -0
- data/lib/dirwatch/settings/watch_setting.rb +5 -1
- data/lib/dirwatch/version.rb +1 -1
- data/lib/dirwatch/watcher.rb +3 -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: 839c8fc639962596a0533b78921a3de363c0c7a9
|
4
|
+
data.tar.gz: 7471888ddf3f437b68ad7f2e5ff0f3921d0ea614
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5d7b4a0af9c358adf72fe4e63013e917c46a38367d7de275221409f48639f6bec267947a406ecc2df6d094e157c9eb3376ae1c9af7281a5bcead2051026d921c
|
7
|
+
data.tar.gz: 5237b8d00a9cc66a97275dbbf7aeddb9f3935819e9e48e7e2faddc392b9a42e30eb089636497715c795856001034c0862958b8f7953bfbf95c6e4a2f065e8068
|
data/lib/dirwatch/executors.rb
CHANGED
@@ -17,16 +17,20 @@ module Dirwatch
|
|
17
17
|
|
18
18
|
watcher = Watcher.new options
|
19
19
|
watcher.start
|
20
|
+
puts "Watching files..."
|
20
21
|
|
21
22
|
begin
|
22
23
|
watcher.wait_for_stop
|
23
24
|
rescue Interrupt
|
24
|
-
|
25
|
+
interrupted
|
25
26
|
ensure
|
26
27
|
stop_watcher watcher
|
27
28
|
end
|
28
29
|
end
|
29
30
|
|
31
|
+
def interrupted
|
32
|
+
end
|
33
|
+
|
30
34
|
def stop_watcher watcher
|
31
35
|
watcher.stop
|
32
36
|
end
|
@@ -60,5 +64,9 @@ module Dirwatch
|
|
60
64
|
puts 'shutting down...'
|
61
65
|
super
|
62
66
|
end
|
67
|
+
|
68
|
+
def interuppted
|
69
|
+
exit 0
|
70
|
+
end
|
63
71
|
end
|
64
72
|
end
|
@@ -52,6 +52,7 @@ module Dirwatch
|
|
52
52
|
end
|
53
53
|
|
54
54
|
add_alternatives opts, @alternatives
|
55
|
+
add_version opts
|
55
56
|
end
|
56
57
|
end
|
57
58
|
|
@@ -62,6 +63,12 @@ module Dirwatch
|
|
62
63
|
alternatives.each {|a| opts.separator " #{a}" }
|
63
64
|
end
|
64
65
|
|
66
|
+
def add_version opts
|
67
|
+
require 'dirwatch/version'
|
68
|
+
opts.separator ''
|
69
|
+
opts.separator "Version: #{::Dirwatch::VERSION}"
|
70
|
+
end
|
71
|
+
|
65
72
|
def limit_number_of_args limit, args
|
66
73
|
return if args.size <= limit
|
67
74
|
$stderr.puts "Unknown arguments: #{args.map(&:inspect).join(', ')}"
|
@@ -45,8 +45,12 @@ module Dirwatch
|
|
45
45
|
}
|
46
46
|
end
|
47
47
|
|
48
|
+
def inspect
|
49
|
+
"#<#{self.class} #{key}: #{to_s}>"
|
50
|
+
end
|
51
|
+
|
48
52
|
def to_s
|
49
|
-
|
53
|
+
to_h.map {|k, v| "#{k}=#{v.inspect}" }.join ' '
|
50
54
|
end
|
51
55
|
|
52
56
|
private
|
data/lib/dirwatch/version.rb
CHANGED
data/lib/dirwatch/watcher.rb
CHANGED
@@ -21,7 +21,9 @@ module Dirwatch
|
|
21
21
|
|
22
22
|
Thread.abort_on_exception = true
|
23
23
|
@settings.by_interval do |interval, watch_settings|
|
24
|
-
|
24
|
+
if @options.verbose
|
25
|
+
watch_settings.each {|ws| puts "Watching #{ws}" }
|
26
|
+
end
|
25
27
|
@threads << Thread.new do
|
26
28
|
run interval, watch_settings
|
27
29
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dirwatch
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nicolas Ganz
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-12-
|
11
|
+
date: 2017-12-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rspec
|