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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b272e715eada957c71274b805c3cc13ddef2201f6d1eaa6ae23b9f19c9da6396
4
- data.tar.gz: 320cedbee54192c465006a77f4e98e2d415e3ab15dfd250e1101774bc8d0c686
3
+ metadata.gz: c057b018c6fd9fa648ba532ebbf0919d7f04c399057aa2a73b61b346076dece9
4
+ data.tar.gz: 9ae7380f4b60de143a6949990a69cb7249f4d81ea06912194c329c5df1b5bcf6
5
5
  SHA512:
6
- metadata.gz: 8bfdde16320124ab7ca2fddfcc7dc17ed019bade21f118bd81a0f0179d7b1258ed4890419e277d7ba8517c73b6e6216cd06adf71b5a80316930b33a47d27e120
7
- data.tar.gz: 22f5c05ddfe99203e30a7aae5e66010e42f9e6342bc605a21c49da288a860d39ce6f56825e62b11c15dad8497d965fe350771d47a6d684badcd6cda48c54d830
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
@@ -1,5 +1,5 @@
1
1
  module Libis
2
2
  module Tools
3
- VERSION = '1.0.7'
3
+ VERSION = '1.0.9'
4
4
  end
5
5
  end
@@ -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', '~> 10.3'
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.7
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-14 00:00:00.000000000 Z
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: '10.3'
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: '10.3'
40
+ version: '13.0'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: rspec
43
43
  requirement: !ruby/object:Gem::Requirement