rehctaw 1.1.3 → 1.1.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/rehctaw +4 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ba12821bcab9856342d57b9c255fa60ae98053f5
|
4
|
+
data.tar.gz: f770cab1e8673b3e6fb5fdd3e0865a4a92adbff3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8013edc2cd1d856e298a5e81a27bd9e51d9efb3ded207b50cd745506932f39ac8ba55524d4edab1c2623ee94b7cd6c4cf4b4e51c99dc93583c50f0cda735cca9
|
7
|
+
data.tar.gz: f9848b847a7443f8ef551af1245eb86c80a21b1612849f52702420822dd80ccd6a5aedcaf2b42616c60cbb0e84e3f6062d0ccb0de4211b49fb827bf178c22ee4
|
data/bin/rehctaw
CHANGED
@@ -48,6 +48,7 @@ def _configuration_rescan(watcher, config_file)
|
|
48
48
|
watcher["timeout"] = [1, watcher["timeout"].to_i.abs].max
|
49
49
|
|
50
50
|
# FIXME: _say "Info: Config reload => #{watcher.inspect}"
|
51
|
+
_say "Info: Config reloaded"
|
51
52
|
rescue => e
|
52
53
|
_say "Error: #{e}"
|
53
54
|
return watcher
|
@@ -76,12 +77,15 @@ while true
|
|
76
77
|
# FIXME: reading the whole file may not a good idea. It's slow
|
77
78
|
# FIXME: should find a way to read the first line of a file.
|
78
79
|
new_action = File.readlines(watcher["file"]).first.to_s.strip
|
80
|
+
new_action = "noop" if new_action.empty?
|
79
81
|
watcher["action"] = new_action
|
80
82
|
end
|
81
83
|
else
|
82
84
|
_say "Error: Action file '#{watcher["file"]}' unreadable"
|
83
85
|
end
|
84
86
|
|
87
|
+
executable = false if watcher["action"] == "noop"
|
88
|
+
|
85
89
|
if executable
|
86
90
|
if watcher[watcher["action"]]
|
87
91
|
command = watcher[watcher["action"]]
|