capistrano_multiconfig_parallel 0.9.0 → 0.9.1
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/lib/capistrano_multiconfig_parallel/all.rb +1 -0
- data/lib/capistrano_multiconfig_parallel/celluloid/rake_worker.rb +2 -2
- data/lib/capistrano_multiconfig_parallel/extensions/extension_helper.rb +17 -16
- data/lib/capistrano_multiconfig_parallel/extensions/input_stream.rb +8 -5
- data/lib/capistrano_multiconfig_parallel/extensions/output_stream.rb +6 -7
- data/lib/capistrano_multiconfig_parallel/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 808fe6e708f7467e9217be29a02d3c35655687f2
|
4
|
+
data.tar.gz: f7f2a71f361c913b7002dad9ac8565d5ddf3c124
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e8407b78757adda260e96e7bb8aaeae373a0db670e8c564d9073463f88fe07498abc57cc33d2ec31edbd69b42d35864df2e7e152922f097111fd6eab254a72b8
|
7
|
+
data.tar.gz: efe0311672c329fa5fbf0e4d7dbea08e35a199079f03a0f95e850e24fa105d298be1107e8c971d7fa6f4283b0ee039004f5cafed8d6c7e611331774b91dc605f
|
@@ -130,7 +130,7 @@ module CapistranoMulticonfigParallel
|
|
130
130
|
def get_question_details(data)
|
131
131
|
question = ''
|
132
132
|
default = nil
|
133
|
-
if data =~ /(.*)
|
133
|
+
if data =~ /(.*)\?*\s*\:*\s*(\([^)]*\))*/m
|
134
134
|
question = Regexp.last_match(1)
|
135
135
|
default = Regexp.last_match(2)
|
136
136
|
end
|
@@ -157,7 +157,7 @@ module CapistranoMulticonfigParallel
|
|
157
157
|
job_id: @job_id
|
158
158
|
})
|
159
159
|
@questions_prompted << data
|
160
|
-
|
160
|
+
wait_for_stdin_input
|
161
161
|
|
162
162
|
end
|
163
163
|
|
@@ -17,22 +17,23 @@ module CapistranoMulticonfigParallel
|
|
17
17
|
end
|
18
18
|
|
19
19
|
def actor
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
20
|
+
CapistranoMulticonfigParallel::RakeWorker.supervise_as(rake_actor_id,
|
21
|
+
actor_id: rake_actor_id,
|
22
|
+
job_id: job_id) if Celluloid::Actor[rake_actor_id].blank?
|
23
|
+
Celluloid::Actor[rake_actor_id]
|
24
|
+
end
|
25
|
+
|
26
|
+
def run_the_actor(task, &block)
|
27
|
+
actor.work(ENV, task: task)
|
28
|
+
actor.wait_execution until actor.task_approved
|
29
|
+
return unless actor.task_approved
|
30
|
+
stringio = StringIO.new
|
31
|
+
CapistranoMulticonfigParallel::OutputStream.hook(stringio)
|
32
|
+
CapistranoMulticonfigParallel::InputStream.hook(actor, stringio)
|
33
|
+
block.call
|
34
|
+
CapistranoMulticonfigParallel::InputStream.unhook
|
35
|
+
CapistranoMulticonfigParallel::OutputStream.unhook
|
36
|
+
end
|
36
37
|
|
37
38
|
|
38
39
|
|
@@ -1,7 +1,7 @@
|
|
1
1
|
module CapistranoMulticonfigParallel
|
2
2
|
class InputStream
|
3
|
-
def self.hook(actor)
|
4
|
-
$stdin = new($stdin, actor)
|
3
|
+
def self.hook(actor, stringio)
|
4
|
+
$stdin = new($stdin, actor, stringio)
|
5
5
|
end
|
6
6
|
|
7
7
|
def self.unhook
|
@@ -9,15 +9,18 @@ module CapistranoMulticonfigParallel
|
|
9
9
|
$stdin = STDIN
|
10
10
|
end
|
11
11
|
|
12
|
-
attr_accessor :real, :actor
|
12
|
+
attr_accessor :real, :actor, :stringio
|
13
13
|
|
14
|
-
def initialize(real_stdin, actor)
|
14
|
+
def initialize(real_stdin, actor, stringio)
|
15
15
|
self.real = real_stdin
|
16
16
|
self.actor = actor
|
17
|
+
self.stringio = stringio
|
17
18
|
end
|
18
19
|
|
19
20
|
def gets(*args)
|
20
|
-
@
|
21
|
+
@stringio.rewind
|
22
|
+
data = @stringio.read
|
23
|
+
@actor.user_prompt_needed?(data)
|
21
24
|
end
|
22
25
|
|
23
26
|
def finish
|
@@ -1,7 +1,7 @@
|
|
1
1
|
module CapistranoMulticonfigParallel
|
2
2
|
class OutputStream
|
3
|
-
def self.hook(
|
4
|
-
$stdout = new($stdout,
|
3
|
+
def self.hook(stringio)
|
4
|
+
$stdout = new($stdout, stringio)
|
5
5
|
end
|
6
6
|
|
7
7
|
def self.unhook
|
@@ -9,18 +9,17 @@ module CapistranoMulticonfigParallel
|
|
9
9
|
$stdout = STDOUT
|
10
10
|
end
|
11
11
|
|
12
|
-
attr_accessor :real, :
|
12
|
+
attr_accessor :real, :stringio
|
13
13
|
|
14
|
-
def initialize(real_stdout,
|
14
|
+
def initialize(real_stdout, stringio)
|
15
15
|
self.real= real_stdout
|
16
|
-
self.
|
17
|
-
self.strings = []
|
16
|
+
self.stringio = stringio
|
18
17
|
end
|
19
18
|
|
20
19
|
def write(*args)
|
20
|
+
@stringio.print(*args)
|
21
21
|
@real.write(*args)
|
22
22
|
@real.flush
|
23
|
-
@actor.user_prompt_needed?(args.join(' '))
|
24
23
|
end
|
25
24
|
|
26
25
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: capistrano_multiconfig_parallel
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.9.
|
4
|
+
version: 0.9.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- bogdanRada
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-07-
|
11
|
+
date: 2015-07-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: celluloid-pmap
|