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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 470d51ab2b48b338a7a9c74cf337e1a646d5e757
4
- data.tar.gz: be8a202ea585bfdc718185e93d7ce3f81605a11e
3
+ metadata.gz: 37f185a89840317b952f45a80fed41a091ea4063
4
+ data.tar.gz: 25a7ef8c44078d0822028a6decc562bbd11a94c6
5
5
  SHA512:
6
- metadata.gz: 57f102be31ffdc49a2b846211bc2586a588654b1a3a663b5073ed884cf3a95b81c58ad1b1e9699d0c8baee5fc8ef47f070cebbdb5393cc3f9357db4d85871f88
7
- data.tar.gz: 054240040fb465c6ea0e1b8e526c2d7e4a325ad72b373a508e199b42e1fb0035c2ffc713114eefabd2e08687827cb8324898eaeeaa8a104704c82d86171d894c
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
- [![Gem Version](https://badge.fury.io/rb/carry_out.svg)](https://badge.fury.io/rb/carry_out) [![Build Status](https://travis-ci.org/ryanfields/carry_out.svg?branch=master)](https://travis-ci.org/ryanfields/carry_out) [![Coverage Status](https://coveralls.io/repos/github/ryanfields/carry_out/badge.svg?branch=master)](https://coveralls.io/github/ryanfields/carry_out?branch=master)
5
+ [![Gem Version](https://badge.fury.io/rb/carry_out.svg)](https://badge.fury.io/rb/carry_out) [![Build Status](https://travis-ci.org/ryanfields/carry_out.svg?branch=master)](https://travis-ci.org/ryanfields/carry_out) [![Coverage Status](https://coveralls.io/repos/github/ryanfields/carry_out/badge.svg?branch=master)](https://coveralls.io/github/ryanfields/carry_out?branch=master) [![Code Climate](https://codeclimate.com/github/ryanfields/carry_out/badges/gpa.svg)](https://codeclimate.com/github/ryanfields/carry_out)
6
6
 
7
7
  ## Installation
8
8
 
@@ -67,28 +67,28 @@ module CarryOut
67
67
  id
68
68
  end
69
69
 
70
- def execute_internal(result = nil, &block)
70
+ def execute_internal(result = Result.new, &block)
71
71
  id = @initial_node_key
72
72
 
73
- (result || Result.new).tap do |result|
74
- while node = @nodes[id] do
75
- publish_to = @node_meta[id][:as]
73
+ until (node = @nodes[id]).nil? do
74
+ publish_to = @node_meta[id][:as]
76
75
 
77
- begin
78
- node_result = node.execute(result.artifacts)
79
- result.add(publish_to, node_result) unless publish_to.nil?
80
- rescue UnitError => error
81
- result.add(publish_to || id, CarryOut::Error.new(error.error.message, error.error))
82
- break
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
- unless block.nil?
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
@@ -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 = if instance_variable_defined?(instance_var)
13
- [ instance_variable_get("@#{var.to_s}") ].flatten(1)
14
- else
15
- []
16
- end
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.to_s}", value)
26
+ instance_variable_set("@#{var}", value)
27
27
  self
28
28
  end
29
29
  end
@@ -1,3 +1,3 @@
1
1
  module CarryOut
2
- VERSION = "0.2.3"
2
+ VERSION = "0.2.4"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: carry_out
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.3
4
+ version: 0.2.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ryan Fields