child-process-manager 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/child-process-manager.rb +12 -7
- metadata +6 -7
@@ -1,4 +1,4 @@
|
|
1
|
-
|
1
|
+
require 'socket'
|
2
2
|
|
3
3
|
class ChildProcess
|
4
4
|
|
@@ -70,12 +70,16 @@ class ChildProcessManager
|
|
70
70
|
def self.reap_all
|
71
71
|
self.init
|
72
72
|
|
73
|
-
@@managed_processes.
|
74
|
-
child_process.stop
|
75
|
-
|
73
|
+
@@managed_processes.each do |address,child_process|
|
74
|
+
child_process.stop if child_process
|
75
|
+
@@managed_processes.delete(address)
|
76
76
|
end
|
77
77
|
end
|
78
78
|
|
79
|
+
def self.managed_processes
|
80
|
+
@@managed_processes
|
81
|
+
end
|
82
|
+
|
79
83
|
def self.reap_one(*args)
|
80
84
|
self.init
|
81
85
|
port = 0; ip = '127.0.0.1'
|
@@ -86,9 +90,10 @@ class ChildProcessManager
|
|
86
90
|
ip = args[0]
|
87
91
|
port = args[1]
|
88
92
|
end
|
89
|
-
|
90
|
-
|
91
|
-
@@managed_processes[
|
93
|
+
address = "#{ip}:#{port}"
|
94
|
+
if @@managed_processes[address]
|
95
|
+
@@managed_processes[address].stop
|
96
|
+
@@managed_processes.delete(address)
|
92
97
|
end
|
93
98
|
end
|
94
99
|
end
|
metadata
CHANGED
@@ -1,7 +1,8 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: child-process-manager
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
|
4
|
+
prerelease:
|
5
|
+
version: 0.0.3
|
5
6
|
platform: ruby
|
6
7
|
authors:
|
7
8
|
- bcg
|
@@ -9,8 +10,7 @@ autorequire:
|
|
9
10
|
bindir: bin
|
10
11
|
cert_chain: []
|
11
12
|
|
12
|
-
date: 2011-03-29 00:00:00
|
13
|
-
default_executable:
|
13
|
+
date: 2011-03-29 00:00:00 Z
|
14
14
|
dependencies: []
|
15
15
|
|
16
16
|
description: child-process-manager
|
@@ -23,7 +23,6 @@ extra_rdoc_files: []
|
|
23
23
|
|
24
24
|
files:
|
25
25
|
- lib/child-process-manager.rb
|
26
|
-
has_rdoc: true
|
27
26
|
homepage: ""
|
28
27
|
licenses: []
|
29
28
|
|
@@ -33,21 +32,21 @@ rdoc_options:
|
|
33
32
|
require_paths:
|
34
33
|
- lib
|
35
34
|
required_ruby_version: !ruby/object:Gem::Requirement
|
35
|
+
none: false
|
36
36
|
requirements:
|
37
37
|
- - ">="
|
38
38
|
- !ruby/object:Gem::Version
|
39
39
|
version: "0"
|
40
|
-
version:
|
41
40
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
41
|
+
none: false
|
42
42
|
requirements:
|
43
43
|
- - ">="
|
44
44
|
- !ruby/object:Gem::Version
|
45
45
|
version: "0"
|
46
|
-
version:
|
47
46
|
requirements: []
|
48
47
|
|
49
48
|
rubyforge_project: child-process-manager
|
50
|
-
rubygems_version: 1.
|
49
|
+
rubygems_version: 1.8.0
|
51
50
|
signing_key:
|
52
51
|
specification_version: 3
|
53
52
|
summary: child-process-manager
|