rehctaw 1.1.3 → 1.1.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/bin/rehctaw +4 -0
  3. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 248b4c0a3c68bec8b19cd0c3e800ef6230018fa4
4
- data.tar.gz: 70589f5724176d19475303c33f54ce32c3f67b8a
3
+ metadata.gz: ba12821bcab9856342d57b9c255fa60ae98053f5
4
+ data.tar.gz: f770cab1e8673b3e6fb5fdd3e0865a4a92adbff3
5
5
  SHA512:
6
- metadata.gz: 1853155bb43852ea5fe2a8a211f62576c6aaf5215b9edb22626ef7486e79298cfe67c3056c40ff1f4ac61337a02852d01773e2a4b4c784397dc75b3beb5e9ba7
7
- data.tar.gz: 7a552bb268f4d8c09a08cdf6348e5856685432b8699278aae65173eb1c6318e0e1896eb4fdecd6f520ced496b2c461ceb1c8a779e35aa8da5813300f0b253e88
6
+ metadata.gz: 8013edc2cd1d856e298a5e81a27bd9e51d9efb3ded207b50cd745506932f39ac8ba55524d4edab1c2623ee94b7cd6c4cf4b4e51c99dc93583c50f0cda735cca9
7
+ data.tar.gz: f9848b847a7443f8ef551af1245eb86c80a21b1612849f52702420822dd80ccd6a5aedcaf2b42616c60cbb0e84e3f6062d0ccb0de4211b49fb827bf178c22ee4
@@ -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"]]
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rehctaw
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.3
4
+ version: 1.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Anh K. Huynh