matilda-function 0.2.0 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/matilda-function.rb +7 -0
- data/matilda-function.gemspec +1 -1
- data/spec/function_spec.rb +14 -0
- 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: 5bbd1d60599a3625f7d2610943f649a46523d771
|
4
|
+
data.tar.gz: 4e4db5f97a446594fa0eb5a6e86d71bf38c56d3d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 27c2ba586324801cc13a0d086a86652ca57a60430d841b65c964e624d8ef84e64581cf558308067d80bf7261a79147cd52a888e321c2b604fd38dc609a8aab27
|
7
|
+
data.tar.gz: 7d9618bd7d94a706b9301b85e565b87545d98c13b6b1e2333b061ee10c5896e18c030ef293da040b80128444e198a063c22de956eb9f0430d32acc61c4033f13
|
data/lib/matilda-function.rb
CHANGED
data/matilda-function.gemspec
CHANGED
data/spec/function_spec.rb
CHANGED
@@ -34,4 +34,18 @@ describe "Proc" do
|
|
34
34
|
(sort << reverse).call([1,4,2,3]).must_equal [4,3,2,1]
|
35
35
|
end
|
36
36
|
end
|
37
|
+
|
38
|
+
describe "#+" do
|
39
|
+
it "returns a Proc" do
|
40
|
+
func = Proc.new {} + Proc.new {}
|
41
|
+
func.kind_of?(Proc).must_equal true
|
42
|
+
end
|
43
|
+
|
44
|
+
it "returns a Proc that executes the callee and arg in order" do
|
45
|
+
sort = Proc.new { |array| array.sort! }
|
46
|
+
reverse = Proc.new { |array| array.reverse! }
|
47
|
+
|
48
|
+
(sort + reverse).call([1,4,2,3]).must_equal [4,3,2,1]
|
49
|
+
end
|
50
|
+
end
|
37
51
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: matilda-function
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Callum Stott
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-08-
|
11
|
+
date: 2013-08-10 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description:
|
14
14
|
email:
|