hash_ext 0.4.0 → 0.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +3 -1
- data/hash_ext.gemspec +1 -1
- data/lib/hash_ext.rb +1 -0
- data/lib/hash_ext/deep_freezable.rb +25 -0
- data/lib/hash_ext/nested.rb +2 -0
- data/lib/hash_ext/normalized.rb +2 -0
- data/lib/hash_ext/sorted.rb +1 -0
- data/lib/hash_ext/version.rb +1 -1
- metadata +9 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cdfe491b5c140f70b6b00ad01689d4ad0a19f284247f0ee0ec8f1a0a142fefc2
|
4
|
+
data.tar.gz: 51c7366d4aadaa3425104581ee9315ccd2876769eaa672bb5f70fcf074f97143
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: dea9009fd4c2ae946c3b975c09ba208a357c6ed7abe974185260102affbd6a0e4f68910fd1dbff2378306004958aaedd4024eae4dbd50c71cb95b6be3beb1f9b
|
7
|
+
data.tar.gz: '09bc0cc742daaa6854c5e23d338e55bcbc080168586d6d9a44a390e34b98bb5c490656c90f52e793349892d8b23ad3e3e0e552218e7c88d323671fe47802a0c1'
|
data/.travis.yml
CHANGED
@@ -8,6 +8,7 @@ rvm:
|
|
8
8
|
- 2.3.0
|
9
9
|
- 2.4.0
|
10
10
|
- 2.5.0
|
11
|
+
- 2.6.0
|
11
12
|
- jruby-1.7.25
|
12
13
|
- jruby-9.1.7.0
|
13
14
|
- ruby-head
|
@@ -20,4 +21,5 @@ matrix:
|
|
20
21
|
- rvm: jruby-head
|
21
22
|
|
22
23
|
before_install:
|
23
|
-
- gem
|
24
|
+
- rvm all-gemsets do gem uninstall bundler -ax || true
|
25
|
+
- gem install bundler -v "< 2"
|
data/hash_ext.gemspec
CHANGED
@@ -21,7 +21,7 @@ Gem::Specification.new do |spec|
|
|
21
21
|
|
22
22
|
spec.add_development_dependency 'bundler', '~> 1.12'
|
23
23
|
spec.add_development_dependency 'rake', '~> 11.0'
|
24
|
-
spec.add_development_dependency 'minitest', '~> 5.0'
|
24
|
+
spec.add_development_dependency 'minitest', '~> 5.0', '< 5.11'
|
25
25
|
spec.add_development_dependency 'minitest-colorin', '~> 0.1'
|
26
26
|
spec.add_development_dependency 'minitest-line', '~> 0.6'
|
27
27
|
spec.add_development_dependency 'simplecov', '~> 0.14'
|
data/lib/hash_ext.rb
CHANGED
@@ -0,0 +1,25 @@
|
|
1
|
+
class Hash
|
2
|
+
module DeepFreezable
|
3
|
+
|
4
|
+
def deep_freeze
|
5
|
+
each_value { |v| deep_freeze_value v }
|
6
|
+
freeze
|
7
|
+
end
|
8
|
+
|
9
|
+
def deep_freeze_value(value)
|
10
|
+
if value.respond_to? :deep_freeze
|
11
|
+
value.deep_freeze
|
12
|
+
else
|
13
|
+
if value.is_a? Hash
|
14
|
+
value.each_value { |v| deep_freeze_value v }
|
15
|
+
elsif value.respond_to? :each
|
16
|
+
value.each { |v| deep_freeze_value v }
|
17
|
+
end
|
18
|
+
value.freeze
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
22
|
+
private :deep_freeze_value
|
23
|
+
|
24
|
+
end
|
25
|
+
end
|
data/lib/hash_ext/nested.rb
CHANGED
data/lib/hash_ext/normalized.rb
CHANGED
data/lib/hash_ext/sorted.rb
CHANGED
data/lib/hash_ext/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: hash_ext
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.5.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Gabriel Naiman
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2019-03-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -45,6 +45,9 @@ dependencies:
|
|
45
45
|
- - "~>"
|
46
46
|
- !ruby/object:Gem::Version
|
47
47
|
version: '5.0'
|
48
|
+
- - "<"
|
49
|
+
- !ruby/object:Gem::Version
|
50
|
+
version: '5.11'
|
48
51
|
type: :development
|
49
52
|
prerelease: false
|
50
53
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -52,6 +55,9 @@ dependencies:
|
|
52
55
|
- - "~>"
|
53
56
|
- !ruby/object:Gem::Version
|
54
57
|
version: '5.0'
|
58
|
+
- - "<"
|
59
|
+
- !ruby/object:Gem::Version
|
60
|
+
version: '5.11'
|
55
61
|
- !ruby/object:Gem::Dependency
|
56
62
|
name: minitest-colorin
|
57
63
|
requirement: !ruby/object:Gem::Requirement
|
@@ -142,6 +148,7 @@ files:
|
|
142
148
|
- lib/hash_ext.rb
|
143
149
|
- lib/hash_ext/accessible.rb
|
144
150
|
- lib/hash_ext/builder.rb
|
151
|
+
- lib/hash_ext/deep_freezable.rb
|
145
152
|
- lib/hash_ext/indifferent.rb
|
146
153
|
- lib/hash_ext/nested.rb
|
147
154
|
- lib/hash_ext/normalized.rb
|