reduxco 1.0.1 → 1.0.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 66dee8a1deb9af6c20d475fb99e8e7548c5d2188
4
- data.tar.gz: c0ddc9771da228833b264c798a3d532491e306fa
3
+ metadata.gz: b71312c6e043cc9a0700d4162a7e6401ac882ef9
4
+ data.tar.gz: 44b8e3f4e9172c483b0b85434742dc5ac86b09e0
5
5
  SHA512:
6
- metadata.gz: 6804b82d9cefbe4d5a6439e1dbaf225230a89732544dbfc68ffcb45501f616c13ad2195fd66d57fd6e23ab2e76f3db08670b13624ef835120bea781578a2875e
7
- data.tar.gz: 4298d0af571f7c98ab7018664791792b8da6f778b82169759d1d423361a35f683d71b7a25cd9d5561a1f0897a1bc44e9154aaea7d69b93f82c1f3f7cceb2e9e2
6
+ metadata.gz: 41a8159350ecc82e2b33c6780d88a99e4da747836b4f85d204ac17e9e0c09909c3d795dcddff1af1d37ba7986a5dad4f3555c363d8f43f9683decc772ee89ded
7
+ data.tar.gz: e2f2c9ece66abdc6e1a458657ac773537e1c27653ea5d962efc086cd6357b709330049e7f5bd745b17d2976f53368ef1d85b3b3d2bfa0607f469331be57190b0
@@ -396,8 +396,10 @@ Jeff Reinecke <jreinecke@whitepages.com>
396
396
  = History
397
397
 
398
398
  [1.0.0 - 2013-Apr-18] Initial Release.
399
- [1.0.1 - 2013-Apr-18] Fixed a bug where calling c.yield in a block given to a
399
+ [1.0.1 - 2013-Dec-03] Fixed a bug where calling c.yield in a block given to a
400
400
  call would give a stack overflow.
401
+ [1.0.2 - 2014-Jan-07] Fixed a bug where calls to Reduxer#reduce would not pass
402
+ through its block to the underlying Context#call invocation.
401
403
 
402
404
  = License
403
405
 
@@ -25,8 +25,8 @@ module Reduxco
25
25
 
26
26
  # Retrieves the value of the given refname. Both final and intermediate
27
27
  # values are cached, so multiple calls have low overhead.
28
- def call(refname=:app)
29
- @context.call(refname)
28
+ def call(refname=:app, &block)
29
+ @context.call(refname, &block)
30
30
  end
31
31
  alias_method :[], :call
32
32
  alias_method :reduce, :call
@@ -1,4 +1,4 @@
1
1
  module Reduxco
2
2
  # The current version of the Reduxco gem.
3
- VERSION = '1.0.1'
3
+ VERSION = '1.0.2'
4
4
  end
@@ -18,9 +18,24 @@ describe Reduxco::Reduxer do
18
18
  reduxer = Reduxco::Reduxer.new
19
19
 
20
20
  refname = double('refname')
21
- reduxer.context.should_receive(:call).with(refname)
21
+ return_value = double('return_value')
22
+ reduxer.context.should_receive(:call).with(refname) { return_value }
22
23
 
23
- reduxer.reduce(refname)
24
+ expect( reduxer.reduce(refname) ).to eq(return_value)
25
+ end
26
+
27
+ it 'should pass through the block to the context call method' do
28
+ reduxer = Reduxco::Reduxer.new
29
+
30
+ refname = double('refname')
31
+ block_value = double('block_value')
32
+
33
+ reduxer.context.should_receive(:call) do |*args, &block|
34
+ expect(args).to eq [refname]
35
+ expect(block.call).to eq(block_value)
36
+ end
37
+
38
+ reduxer.reduce(refname){block_value}
24
39
  end
25
40
 
26
41
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: reduxco
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jeff Reinecke
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-12-04 00:00:00.000000000 Z
11
+ date: 2014-01-08 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: |-
14
14
  Reduxco is a general purpose graph reduction calculation engine for those