foreman-tasks 0.5.6 → 0.5.7
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.
data/app/lib/actions/base.rb
CHANGED
@@ -22,14 +22,22 @@ module Actions
|
|
22
22
|
|
23
23
|
# This method should return String of Array<String> describing input for the task
|
24
24
|
def humanized_input
|
25
|
-
task_input.
|
25
|
+
if task_input.blank?
|
26
|
+
""
|
27
|
+
else
|
28
|
+
task_input.pretty_inspect
|
29
|
+
end
|
26
30
|
end
|
27
31
|
|
28
32
|
# This method should return String describing output for the task.
|
29
33
|
# It should aggregate the data from subactions as well and it's used for humanized
|
30
34
|
# description of restuls of the action
|
31
35
|
def humanized_output
|
32
|
-
task_output.
|
36
|
+
if task_output.blank?
|
37
|
+
""
|
38
|
+
else
|
39
|
+
task_output.pretty_inspect
|
40
|
+
end
|
33
41
|
end
|
34
42
|
|
35
43
|
end
|
@@ -40,10 +40,18 @@ module ForemanTasks
|
|
40
40
|
self.eager_load_paths = []
|
41
41
|
self.lazy_initialization = !Rails.env.production?
|
42
42
|
self.rake_tasks_with_executor = %w[db:migrate db:seed]
|
43
|
+
|
44
|
+
@on_init = []
|
45
|
+
end
|
46
|
+
|
47
|
+
def on_init(&block)
|
48
|
+
@on_init << block
|
43
49
|
end
|
44
50
|
|
45
51
|
def initialize_world(world_class = ::Dynflow::World)
|
46
|
-
world_class.new(world_options)
|
52
|
+
world_class.new(world_options).tap do |world|
|
53
|
+
@on_init.each { |init| init.call(world) }
|
54
|
+
end
|
47
55
|
end
|
48
56
|
|
49
57
|
# No matter what config.remote says, when the process is marked as executor,
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: foreman-tasks
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.7
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2014-05-
|
12
|
+
date: 2014-05-28 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rails
|