libis-tools 1.0.7 → 1.0.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/libis/tools/extend/hash.rb +32 -0
- data/lib/libis/tools/version.rb +1 -1
- data/libis-tools.gemspec +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c057b018c6fd9fa648ba532ebbf0919d7f04c399057aa2a73b61b346076dece9
|
4
|
+
data.tar.gz: 9ae7380f4b60de143a6949990a69cb7249f4d81ea06912194c329c5df1b5bcf6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c00fa670055c8cc156b3a7b5810f4e927c8386dba41ae4dd5b55bb602124fd962df415a4b0f1c640941685d2d1d3a7bb8222978f199bb55856ba095287015865
|
7
|
+
data.tar.gz: 60d16f403a7473bea8f0de32793a53f72779db587ba82911628ff974b9f62d5fed2eacf3532dad4ff177383e2f47d1c7e9aae8714a66aa1c5b82f011d3142cb4
|
@@ -158,4 +158,36 @@ class Hash
|
|
158
158
|
r
|
159
159
|
end unless method_defined? :key_symbols_to_strings
|
160
160
|
|
161
|
+
def transform_keys
|
162
|
+
result = {}
|
163
|
+
each_key do |key|
|
164
|
+
result[yield(key)] = self[key]
|
165
|
+
end
|
166
|
+
result
|
167
|
+
end unless method_defined? :transform_keys
|
168
|
+
|
169
|
+
def transform_keys!
|
170
|
+
keys.each do |key|
|
171
|
+
self[yield(key)] = delete(key)
|
172
|
+
end
|
173
|
+
self
|
174
|
+
end unless method_defined? :transform_keys!
|
175
|
+
|
176
|
+
def transform_values
|
177
|
+
return enum_for(:transform_values) { size } unless block_given?
|
178
|
+
return {} if empty?
|
179
|
+
result = self.class.new
|
180
|
+
each do |key, value|
|
181
|
+
result[key] = yield(value)
|
182
|
+
end
|
183
|
+
result
|
184
|
+
end unless method_defined? :transform_values
|
185
|
+
|
186
|
+
def transform_values!
|
187
|
+
return enum_for(:transform_values!) { size } unless block_given?
|
188
|
+
each do |key, value|
|
189
|
+
self[key] = yield(value)
|
190
|
+
end
|
191
|
+
end unless method_defined? :transform_values!
|
192
|
+
|
161
193
|
end
|
data/lib/libis/tools/version.rb
CHANGED
data/libis-tools.gemspec
CHANGED
@@ -30,7 +30,7 @@ Gem::Specification.new do |spec|
|
|
30
30
|
spec.has_rdoc = 'yard'
|
31
31
|
|
32
32
|
spec.add_development_dependency 'bundler', '> 1.6'
|
33
|
-
spec.add_development_dependency 'rake', '~>
|
33
|
+
spec.add_development_dependency 'rake', '~> 13.0'
|
34
34
|
spec.add_development_dependency 'rspec', '~> 3.1'
|
35
35
|
spec.add_development_dependency 'term-ansicolor', '~> 1.6'
|
36
36
|
spec.add_development_dependency 'equivalent-xml', '~> 0.5'
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: libis-tools
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kris Dekeyser
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-05-
|
11
|
+
date: 2020-05-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -30,14 +30,14 @@ dependencies:
|
|
30
30
|
requirements:
|
31
31
|
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: '
|
33
|
+
version: '13.0'
|
34
34
|
type: :development
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: '
|
40
|
+
version: '13.0'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: rspec
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|