reduxco 1.0.1 → 1.0.2
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.rdoc +3 -1
- data/lib/reduxco/reduxer.rb +2 -2
- data/lib/reduxco/version.rb +1 -1
- data/spec/reduxer_spec.rb +17 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b71312c6e043cc9a0700d4162a7e6401ac882ef9
|
4
|
+
data.tar.gz: 44b8e3f4e9172c483b0b85434742dc5ac86b09e0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 41a8159350ecc82e2b33c6780d88a99e4da747836b4f85d204ac17e9e0c09909c3d795dcddff1af1d37ba7986a5dad4f3555c363d8f43f9683decc772ee89ded
|
7
|
+
data.tar.gz: e2f2c9ece66abdc6e1a458657ac773537e1c27653ea5d962efc086cd6357b709330049e7f5bd745b17d2976f53368ef1d85b3b3d2bfa0607f469331be57190b0
|
data/README.rdoc
CHANGED
@@ -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-
|
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
|
|
data/lib/reduxco/reduxer.rb
CHANGED
@@ -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
|
data/lib/reduxco/version.rb
CHANGED
data/spec/reduxer_spec.rb
CHANGED
@@ -18,9 +18,24 @@ describe Reduxco::Reduxer do
|
|
18
18
|
reduxer = Reduxco::Reduxer.new
|
19
19
|
|
20
20
|
refname = double('refname')
|
21
|
-
|
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.
|
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:
|
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
|