rumonade 0.4.1 → 0.4.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.
data/HISTORY.md CHANGED
@@ -1,5 +1,10 @@
1
1
  # HISTORY
2
2
 
3
+ ## v0.4.2 (May 9, 2013)
4
+
5
+ - revert change which confused Array#map with Array#flat_map
6
+ - See full list @ https://github.com/ms-ati/rumonade/compare/v0.4.1...v0.4.2
7
+
3
8
  ## v0.4.1 (May 9, 2013)
4
9
 
5
10
  - fixed behavior of #flatten called with optional depth parameter
@@ -18,10 +18,7 @@ module Rumonade
18
18
  METHODS_TO_REPLACE_WITH_MONAD = Monad::DEFAULT_METHODS_TO_REPLACE_WITH_MONAD - [:map]
19
19
 
20
20
  def bind(lam = nil, &blk)
21
- inject(self.class.empty) do |arr, elt|
22
- res = (lam || blk).call(elt)
23
- arr + (res.respond_to?(:to_a) ? res.to_a : [res])
24
- end
21
+ inject(self.class.empty) { |arr, elt| arr + (lam || blk).call(elt).to_a }
25
22
  end
26
23
  end
27
24
  end
@@ -1,3 +1,3 @@
1
1
  module Rumonade
2
- VERSION = "0.4.1"
2
+ VERSION = "0.4.2"
3
3
  end
data/test/array_test.rb CHANGED
@@ -24,11 +24,12 @@ class ArrayTest < Test::Unit::TestCase
24
24
 
25
25
  def test_flat_map_behaves_correctly
26
26
  assert_equal ["FOO", "BAR"], ["foo", "bar"].flat_map { |s| [s.upcase] }
27
- assert_equal [2, 4, 6], [1, 2, 3].flat_map { |i| i * 2 }
27
+ assert_equal [2, 4, 6], [1, 2, 3].flat_map { |i| [i * 2] }
28
28
  end
29
29
 
30
30
  def test_map_behaves_correctly
31
31
  assert_equal ["FOO", "BAR"], ["foo", "bar"].map { |s| s.upcase }
32
+ assert_equal [2, 4, 6], [1, 2, 3].map { |i| i * 2 }
32
33
  end
33
34
 
34
35
  def test_shallow_flatten_behaves_correctly
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rumonade
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.1
4
+ version: 0.4.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: