stages 0.3.0 → 0.3.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.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.3.0
1
+ 0.3.1
data/lib/stages/count.rb CHANGED
@@ -4,7 +4,7 @@ module Stages
4
4
  result = Hash.new{ |h, k| h[k] = 0 }
5
5
  while v = source.run
6
6
  if v.is_a? Hash
7
- v.each_pair{ |key, value| result[key] += value }
7
+ v.each_pair{ |key, value| result[key] += (value || 0) }
8
8
  else
9
9
  result[v] += 1
10
10
  end
data/stages.gemspec CHANGED
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = "stages"
8
- s.version = "0.3.0"
8
+ s.version = "0.3.1"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["The Justice Eight"]
12
- s.date = "2012-01-23"
12
+ s.date = "2012-01-29"
13
13
  s.description = "pipeline builder"
14
14
  s.email = "support@igodigital.com"
15
15
  s.extra_rdoc_files = [
data/test/test_stages.rb CHANGED
@@ -119,6 +119,11 @@ class TestStages < MiniTest::Unit::TestCase
119
119
  assert_equal({ a: 5}, pipeline.run)
120
120
  end
121
121
 
122
+ test 'count-recount doesnt choke on nils' do
123
+ pipeline = Each.new([{ a: 2}, { a: nil}]) | Count.new
124
+ assert_equal({ a: 2}, pipeline.run)
125
+ end
126
+
122
127
  test 'trying to pull from nil returns nil, not an excemption' do
123
128
  pipeline = Unique.new
124
129
  assert_equal(nil, pipeline.run)
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: stages
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.3.0
5
+ version: 0.3.1
6
6
  platform: ruby
7
7
  authors:
8
8
  - The Justice Eight
@@ -10,7 +10,7 @@ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
12
 
13
- date: 2012-01-23 00:00:00 Z
13
+ date: 2012-01-29 00:00:00 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: rake
@@ -74,7 +74,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
74
74
  requirements:
75
75
  - - ">="
76
76
  - !ruby/object:Gem::Version
77
- hash: -3050689494935064105
77
+ hash: 233601987303344530
78
78
  segments:
79
79
  - 0
80
80
  version: "0"