stages 1.1.2 → 1.1.5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: a2681dead96d1b78d4f1aee16f918316b824693a
4
+ data.tar.gz: faf2b44e97a5f5dccc93f8275f51c95a1886b2bf
5
+ SHA512:
6
+ metadata.gz: 6c9f75f9c2aba60af3003222143c6378e93dc260e5bac9391c2161461c8f50045e734a25e6af8826f75b1947e399295f07e1702d21dfb2dacbac66aec5ebb5e5
7
+ data.tar.gz: 3f6f6045ace7febe39688ed75b2efd9e9628b7e3025c8e568f47ddd2483a6281ea04b7ef3f5e20e26a7da658dc3f5e162e0b67b7a00822be114b560354f4ed6c
data/Gemfile.lock CHANGED
@@ -2,14 +2,50 @@ GEM
2
2
  remote: http://gemcutter.org/
3
3
  specs:
4
4
  ZenTest (4.6.2)
5
+ addressable (2.3.5)
5
6
  ansi (1.4.1)
6
- git (1.2.5)
7
- jeweler (1.6.4)
7
+ builder (3.2.2)
8
+ faraday (0.8.8)
9
+ multipart-post (~> 1.2.0)
10
+ git (1.2.6)
11
+ github_api (0.10.1)
12
+ addressable
13
+ faraday (~> 0.8.1)
14
+ hashie (>= 1.2)
15
+ multi_json (~> 1.4)
16
+ nokogiri (~> 1.5.2)
17
+ oauth2
18
+ hashie (2.0.5)
19
+ highline (1.6.19)
20
+ httpauth (0.2.0)
21
+ jeweler (1.8.7)
22
+ builder
8
23
  bundler (~> 1.0)
9
24
  git (>= 1.2.5)
25
+ github_api (= 0.10.1)
26
+ highline (>= 1.6.15)
27
+ nokogiri (= 1.5.10)
10
28
  rake
29
+ rdoc
30
+ json (1.8.0)
31
+ jwt (0.1.8)
32
+ multi_json (>= 1.5)
11
33
  minitest (2.10.0)
12
- rake (10.0.3)
34
+ multi_json (1.7.9)
35
+ multi_xml (0.5.5)
36
+ multipart-post (1.2.0)
37
+ nokogiri (1.5.10)
38
+ oauth2 (0.9.2)
39
+ faraday (~> 0.8)
40
+ httpauth (~> 0.2)
41
+ jwt (~> 0.1.4)
42
+ multi_json (~> 1.0)
43
+ multi_xml (~> 0.5)
44
+ rack (~> 1.2)
45
+ rack (1.5.2)
46
+ rake (10.1.0)
47
+ rdoc (4.0.1)
48
+ json (~> 1.4)
13
49
  turn (0.8.2)
14
50
  ansi (>= 1.2.2)
15
51
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.1.2
1
+ 1.1.5
@@ -0,0 +1,22 @@
1
+ module Stages
2
+ class Splice < Stage
3
+ def initialize(*args, &block)
4
+ @pipelines = args
5
+ super()
6
+ end
7
+
8
+ def process
9
+ @pipelines.each do |pipeline|
10
+ pipeline.each do |item|
11
+ handle_value item
12
+ end
13
+ end
14
+ super()
15
+ end
16
+
17
+ def reset
18
+ @pipelines.each{ |pipeline| pipeline.reset }
19
+ super()
20
+ end
21
+ end
22
+ end
data/lib/sugar.rb CHANGED
@@ -47,5 +47,9 @@ module Stages
47
47
  def limit(*args, &block)
48
48
  Limit.new(*args, &block)
49
49
  end
50
+
51
+ def splice(*args, &block)
52
+ Splice.new(*args, &block)
53
+ end
50
54
  end
51
55
  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 = "1.1.2"
8
+ s.version = "1.1.5"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Nathan D Acuff"]
12
- s.date = "2013-08-22"
12
+ s.date = "2013-08-30"
13
13
  s.description = "pipeline builder"
14
14
  s.email = "support@igodigital.com"
15
15
  s.extra_rdoc_files = [
@@ -37,6 +37,7 @@ Gem::Specification.new do |s|
37
37
  "lib/stages/limit.rb",
38
38
  "lib/stages/map.rb",
39
39
  "lib/stages/select.rb",
40
+ "lib/stages/splice.rb",
40
41
  "lib/stages/unique.rb",
41
42
  "lib/stages/wrap.rb",
42
43
  "lib/sugar.rb",
@@ -48,11 +49,11 @@ Gem::Specification.new do |s|
48
49
  ]
49
50
  s.homepage = "https://github.com/iGoDigital-LLC/stages"
