iron-extensions 1.1.1 → 1.1.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.txt +4 -0
- data/Version.txt +1 -1
- data/lib/iron/extensions/enumerable.rb +1 -1
- data/lib/iron/extensions/numeric.rb +0 -4
- data/spec/extensions/enumerable_spec.rb +2 -2
- metadata +4 -4
data/History.txt
CHANGED
@@ -1,3 +1,7 @@
|
|
1
|
+
== 1.1.2 / 2012-03-30
|
2
|
+
|
3
|
+
* Rename Enumerable#to_hash to #convert_to_hash to resolve ActiveRecord conflict
|
4
|
+
|
1
5
|
== 1.1.1 / 2012-03-13
|
2
6
|
|
3
7
|
* Added DslBuilder base class for additional DSL-building goodness, is basically a better blank-slate starter class than BasicObject for working with our DslProxy class
|
data/Version.txt
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.1.
|
1
|
+
1.1.2
|
@@ -2,7 +2,7 @@ module Enumerable
|
|
2
2
|
|
3
3
|
# Converts an enumerable into a hash, by accepting an initial value
|
4
4
|
# or a block to compute the value for a given key.
|
5
|
-
def
|
5
|
+
def convert_to_hash(init_val = nil)
|
6
6
|
hash = {}
|
7
7
|
self.each do |key|
|
8
8
|
hash[key] = block_given? ? yield(key) : init_val
|
@@ -2,11 +2,11 @@
|
|
2
2
|
describe Enumerable do
|
3
3
|
|
4
4
|
it 'should convert to a hash' do
|
5
|
-
[1,2,3].
|
5
|
+
[1,2,3].convert_to_hash.should == {1 => nil, 2 => nil, 3 => nil}
|
6
6
|
end
|
7
7
|
|
8
8
|
it 'should accept a block to set hash values' do
|
9
|
-
[:a, :b, :c].
|
9
|
+
[:a, :b, :c].convert_to_hash {|k| k.to_s.upcase}.should == {:a => 'A', :b => 'B', :c => 'C'}
|
10
10
|
end
|
11
11
|
|
12
12
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: iron-extensions
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.2
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,11 +9,11 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-
|
12
|
+
date: 2012-04-02 00:00:00.000000000Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rspec
|
16
|
-
requirement: &
|
16
|
+
requirement: &2168582060 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ~>
|
@@ -21,7 +21,7 @@ dependencies:
|
|
21
21
|
version: '2.6'
|
22
22
|
type: :development
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *2168582060
|
25
25
|
description: Adds common extensions to core Ruby classes
|
26
26
|
email:
|
27
27
|
- rob@irongaze.com
|