file-watcher 1.0.2 → 1.0.3
Sign up to get free protection for your applications and to get access to all the features.
- data/bin/watcher +3 -9
- metadata +2 -2
data/bin/watcher
CHANGED
@@ -42,21 +42,16 @@ class Watcher < BaseApp
|
|
42
42
|
return
|
43
43
|
end
|
44
44
|
end
|
45
|
-
|
46
|
-
# we don't care about things like 'ls' or other changes on the directory itself
|
47
|
-
return if flags[:isdir]
|
48
|
-
|
49
|
-
puts "handle event: #{event.name} was #{flags.inspect}"
|
50
45
|
end
|
51
46
|
|
52
47
|
|
53
48
|
|
54
49
|
def run
|
55
50
|
@control_dir = self.control_dir || '.'
|
56
|
-
|
57
|
-
|
51
|
+
|
52
|
+
|
58
53
|
Dir["#{@watch_job_dir}/*.rb"].each do |f|
|
59
|
-
require
|
54
|
+
require f
|
60
55
|
end
|
61
56
|
|
62
57
|
@notifier = INotify::Notifier.new
|
@@ -74,7 +69,6 @@ class Watcher < BaseApp
|
|
74
69
|
end
|
75
70
|
|
76
71
|
@notifier.watch(@control_dir, :close_write, :close_nowrite, :create, :delete, :modify, :moved_from, :moved_to, :delete_self, :move_self, :recursive) do |event|
|
77
|
-
puts "CONTROL DIR HIT: #{@control_dir}"
|
78
72
|
handle_event event, make_flags_map(event.flags)
|
79
73
|
end
|
80
74
|
|