carry_out 0.2.3 → 0.2.4
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/README.md +1 -1
- data/lib/carry_out/plan.rb +16 -16
- data/lib/carry_out/unit.rb +7 -7
- data/lib/carry_out/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: 37f185a89840317b952f45a80fed41a091ea4063
|
4
|
+
data.tar.gz: 25a7ef8c44078d0822028a6decc562bbd11a94c6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 51942176cc851aada3b50328385b86317191348e9f7f4ed7f20754693d1ca33821db2f78843adefc8e4956b6dbd9457ffd27fed8f637a15fe04564d4f1c79057
|
7
|
+
data.tar.gz: 19d55da8752bce5dbea60759b0a80df45d58469515b9f1f642a38bd00fb078b125e615b93a9adb2e8be309373ab5eafbc825e0e9bef8ed4c8ebd012da38ed812
|
data/README.md
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
CarryOut connects units of logic into workflows. Each unit can extend the DSL with parameter methods. Artifacts and errors are collected as the workflow executes and are returned in a result bundle upon completion.
|
4
4
|
|
5
|
-
[](https://badge.fury.io/rb/carry_out) [](https://travis-ci.org/ryanfields/carry_out) [](https://coveralls.io/github/ryanfields/carry_out?branch=master)
|
5
|
+
[](https://badge.fury.io/rb/carry_out) [](https://travis-ci.org/ryanfields/carry_out) [](https://coveralls.io/github/ryanfields/carry_out?branch=master) [](https://codeclimate.com/github/ryanfields/carry_out)
|
6
6
|
|
7
7
|
## Installation
|
8
8
|
|
data/lib/carry_out/plan.rb
CHANGED
@@ -67,28 +67,28 @@ module CarryOut
|
|
67
67
|
id
|
68
68
|
end
|
69
69
|
|
70
|
-
def execute_internal(result =
|
70
|
+
def execute_internal(result = Result.new, &block)
|
71
71
|
id = @initial_node_key
|
72
72
|
|
73
|
-
(
|
74
|
-
|
75
|
-
publish_to = @node_meta[id][:as]
|
73
|
+
until (node = @nodes[id]).nil? do
|
74
|
+
publish_to = @node_meta[id][:as]
|
76
75
|
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
end
|
84
|
-
|
85
|
-
id = node.next
|
76
|
+
begin
|
77
|
+
node_result = node.execute(result.artifacts)
|
78
|
+
result.add(publish_to, node_result) unless publish_to.nil?
|
79
|
+
rescue UnitError => error
|
80
|
+
result.add(publish_to || id, CarryOut::Error.new(error.error.message, error.error))
|
81
|
+
break
|
86
82
|
end
|
87
83
|
|
88
|
-
|
89
|
-
block.call(result)
|
90
|
-
end
|
84
|
+
id = node.next
|
91
85
|
end
|
86
|
+
|
87
|
+
unless block.nil?
|
88
|
+
block.call(result)
|
89
|
+
end
|
90
|
+
|
91
|
+
result
|
92
92
|
end
|
93
93
|
|
94
94
|
def generate_node_name
|
data/lib/carry_out/unit.rb
CHANGED
@@ -5,15 +5,15 @@ module CarryOut
|
|
5
5
|
end
|
6
6
|
|
7
7
|
def self.appending_parameter(method_name, var)
|
8
|
-
var = var.to_s
|
9
8
|
instance_var = "@#{var}"
|
10
9
|
|
11
10
|
define_method(method_name.to_sym) do |value|
|
12
|
-
existing =
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
11
|
+
existing =
|
12
|
+
if instance_variable_defined?(instance_var)
|
13
|
+
[ instance_variable_get("@#{var}") ].flatten(1)
|
14
|
+
else
|
15
|
+
[]
|
16
|
+
end
|
17
17
|
|
18
18
|
instance_variable_set(instance_var, (existing || []) << value)
|
19
19
|
self
|
@@ -23,7 +23,7 @@ module CarryOut
|
|
23
23
|
def self.parameter(method_name, var = nil)
|
24
24
|
unless var.nil?
|
25
25
|
define_method(method_name.to_sym) do |value|
|
26
|
-
instance_variable_set("@#{var
|
26
|
+
instance_variable_set("@#{var}", value)
|
27
27
|
self
|
28
28
|
end
|
29
29
|
end
|
data/lib/carry_out/version.rb
CHANGED