rspawn 0.3.0 → 0.4.0

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 808e145c459114cf4a24056ca188b10c2e3de2a8
4
- data.tar.gz: e5e0518f35b59263f63c1d9ad2e9c725662247c9
3
+ metadata.gz: f1b223f15e2ea9693236cf02aaf83d458ba71974
4
+ data.tar.gz: f65f0cc73cce8090eef6a7b238609c50379afcd0
5
5
  SHA512:
6
- metadata.gz: 069428bf3aad0405cfff6a652bae5b28ee2f004a4734030e6ce67076313634c37cb2b57d966a0f1502ce1eea9535a3924cab5efd453833f0300b2c02505ebb3b
7
- data.tar.gz: 97cfeb88d60b15aeb23296a8db8c10cea0e823e706644b12d1020799bbf6e4908942a79525f020c2fc60d678429119db5077cf626a9b41532f10ccf5b726f9a9
6
+ metadata.gz: 054c3a793cb73d1ca2cfc159045b55b1f28472d796ca59e006aa66e0b384d5eb51aa83981d17d90724a29965a777be361ce8c8302f61e1d3faebe6767c0cc569
7
+ data.tar.gz: c43b2d7eb1a56bce81a11becee3831066422f21b68da066dc384b3228e4e2bda16355554f58c3ad7c365da2fc123358447dfd2194b2a190a383c0a3bf8ef73b5
@@ -32,6 +32,15 @@ module Rspawn
32
32
  start_action(options['command'], 'restart')
33
33
  end
34
34
 
35
+ desc "restart_all", "restart daemon"
36
+ option :command, aliases: '-c', type: :string, default: nil, desc: 'command'
37
+ def restart_all
38
+ get_keys.each do |key|
39
+ option, command = get_config(key).option
40
+ RspawnWorker.spawn!(option, ['restart', command])
41
+ end
42
+ end
43
+
35
44
  desc "stop", "stop daemon"
36
45
  def stop(key)
37
46
  option, command = @config.option
@@ -40,10 +49,8 @@ module Rspawn
40
49
 
41
50
  desc "status", "staus check daemon"
42
51
  def status(key = nil)
43
- keys = key.nil? ? Dir.glob(@class_options['root'] + "/*") : [key]
44
- keys = keys.map { |file| File.basename(file) }
45
52
  result = {}
46
- keys.each do |proc_name|
53
+ get_keys(key).each do |proc_name|
47
54
  option, command = get_config(proc_name).option
48
55
  option[:status] = capture_stdout do
49
56
  RspawnWorker.spawn!(option, ["status"])
@@ -78,6 +85,11 @@ module Rspawn
78
85
  tail_log(option[:log_file]) if @class_options['tail']
79
86
  end
80
87
 
88
+ def get_keys(key = nil)
89
+ keys = key.nil? ? Dir.glob(@class_options['root'] + "/*") : [key]
90
+ keys = keys.map { |file| File.basename(file) }
91
+ end
92
+
81
93
  def tail_log(log_file)
82
94
  sleep 1
83
95
  system("tail -F #{log_file}*")
@@ -1,4 +1,4 @@
1
1
  module Rspawn
2
2
  # rspawn version
3
- VERSION = "0.3.0"
3
+ VERSION = "0.4.0"
4
4
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rspawn
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Hiroshi Toyama
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-02-09 00:00:00.000000000 Z
11
+ date: 2015-03-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor
@@ -185,7 +185,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
185
185
  version: '0'
186
186
  requirements: []
187
187
  rubyforge_project:
188
- rubygems_version: 2.4.5
188
+ rubygems_version: 2.4.2
189
189
  signing_key:
190
190
  specification_version: 4
191
191
  summary: very simple daemon.