50
51
  s.require_paths = ["lib"]
51
- s.rubygems_version = "1.8.17"
52
+ s.rubygems_version = "2.0.7"
52
53
  s.summary = "pipeline builder"
53
54
 
54
55
  if s.respond_to? :specification_version then
55
- s.specification_version = 3
56
+ s.specification_version = 4
56
57
 
57
58
  if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
58
59
  s.add_runtime_dependency(%q<rake>, [">= 0.9.2"])
data/test/test_stages.rb CHANGED
@@ -185,6 +185,23 @@ class TestStages < MiniTest::Unit::TestCase
185
185
  assert_equal([[1,2],[3,4],[5]], output)
186
186
  end
187
187
 
188
+ test "splice merges some number of stages" do
189
+ pipeline = Splice.new(Each.new([1,2]), Each.new([3,4]), Each.new([4,5]))
190
+ assert_equal([1,2,3,4,4,5], pipeline.to_a)
191
+ end
192
+
193
+ test "splice with left hand input" do
194
+ pipeline = Each.new([4,5]) | Splice.new(Each.new([1,2]), Each.new([3,4]))
195
+ assert_equal([1,2,3,4,4,5], pipeline.to_a)
196
+ end
197
+
198
+ test "splice with left hand input resets" do
199
+ pipeline = Each.new([4,5]) | Splice.new(Each.new([1,2]), Each.new([3,4]))
200
+ assert_equal([1,2,3,4,4,5], pipeline.to_a)
201
+ pipeline.reset
202
+ assert_equal([1,2,3,4,4,5], pipeline.to_a)
203
+ end
204
+
188
205
  def sing
189
206
  { :do => 'doe a deer a female deer',
190
207
  :re => 'ray a drop of golden sun',
data/test/test_syntax.rb CHANGED
@@ -57,4 +57,9 @@ class TestSyntax < MiniTest::Unit::TestCase
57
57
  pipeline = each([1,2,3]) | limit(2) | run_until_exhausted
58
58
  assert_equal([1, 2], pipeline.run)
59
59
  end
60
+
61
+ test "splice" do
62
+ pipeline = splice(each([1,2]), each([3,4]), each([4,5]))
63
+ assert_equal([1,2,3,4,4,5], pipeline.to_a)
64
+ end
60
65
  end
metadata CHANGED
@@ -1,8 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: stages
3
3
  version: !ruby/object:Gem::Version
4
- prerelease:
5
- version: 1.1.2
4
+ version: 1.1.5
6
5
  platform: ruby
7
6
  authors:
8
7
  - Nathan D Acuff
@@ -10,12 +9,11 @@ autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
11
 
13
- date: 2013-08-22 00:00:00 Z
12
+ date: 2013-08-30 00:00:00 Z
14
13
  dependencies:
15
14
  - !ruby/object:Gem::Dependency
16
15
  name: rake
17
16
  requirement: &id001 !ruby/object:Gem::Requirement
18
- none: false
19
17
  requirements:
20
18
  - - ">="
21
19
  - !ruby/object:Gem::Version
@@ -53,6 +51,7 @@ files:
53
51
  - lib/stages/limit.rb
54
52
  - lib/stages/map.rb
55
53
  - lib/stages/select.rb
54
+ - lib/stages/splice.rb
56
55
  - lib/stages/unique.rb
57
56
  - lib/stages/wrap.rb
58
57
  - lib/sugar.rb
@@ -64,32 +63,28 @@ files:
64
63
  homepage: https://github.com/iGoDigital-LLC/stages
65
64
  licenses: []
66
65
 
66
+ metadata: {}
67
+
67
68
  post_install_message:
68
69
  rdoc_options: []
69
70
 
70
71
  require_paths:
71
72
  - lib
72
73
  required_ruby_version: !ruby/object:Gem::Requirement
73
- none: false
74
74
  requirements:
75
- - - ">="
75
+ - &id002
76
+ - ">="
76
77
  - !ruby/object:Gem::Version
77
- hash: -428513000374050333
78
- segments:
79
- - 0
80
78
  version: "0"
81
79
  required_rubygems_version: !ruby/object:Gem::Requirement
82
- none: false
83
80
  requirements:
84
- - - ">="
85
- - !ruby/object:Gem::Version
86
- version: "0"
81
+ - *id002
87
82
  requirements: []
88
83
 
89
84
  rubyforge_project:
90
- rubygems_version: 1.8.17
85
+ rubygems_version: 2.0.7
91
86
  signing_key:
92
- specification_version: 3
87
+ specification_version: 4
93
88
  summary: pipeline builder
94
89
  test_files: []
95
90