runnerbean 0.0.1 → 0.0.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.
- checksums.yaml +4 -4
- data/examples/front_and_back +2 -2
- data/examples/process_groups +2 -2
- data/examples/simple +3 -3
- data/lib/runnerbean/process_group.rb +3 -3
- data/lib/runnerbean/version.rb +1 -1
- data/spec/runnerbean/process_group_spec.rb +3 -3
- data/spec/runnerbean/runner_integration_spec.rb +2 -2
- 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: c92db16e711b588ad071465aa3a1706702b707a9
|
4
|
+
data.tar.gz: 0c14b41d5d111e32674b6fd15b5e84eb0215840d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8210b2dd8f3c46f8e9c391b250a6c2842f5b5363a61ec9f7168461e00afad68bf1c23ca62565dcae52fcbc6b408bbdebcd32badb0d3f18108120f0fb832713f1
|
7
|
+
data.tar.gz: 846841cd685bc9c3ecd02dd3f9328f8efdf590d115db00cc20374b7cdbf5ad60d0860ab14d39fa88cb433883abfd2dc4d63966414e233775cadfdfa31ff0e363
|
data/examples/front_and_back
CHANGED
@@ -6,7 +6,7 @@ $LOAD_PATH.unshift(File.join(APP_ROOT, 'lib'))
|
|
6
6
|
require 'runnerbean'
|
7
7
|
|
8
8
|
class Frontend
|
9
|
-
attr_accessor :
|
9
|
+
attr_accessor :group_name
|
10
10
|
|
11
11
|
def start_command
|
12
12
|
"echo 'This would be the Frontend start command'"
|
@@ -26,7 +26,7 @@ class Frontend
|
|
26
26
|
end
|
27
27
|
|
28
28
|
class Backend
|
29
|
-
attr_accessor :
|
29
|
+
attr_accessor :group_name
|
30
30
|
|
31
31
|
def start_command
|
32
32
|
"echo 'This would be the Backend start command'"
|
data/examples/process_groups
CHANGED
@@ -6,7 +6,7 @@ $LOAD_PATH.unshift(File.join(APP_ROOT, 'lib'))
|
|
6
6
|
require 'runnerbean'
|
7
7
|
|
8
8
|
class Frontend
|
9
|
-
attr_accessor :
|
9
|
+
attr_accessor :group_name
|
10
10
|
|
11
11
|
def start_command
|
12
12
|
"echo 'This would be the Frontend start command'"
|
@@ -26,7 +26,7 @@ class Frontend
|
|
26
26
|
end
|
27
27
|
|
28
28
|
class Backend
|
29
|
-
attr_accessor :
|
29
|
+
attr_accessor :group_name
|
30
30
|
|
31
31
|
def start_command
|
32
32
|
"echo 'This would be the Backend start command'"
|
data/examples/simple
CHANGED
@@ -6,10 +6,10 @@ $LOAD_PATH.unshift(File.join(APP_ROOT, 'lib'))
|
|
6
6
|
require 'runnerbean'
|
7
7
|
|
8
8
|
class MyTestProcess
|
9
|
-
attr_accessor :
|
9
|
+
attr_accessor :group_name
|
10
10
|
|
11
11
|
def start_command
|
12
|
-
"echo 'This would be the start command, logging to prefix of #{
|
12
|
+
"echo 'This would be the start command, logging to prefix of #{group_name}' &&" \
|
13
13
|
"echo '... with a following delay of #{sleep_after_start}'"
|
14
14
|
end
|
15
15
|
|
@@ -18,7 +18,7 @@ class MyTestProcess
|
|
18
18
|
end
|
19
19
|
|
20
20
|
def kill_command
|
21
|
-
"echo 'This would be the kill command, logging to prefix of #{
|
21
|
+
"echo 'This would be the kill command, logging to prefix of #{group_name}' &&" \
|
22
22
|
"echo '... with a following delay of #{sleep_after_kill}'"
|
23
23
|
end
|
24
24
|
|
@@ -28,7 +28,7 @@ module Runnerbean
|
|
28
28
|
end
|
29
29
|
|
30
30
|
def generic_command(command)
|
31
|
-
|
31
|
+
set_group_name_on_processes
|
32
32
|
|
33
33
|
commands = find_commands(command)
|
34
34
|
execute(*commands)
|
@@ -37,8 +37,8 @@ module Runnerbean
|
|
37
37
|
sleep_for(*sleep_times)
|
38
38
|
end
|
39
39
|
|
40
|
-
def
|
41
|
-
processes.each { |p| p.
|
40
|
+
def set_group_name_on_processes
|
41
|
+
processes.each { |p| p.group_name = name }
|
42
42
|
end
|
43
43
|
|
44
44
|
def find_commands(command)
|
data/lib/runnerbean/version.rb
CHANGED
@@ -14,7 +14,7 @@ module Runnerbean
|
|
14
14
|
start_command: the_frontend_start,
|
15
15
|
sleep_after_start: 7,
|
16
16
|
sleep_after_kill: 2,
|
17
|
-
:'
|
17
|
+
:'group_name=' => nil
|
18
18
|
)
|
19
19
|
end
|
20
20
|
let(:the_worker_kill) { 'kill_that_worker' }
|
@@ -23,7 +23,7 @@ module Runnerbean
|
|
23
23
|
name: 'name_of_the_worker',
|
24
24
|
kill_command: the_worker_kill,
|
25
25
|
sleep_after_kill: 4,
|
26
|
-
:'
|
26
|
+
:'group_name=' => nil
|
27
27
|
)
|
28
28
|
end
|
29
29
|
before { allow(Kernel).to receive(:system).with(anything) }
|
@@ -75,7 +75,7 @@ module Runnerbean
|
|
75
75
|
end
|
76
76
|
|
77
77
|
it 'instructs process to log to logfile, prefixed with group name' do
|
78
|
-
expect(the_frontend).to receive(:
|
78
|
+
expect(the_frontend).to receive(:group_name=).with(group.name)
|
79
79
|
subject
|
80
80
|
end
|
81
81
|
|
@@ -14,7 +14,7 @@ module Runnerbean
|
|
14
14
|
start_command: the_frontend_start,
|
15
15
|
sleep_after_start: 7,
|
16
16
|
sleep_after_kill: 2,
|
17
|
-
:'
|
17
|
+
:'group_name=' => nil
|
18
18
|
)
|
19
19
|
end
|
20
20
|
let(:the_worker_kill) { 'kill_that_worker' }
|
@@ -22,7 +22,7 @@ module Runnerbean
|
|
22
22
|
double('the worker',
|
23
23
|
kill_command: the_worker_kill,
|
24
24
|
sleep_after_kill: 4,
|
25
|
-
:'
|
25
|
+
:'group_name=' => nil
|
26
26
|
)
|
27
27
|
end
|
28
28
|
before { allow(Kernel).to receive(:system).with(anything) }
|