hashr 0.0.19 → 0.0.20
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile.lock +1 -1
- data/lib/hashr/core_ext/ruby/hash.rb +4 -0
- data/lib/hashr/version.rb +1 -1
- data/test/core_ext_test.rb +7 -0
- metadata +23 -24
data/Gemfile.lock
CHANGED
@@ -26,6 +26,10 @@ class Hash
|
|
26
26
|
end
|
27
27
|
end
|
28
28
|
|
29
|
+
def deep_symbolize_keys!
|
30
|
+
replace(deep_symbolize_keys)
|
31
|
+
end
|
32
|
+
|
29
33
|
# deep_merge_hash! by Stefan Rusterholz, see http://www.ruby-forum.com/topic/142809
|
30
34
|
def deep_merge(other)
|
31
35
|
merger = proc { |key, v1, v2| Hash === v1 && Hash === v2 ? v1.merge(v2, &merger) : v2 }
|
data/lib/hashr/version.rb
CHANGED
data/test/core_ext_test.rb
CHANGED
@@ -6,4 +6,11 @@ class CoreExtTest < Test::Unit::TestCase
|
|
6
6
|
expected = { :foo => [{ :bar => 'bar', :baz => { :buz => 'buz' } }] }
|
7
7
|
assert_equal expected, hash.deep_symbolize_keys
|
8
8
|
end
|
9
|
+
|
10
|
+
test 'deep_symbolize_keys! replaces with deep_symbolize' do
|
11
|
+
hash = { 'foo' => { 'bar' => 'baz' } }
|
12
|
+
expected = { :foo => { :bar => 'baz' } }
|
13
|
+
hash.deep_symbolize_keys!
|
14
|
+
assert_equal expected, hash
|
15
|
+
end
|
9
16
|
end
|
metadata
CHANGED
@@ -1,49 +1,49 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: hashr
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
|
5
|
-
|
4
|
+
version: 0.0.20
|
5
|
+
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- Sven Fuchs
|
9
|
-
autorequire:
|
9
|
+
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
13
|
-
default_executable:
|
12
|
+
date: 2012-04-05 00:00:00.000000000 Z
|
14
13
|
dependencies:
|
15
14
|
- !ruby/object:Gem::Dependency
|
16
15
|
name: rake
|
17
|
-
|
16
|
+
requirement: &70316954138920 !ruby/object:Gem::Requirement
|
17
|
+
none: false
|
18
18
|
requirements:
|
19
19
|
- - ! '>='
|
20
20
|
- !ruby/object:Gem::Version
|
21
21
|
version: '0'
|
22
|
-
none: false
|
23
|
-
requirement: *2534
|
24
|
-
prerelease: false
|
25
22
|
type: :development
|
23
|
+
prerelease: false
|
24
|
+
version_requirements: *70316954138920
|
26
25
|
- !ruby/object:Gem::Dependency
|
27
26
|
name: test_declarative
|
28
|
-
|
27
|
+
requirement: &70316954138400 !ruby/object:Gem::Requirement
|
28
|
+
none: false
|
29
29
|
requirements:
|
30
30
|
- - ! '>='
|
31
31
|
- !ruby/object:Gem::Version
|
32
32
|
version: 0.0.2
|
33
|
-
none: false
|
34
|
-
requirement: *2552
|
35
|
-
prerelease: false
|
36
33
|
type: :development
|
37
|
-
|
34
|
+
prerelease: false
|
35
|
+
version_requirements: *70316954138400
|
36
|
+
description: Simple Hash extension to make working with nested hashes (e.g. for configuration)
|
37
|
+
easier and less error-prone.
|
38
38
|
email: svenfuchs@artweb-design.de
|
39
39
|
executables: []
|
40
40
|
extensions: []
|
41
41
|
extra_rdoc_files: []
|
42
42
|
files:
|
43
|
-
- lib/hashr.rb
|
43
|
+
- lib/hashr/core_ext/ruby/hash.rb
|
44
44
|
- lib/hashr/env_defaults.rb
|
45
45
|
- lib/hashr/version.rb
|
46
|
-
- lib/hashr
|
46
|
+
- lib/hashr.rb
|
47
47
|
- test/core_ext_test.rb
|
48
48
|
- test/hashr_test.rb
|
49
49
|
- test/test_helper.rb
|
@@ -52,30 +52,29 @@ files:
|
|
52
52
|
- MIT-LICENSE
|
53
53
|
- Rakefile
|
54
54
|
- README.md
|
55
|
-
has_rdoc: true
|
56
55
|
homepage: http://github.com/svenfuchs/hashr
|
57
56
|
licenses: []
|
58
|
-
post_install_message:
|
57
|
+
post_install_message:
|
59
58
|
rdoc_options: []
|
60
59
|
require_paths:
|
61
60
|
- lib
|
62
61
|
required_ruby_version: !ruby/object:Gem::Requirement
|
62
|
+
none: false
|
63
63
|
requirements:
|
64
64
|
- - ! '>='
|
65
65
|
- !ruby/object:Gem::Version
|
66
66
|
version: '0'
|
67
|
-
none: false
|
68
67
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
68
|
+
none: false
|
69
69
|
requirements:
|
70
70
|
- - ! '>='
|
71
71
|
- !ruby/object:Gem::Version
|
72
72
|
version: '0'
|
73
|
-
none: false
|
74
73
|
requirements: []
|
75
74
|
rubyforge_project: ! '[none]'
|
76
|
-
rubygems_version: 1.
|
77
|
-
signing_key:
|
75
|
+
rubygems_version: 1.8.11
|
76
|
+
signing_key:
|
78
77
|
specification_version: 3
|
79
|
-
summary: Simple Hash extension to make working with nested hashes (e.g. for configuration)
|
78
|
+
summary: Simple Hash extension to make working with nested hashes (e.g. for configuration)
|
79
|
+
easier and less error-prone
|
80
80
|
test_files: []
|
81
|
-
...
|