rehctaw 1.1.1 → 1.1.2

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.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +6 -1
  3. data/bin/rehctaw +5 -4
  4. metadata +7 -7
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 52bdd0357b77fbd19825f9cbe698a35ba024ba87
4
- data.tar.gz: 1f584f7e65da9fa005c19b4aa3ecf886439ce991
3
+ metadata.gz: 91f41bb56706ea445a05ba5bb740bf9926a094e1
4
+ data.tar.gz: 0725d3358ff16c5a09b950d5df23504cd809d330
5
5
  SHA512:
6
- metadata.gz: 3d7a13db6f39cdb4bfe59f47b0191eb538c08165084645f3830ecd2d61b4b9ea672fa835256b673c75d14775f519c21ce444ddd567ea4c6affb4d46375085d7c
7
- data.tar.gz: 266fed86851ed1a113c1c53333f60138df14a502b7fcc2bc94c005f42b271a166ab082dbcc35716524bdbf7f53f71b66323eb479364bfcac4c8d6fe76e9fccb5
6
+ metadata.gz: 36a8276a0d1082de3db1f82b6e7b08ea5feb695dd507439dabfb940d3a6890a51ed85a24f38e985a8f752d25af369dc569362a3ac532462770bcd36d25b41480
7
+ data.tar.gz: fcc72d40aaf5ad62ca7ec8e1d5bec342f5a9502886b85a8f36dd736b43334215e315075598e6ecfb83978c7066d06e649070fc8b0b226dd4320c83b59d2bb414
data/README.md CHANGED
@@ -15,11 +15,16 @@ To use this example, type
15
15
 
16
16
  $ cp ./examples/simple.yaml ./examples/mine.yaml
17
17
  $ ./bin/rehctaw ./examples/mine.yaml
18
+
19
+ On another terminal, type for examples
20
+
18
21
  $ echo foobar > /tmp/watcher
19
22
  $ echo reload > /tmp/watcher
20
23
 
24
+ You will see some notifications from the output of `rehctaw` command.
25
+
21
26
  You can update the file `./examples/mine.yaml`. The program will use
22
- new settings in the next run.
27
+ new settings in the next check.
23
28
 
24
29
  ## License
25
30
 
@@ -17,7 +17,7 @@ GLOBAL_WATCHER = {
17
17
  "mtime" => 0
18
18
  }
19
19
 
20
- _default_watcher = {
20
+ DEFAULT_WATCHER = {
21
21
  "interval" => 5,
22
22
  "stop" => "/bin/true",
23
23
  "start" => "/bin/true",
@@ -42,11 +42,12 @@ def _configuration_rescan(watcher, config_file)
42
42
  GLOBAL_WATCHER["mtime"] = new_mtime
43
43
  begin
44
44
  new_watcher = YAML.load_file(config_file)
45
- watcher.merge!(new_watcher["watcher"])
45
+
46
+ watcher = DEFAULT_WATCHER.merge(new_watcher["watcher"])
46
47
  watcher["interval"] = [1, watcher["interval"].to_i.abs].max
47
48
  watcher["timeout"] = [1, watcher["timeout"].to_i.abs].max
48
49
 
49
- _say "Info: Config reload => #{new_watcher.inspect}"
50
+ _say "Info: Config reload => #{watcher.inspect}"
50
51
  rescue => e
51
52
  _say "Error: #{e}"
52
53
  return watcher
@@ -62,7 +63,7 @@ if ARGV.size < 1
62
63
  end
63
64
 
64
65
  GLOBAL_WATCHER["file"] = ARGV.first
65
- watcher = _configuration_rescan(_default_watcher, GLOBAL_WATCHER["file"])
66
+ watcher = _configuration_rescan(DEFAULT_WATCHER, GLOBAL_WATCHER["file"])
66
67
 
67
68
  while true
68
69
  executable = false
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.1
4
+ version: 1.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Anh K. Huynh
@@ -10,9 +10,9 @@ bindir: bin
10
10
  cert_chain: []
11
11
  date: 2015-02-26 00:00:00.000000000 Z
12
12
  dependencies: []
13
- description: "`rehctaw` watches contents of a file, and executes system commands according
13
+ description: '`rehctaw` watches contents of a file, and executes system commands according
14
14
  to those contents. The commands, intervals, ... are provided in a YAML configuration
15
- file which is also watched."
15
+ file which is also watched.'
16
16
  email: kyanh@theslinux.org
17
17
  executables:
18
18
  - rehctaw
@@ -31,18 +31,18 @@ require_paths:
31
31
  - lib
32
32
  required_ruby_version: !ruby/object:Gem::Requirement
33
33
  requirements:
34
- - - ">="
34
+ - - '>='
35
35
  - !ruby/object:Gem::Version
36
36
  version: '0'
37
37
  required_rubygems_version: !ruby/object:Gem::Requirement
38
38
  requirements:
39
- - - ">="
39
+ - - '>='
40
40
  - !ruby/object:Gem::Version
41
41
  version: '0'
42
42
  requirements: []
43
43
  rubyforge_project:
44
- rubygems_version: 2.4.5
44
+ rubygems_version: 2.0.14
45
45
  signing_key:
46
46
  specification_version: 4
47
- summary: "`rehctaw` executes system commands according to file contents"
47
+ summary: '`rehctaw` executes system commands according to file contents'
48
48
  test_files: []