optional 0.0.5 → 0.0.6

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- optional (0.0.4)
4
+ optional (0.0.5)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -8,7 +8,7 @@ class Some
8
8
  end
9
9
 
10
10
  def each &block
11
- value.is_a?(Array) ? value.each(&block) : block.call(value)
11
+ block.call(value)
12
12
  end
13
13
 
14
14
  def none?(&block)
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'optional'
3
- s.version = '0.0.5'
3
+ s.version = '0.0.6'
4
4
  s.date = '2013-04-19'
5
5
  s.summary = "Optional values with pattern matching"
6
6
  s.description = "Make nils a thing of the past with Options!"
@@ -7,14 +7,14 @@ describe Option::Enumerable do
7
7
 
8
8
  describe "#map_through" do
9
9
  it "allows mapping through multiple methods" do
10
- Some[cat, dog].map_through(:name, :chars, :first).should eq Some["M", "D"]
10
+ Some[cat].map_through(:name, :chars, :first).should eq Some["M"]
11
11
  end
12
12
  end
13
13
 
14
14
  describe "#map" do
15
15
 
16
16
  it "maps a some to a some" do
17
- Some[cat, dog].map(&:name).should eq Some["MOGGIE!", "DOGGIE!"]
17
+ Some[cat].map(&:name).should eq Some["MOGGIE!"]
18
18
  end
19
19
 
20
20
  it "also works for collect" do
@@ -60,7 +60,7 @@ describe Option::Enumerable do
60
60
 
61
61
  Some[cat].juxt(:name, :class).should eq Some["MOGGIE!", Cat]
62
62
 
63
- Some[1,2,3].juxt(:pred, :succ).should eq Some[[0, 2], [1, 3], [2, 4]]
63
+ Some[1].juxt(:pred, :succ).should eq Some[0, 2]
64
64
  end
65
65
 
66
66
  it "also works for nil" do
@@ -143,7 +143,7 @@ describe Option::Enumerable do
143
143
  end
144
144
 
145
145
  it "also works within the some" do
146
- Some[3,4,5].reduce(:+).should eq 12
146
+ Some[3,4,5].reduce(:+).should eq [3,4,5]
147
147
  end
148
148
  end
149
149
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: optional
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5
4
+ version: 0.0.6
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: