capistrano_multiconfig_parallel 1.0.4 → 1.0.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/capistrano_multiconfig_parallel/celluloid/rake_worker.rb +2 -1
- data/lib/capistrano_multiconfig_parallel/classes/job.rb +2 -1
- data/lib/capistrano_multiconfig_parallel/classes/rake_task_hooks.rb +7 -6
- data/lib/capistrano_multiconfig_parallel/helpers/application_helper.rb +2 -2
- data/lib/capistrano_multiconfig_parallel/initializers/capistrano2.rb +11 -0
- data/lib/capistrano_multiconfig_parallel/version.rb +1 -1
- 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: 5d2597af7ef8c177ea61d7e535b7ac546d3cdc70
|
4
|
+
data.tar.gz: cfd8fc986a102d2fb9fe9a18975cbdadb3eb9f05
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d8c821103168c6b92df533a2eb30205125d8a86b11d220fd4f5b0770ad5a12d9255dec7fa41bf9d5d83ada1f678951cfa8342d2a85a915c96e25153e1ca50ee8
|
7
|
+
data.tar.gz: 5b9a84cc4facd9ac2226ef343b4f46fdf8db19492f14fa178cacb5dc53401ca2be552fee76d23948671e6cf27425df8501f2b476e652dd21519760f643d89a7b
|
@@ -123,10 +123,11 @@ module CapistranoMulticonfigParallel
|
|
123
123
|
|
124
124
|
def user_prompt_needed?(data)
|
125
125
|
question, default = get_question_details(data)
|
126
|
+
log_to_file("Rake worker #{@job_id} tries to determine question #{data.inspect} #{question.inspect} #{default.inspect}")
|
126
127
|
return if question.blank? || @action != 'invoke'
|
127
128
|
publish_to_worker(action: 'stdout',
|
128
129
|
question: question,
|
129
|
-
default: default.delete('()'),
|
130
|
+
default: default.present? ? default.delete('()') : '',
|
130
131
|
job_id: @job_id)
|
131
132
|
wait_for_stdin_input
|
132
133
|
end
|
@@ -56,8 +56,9 @@ module CapistranoMulticonfigParallel
|
|
56
56
|
end
|
57
57
|
|
58
58
|
def worker_state
|
59
|
+
worker_obj = worker
|
59
60
|
default = status.to_s.upcase.red
|
60
|
-
|
61
|
+
worker_obj.present? && worker_obj.alive? ? worker_obj.worker_state : default
|
61
62
|
end
|
62
63
|
|
63
64
|
def id
|
@@ -23,6 +23,10 @@ module CapistranoMulticonfigParallel
|
|
23
23
|
end
|
24
24
|
end
|
25
25
|
|
26
|
+
def actor
|
27
|
+
Celluloid::Actor[rake_actor_id]
|
28
|
+
end
|
29
|
+
|
26
30
|
private
|
27
31
|
|
28
32
|
def output_stream
|
@@ -35,8 +39,9 @@ module CapistranoMulticonfigParallel
|
|
35
39
|
|
36
40
|
def before_hooks
|
37
41
|
stringio = StringIO.new
|
38
|
-
output_stream.hook(stringio)
|
39
|
-
input_stream.hook(actor, stringio)
|
42
|
+
output = output_stream.hook(stringio)
|
43
|
+
input = input_stream.hook(actor, stringio)
|
44
|
+
[input, output]
|
40
45
|
end
|
41
46
|
|
42
47
|
def after_hooks
|
@@ -64,10 +69,6 @@ module CapistranoMulticonfigParallel
|
|
64
69
|
CapistranoMulticonfigParallel::RakeWorker.supervise_as(rake_actor_id)
|
65
70
|
end
|
66
71
|
|
67
|
-
def actor
|
68
|
-
Celluloid::Actor[rake_actor_id]
|
69
|
-
end
|
70
|
-
|
71
72
|
def job_id
|
72
73
|
capistrano_version_2? ? @config.fetch(CapistranoMulticonfigParallel::ENV_KEY_JOB_ID, nil) : @env[CapistranoMulticonfigParallel::ENV_KEY_JOB_ID]
|
73
74
|
end
|
@@ -33,8 +33,8 @@ module CapistranoMulticonfigParallel
|
|
33
33
|
end
|
34
34
|
|
35
35
|
def get_question_details(data)
|
36
|
-
/(.*)\?*\s*\:*\s*(\([^)]*\))*/m
|
37
|
-
[
|
36
|
+
matches = /(.*)\?*\s*\:*\s*(\([^)]*\))*/m.match(data).captures
|
37
|
+
[matches[0], matches[1]]
|
38
38
|
end
|
39
39
|
|
40
40
|
def setup_command_line_standard(*args)
|
@@ -1,5 +1,15 @@
|
|
1
1
|
if CapistranoMulticonfigParallel.capistrano_version_2?
|
2
2
|
require 'capistrano/cli'
|
3
|
+
|
4
|
+
HighLine.class_eval do
|
5
|
+
alias_method :original_ask, :ask
|
6
|
+
|
7
|
+
def ask(question, _answer_type = String, &_details)
|
8
|
+
rake = CapistranoMulticonfigParallel::RakeTaskHooks.new(ENV, nil, CapistranoMulticonfigParallel.original_args_hash)
|
9
|
+
rake.actor.user_prompt_needed?(question)
|
10
|
+
end
|
11
|
+
end
|
12
|
+
|
3
13
|
Capistrano::Configuration::Execution.class_eval do
|
4
14
|
alias_method :original_execute_task, :execute_task
|
5
15
|
|
@@ -21,4 +31,5 @@ if CapistranoMulticonfigParallel.capistrano_version_2?
|
|
21
31
|
end
|
22
32
|
end
|
23
33
|
end
|
34
|
+
|
24
35
|
end
|