hash-pipe 0.3.0 → 0.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +7 -4
- data/hash-pipe.gemspec +1 -1
- data/lib/hash_pipe/key_conversion.rb +9 -1
- data/spec/hash-pipe/key_conversion_spec.rb +9 -1
- metadata +3 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 47429291152be5977b3f75ca86f796291af0959e
|
4
|
+
data.tar.gz: 848520e03e0b4bfe76059b01246c52d9fbb1bea6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 443665c5461fec98e92e0eb9c91513935679980e56939396d0e0ae933826a5a36aca87fd38478d5eb32dc48e8e27056f1f53567b6378129de4dbe5ddda5cad04
|
7
|
+
data.tar.gz: 715465fba0ab874904ec97daeac15ed9fa77a9d03f2a5c34137cd4b63366995644c34a49884a66e492bc6508b9b9a76ed000de6b92b06bdf2fddf38a1b9fe1af
|
data/Gemfile.lock
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
hash-pipe (0.
|
4
|
+
hash-pipe (0.4.0)
|
5
5
|
activesupport (~> 4.1)
|
6
6
|
|
7
7
|
GEM
|
8
8
|
remote: https://rubygems.org/
|
9
9
|
specs:
|
10
|
-
activesupport (4.2.
|
10
|
+
activesupport (4.2.5.1)
|
11
11
|
i18n (~> 0.7)
|
12
12
|
json (~> 1.7, >= 1.7.7)
|
13
13
|
minitest (~> 5.1)
|
@@ -16,9 +16,9 @@ GEM
|
|
16
16
|
coderay (1.1.0)
|
17
17
|
diff-lcs (1.2.5)
|
18
18
|
i18n (0.7.0)
|
19
|
-
json (1.8.
|
19
|
+
json (1.8.3)
|
20
20
|
method_source (0.8.2)
|
21
|
-
minitest (5.
|
21
|
+
minitest (5.8.4)
|
22
22
|
pry (0.9.12.6)
|
23
23
|
coderay (~> 1.0)
|
24
24
|
method_source (~> 0.8)
|
@@ -43,3 +43,6 @@ DEPENDENCIES
|
|
43
43
|
hash-pipe!
|
44
44
|
pry (~> 0.9)
|
45
45
|
rspec (~> 2.14)
|
46
|
+
|
47
|
+
BUNDLED WITH
|
48
|
+
1.11.2
|
data/hash-pipe.gemspec
CHANGED
@@ -27,6 +27,14 @@ describe 'key_conversion' do
|
|
27
27
|
Hash.convert_keys([{ 'HELLO' => 'world' }, { 'FOO' => 'bar' }]).should eq [{ 'hello' => 'world' }, { 'foo' => 'bar' }]
|
28
28
|
end
|
29
29
|
|
30
|
+
it "should convert an array of hashes directly on the array" do
|
31
|
+
[{ 'HELLO' => 'world' }, { 'FOO' => 'bar' }].convert_keys.should eq [{ 'hello' => 'world' }, { 'foo' => 'bar' }]
|
32
|
+
end
|
33
|
+
|
34
|
+
it "should only convert hashes in the array" do
|
35
|
+
[{ 'HELLO' => 'world' }, 123].convert_keys.should eq [{ 'hello' => 'world' }, 123]
|
36
|
+
end
|
37
|
+
|
30
38
|
it 'should convert arrays of hashes' do
|
31
39
|
{ 'HELLO' => [{ 'MR' => 'world' }] }.convert_keys.should eq 'hello' => [{'mr' => 'world'}]
|
32
40
|
end
|
@@ -40,4 +48,4 @@ describe 'key_conversion' do
|
|
40
48
|
{ 'hello' => 'world' }.convert_keys(converter).should eq 'goodbye' => 'world'
|
41
49
|
end
|
42
50
|
|
43
|
-
end
|
51
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: hash-pipe
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Damien Timewell
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2016-03-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -96,7 +96,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
96
96
|
version: '0'
|
97
97
|
requirements: []
|
98
98
|
rubyforge_project:
|
99
|
-
rubygems_version: 2.
|
99
|
+
rubygems_version: 2.5.1
|
100
100
|
signing_key:
|
101
101
|
specification_version: 4
|
102
102
|
summary: A small collection of useful hash extensions
|
@@ -106,4 +106,3 @@ test_files:
|
|
106
106
|
- spec/hash-pipe/nested_keys_spec.rb
|
107
107
|
- spec/hash-pipe/value_checks_spec.rb
|
108
108
|
- spec/spec_helper.rb
|
109
|
-
has_rdoc:
|