re-hash 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +13 -0
- data/.rspec +2 -0
- data/.travis.yml +5 -0
- data/Gemfile +4 -0
- data/LICENSE.txt +21 -0
- data/README.md +248 -0
- data/Rakefile +6 -0
- data/bin/console +67 -0
- data/bin/setup +8 -0
- data/lib/rehash.rb +26 -0
- data/lib/rehash/hash_extension.rb +7 -0
- data/lib/rehash/mapper.rb +93 -0
- data/lib/rehash/refinement.rb +7 -0
- data/lib/rehash/version.rb +3 -0
- data/rehash.gemspec +29 -0
- metadata +129 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: a86df189af830efb764480391000e3df8cb7a8ee
|
4
|
+
data.tar.gz: 395cfb542fba02e7a06437c1c03725c9f83409e6
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 2513661d8d0ba04d469a530dae3a62345d5368d5528178e2292af7557463685a9f17c86d3997d52945a9d4e57368ef5010cc18e4e93cfb7c6c49c999d4675456
|
7
|
+
data.tar.gz: 6ee14c245ee4f33f997eba0bb12f7287176f4d291f17cde2f48643f37bc165b28ad66fd22c42f61f84642fb401a254fbef68c202dd6732479ef3918a79663809
|
data/.gitignore
ADDED
data/.rspec
ADDED
data/.travis.yml
ADDED
data/Gemfile
ADDED
data/LICENSE.txt
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2019 Artem Kuzko
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
13
|
+
all copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
21
|
+
THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,248 @@
|
|
1
|
+
# Rehash
|
2
|
+
|
3
|
+
This gem allows you to transform a hash from one structure to another. For instance,
|
4
|
+
to extract deeply nested values from it to a more convenient form with a simple and
|
5
|
+
easy-to use mapping. Inspired by [hash_mapper](https://github.com/ismasan/hash_mapper),
|
6
|
+
but has a more DRY and robust API.
|
7
|
+
|
8
|
+
Do not be confused with Ruby's core `Hash#rehash` method. This gem has nothing to
|
9
|
+
do with it and is used solely for mapping values from source hash into another one.
|
10
|
+
|
11
|
+
[![build status](https://secure.travis-ci.org/akuzko/rehash.png)](http://travis-ci.org/akuzko/rehash)
|
12
|
+
|
13
|
+
## Installation
|
14
|
+
|
15
|
+
Add this line to your application's Gemfile:
|
16
|
+
|
17
|
+
```ruby
|
18
|
+
gem 're-hash', require: 'rehash'
|
19
|
+
```
|
20
|
+
|
21
|
+
And then execute:
|
22
|
+
|
23
|
+
$ bundle
|
24
|
+
|
25
|
+
Or install it yourself as:
|
26
|
+
|
27
|
+
$ gem install re-hash
|
28
|
+
|
29
|
+
## Usage
|
30
|
+
|
31
|
+
Considering we have a following hash:
|
32
|
+
|
33
|
+
```rb
|
34
|
+
hash = {
|
35
|
+
foo: {
|
36
|
+
bar: {
|
37
|
+
baz: 1,
|
38
|
+
bak: 2
|
39
|
+
}
|
40
|
+
},
|
41
|
+
foos: [
|
42
|
+
{ bar: { baz: '3-1' } },
|
43
|
+
{ bar: { baz: '3-2' } }
|
44
|
+
],
|
45
|
+
big_foo: {
|
46
|
+
nested: {
|
47
|
+
bar1: { baz: '4-1' },
|
48
|
+
bar2: { baz: '4-2' },
|
49
|
+
bar3: { baz: '4-3' }
|
50
|
+
}
|
51
|
+
},
|
52
|
+
config: [
|
53
|
+
{name: 'important_value', value: 'yes'},
|
54
|
+
{name: 'secondary_value', value: 'no'}
|
55
|
+
]
|
56
|
+
}
|
57
|
+
```
|
58
|
+
|
59
|
+
### Simple mapping
|
60
|
+
|
61
|
+
Simple mapping, provided as a mapping hash, allows to quickly map source hash
|
62
|
+
values to new structure:
|
63
|
+
|
64
|
+
```rb
|
65
|
+
Rehash.map(hash,
|
66
|
+
'/foo/bar/baz' => '/faz',
|
67
|
+
'/big_foo/nested/bar1/baz' => '/baz1'
|
68
|
+
)
|
69
|
+
# => {:faz => 1, :baz1 => '4-1'}
|
70
|
+
```
|
71
|
+
|
72
|
+
### Block usage
|
73
|
+
|
74
|
+
`Rehash.map` method yield a `Rehash::Mapper` instance that allows you to apply multiple
|
75
|
+
mappings, as well as transform mapped values themselves:
|
76
|
+
|
77
|
+
```rb
|
78
|
+
Rehash.map(hash) do |m|
|
79
|
+
m.(
|
80
|
+
'/foo/bar/baz' => '/faz',
|
81
|
+
'/foo/bar/bak' => '/fak'
|
82
|
+
)
|
83
|
+
m.('/big_foo/nested/bar1/baz' => '/baz1') do |value|
|
84
|
+
value.to_i
|
85
|
+
end
|
86
|
+
m.('/foos' => '/foos') do |foos|
|
87
|
+
foos.map{ |item| Rehash.map(item, '/bar/baz' => '/value') }
|
88
|
+
end
|
89
|
+
end
|
90
|
+
# => {:baz1 => 4, faz: 1, fak: 2, :foos => [{:value => '3-1'}, {:value => '3-2'}]}
|
91
|
+
```
|
92
|
+
|
93
|
+
In case if you need to do any additional manipulations over resulting returned hash,
|
94
|
+
you may access it via `Mapper#result` method (i.e. `m.result` in example above)
|
95
|
+
|
96
|
+
### Accessing array items
|
97
|
+
|
98
|
+
#### By index
|
99
|
+
|
100
|
+
It is very easy to map values from items within array by accessing them by index:
|
101
|
+
|
102
|
+
```rb
|
103
|
+
Rehash.map(hash, '/foos[0]/bar/baz' => '/first_faz')
|
104
|
+
# => {:first_faz => '3-1'}
|
105
|
+
```
|
106
|
+
|
107
|
+
#### By property lookup
|
108
|
+
|
109
|
+
It is also possible to access item within array by one of it's properties:
|
110
|
+
|
111
|
+
```rb
|
112
|
+
Rehash.map(hash, '/config[name:important_value]/value' => '/important')
|
113
|
+
# => {:important => 'yes'}
|
114
|
+
```
|
115
|
+
|
116
|
+
### Refinement (recommended usage)
|
117
|
+
|
118
|
+
`Rehash` also implements a `Hash` class refinement, using which is actually
|
119
|
+
**a recommended way** of using `re-hash`. Considering that `#map` and `#rehash`
|
120
|
+
methods are part of Ruby's Hash core functionality, `Rehash` allows to use
|
121
|
+
`#map_with` method for hash mappings.
|
122
|
+
|
123
|
+
```rb
|
124
|
+
using Rehash
|
125
|
+
|
126
|
+
hash.map_with('/foo/bar/baz' => '/faz') # => {:faz => 1}
|
127
|
+
# OR:
|
128
|
+
hash.map_with do |m|
|
129
|
+
m.('/foo/bar/bak' => '/fak') { |v| v * 2 }
|
130
|
+
end
|
131
|
+
# => {:fak => 4}
|
132
|
+
```
|
133
|
+
|
134
|
+
### HashExtension
|
135
|
+
|
136
|
+
In case if you don't want to use refinement and want to have `#map_with` method
|
137
|
+
globally available, you can extend `Hash` itself with core extension:
|
138
|
+
|
139
|
+
```rb
|
140
|
+
Hash.send(:include, HashExtension)
|
141
|
+
|
142
|
+
{foo: 'baz'}.map_with('/foo' => '/bar') # => {bar: 'baz'}
|
143
|
+
```
|
144
|
+
|
145
|
+
### Options
|
146
|
+
|
147
|
+
`Rehash` uses `'/'` as path delimiter by default, as well as it symbolizes resulting
|
148
|
+
keys. To use other options on a distinct `map` or `map_with` calls you have to use block form:
|
149
|
+
|
150
|
+
```rb
|
151
|
+
Rehash.map(hash, delimiter: '.', symbolize_keys: false) do |m|
|
152
|
+
m.('foo.bam.baz' => 'foo.baz')
|
153
|
+
)
|
154
|
+
# => {"foo" => {"baz" => 1}}
|
155
|
+
```
|
156
|
+
|
157
|
+
Or you can set default options globally:
|
158
|
+
|
159
|
+
```rb
|
160
|
+
Rehash.default_options(delimiter: '.', symbolize_keys: false)
|
161
|
+
Rehash.map(hash, 'foo.bam.baz' => 'foo.baz') # => {"foo" => {"baz" => 1}}
|
162
|
+
```
|
163
|
+
|
164
|
+
### Default value
|
165
|
+
|
166
|
+
On mapping, for convenience, you can use `default` option that will be assigned
|
167
|
+
to value that is missing at the specified path in the source hash or is `nil`
|
168
|
+
*before* it is yielded to the block (if block is given):
|
169
|
+
|
170
|
+
```rb
|
171
|
+
Rehash.map(hash) do |m|
|
172
|
+
m.('/foo/bar/baz' => '/faz', '/missing' => '/bak', default: 5) do |value|
|
173
|
+
value * 2
|
174
|
+
end
|
175
|
+
end
|
176
|
+
# => {:faz => 2, :bar => 10}
|
177
|
+
```
|
178
|
+
|
179
|
+
### Helper methods
|
180
|
+
|
181
|
+
`Mapper` instance that is yielded to the block also has a couple of small helper
|
182
|
+
methods for dealing with arrays and deeply nested values to make things even more DRY.
|
183
|
+
|
184
|
+
- `map_array(from => to, &block)` - used to map an array of items at path `from` to a path `to`,
|
185
|
+
yielding a `Mapper` instance for each item:
|
186
|
+
|
187
|
+
```rb
|
188
|
+
Rehash.map(hash) do |m|
|
189
|
+
m.map_array('/foos' => '/foos') do |im|
|
190
|
+
im.('/bar/baz' => '/value')
|
191
|
+
end
|
192
|
+
# is the same as:
|
193
|
+
m.('/foos' => '/foos') do |value|
|
194
|
+
value.map do |item|
|
195
|
+
Rehash.map(item, '/bar/baz' => '/value')
|
196
|
+
end
|
197
|
+
end
|
198
|
+
end
|
199
|
+
```
|
200
|
+
|
201
|
+
- `map_hash(from => to, &block)` - yields a `Mapper` instance for a hash located at
|
202
|
+
the path `from` and puts result of mapping to the path defined by `to`:
|
203
|
+
|
204
|
+
```rb
|
205
|
+
Rehash.map(hash) do |m|
|
206
|
+
m.map_hash('/big_foo/nested' => '/') do |hm|
|
207
|
+
hm.(
|
208
|
+
'/bar1/baz' => '/big_baz1',
|
209
|
+
'/bar2/baz' => '/big_baz2',
|
210
|
+
'/bar3/baz' => '/big_baz3'
|
211
|
+
)
|
212
|
+
end
|
213
|
+
# is the same as:
|
214
|
+
m.(
|
215
|
+
'/big_foo/nested/bar1/baz' => '/big_baz1',
|
216
|
+
'/big_foo/nested/bar2/baz' => '/big_baz2',
|
217
|
+
'/big_foo/nested/bar3/baz' => '/big_baz3'
|
218
|
+
)
|
219
|
+
end
|
220
|
+
```
|
221
|
+
|
222
|
+
- `[](path)` and `[]=(path, value)` - small helper methods that can be called on mapper
|
223
|
+
object when hash is mapped with a block form. `[](path)` can be used to get the value
|
224
|
+
at the `path` **in source hash**, and `[]=(path, value)` can be used to put the `value`
|
225
|
+
at the `path` **in the resulting hash**:
|
226
|
+
|
227
|
+
```rb
|
228
|
+
Rehash.map(hash) do |m|
|
229
|
+
m['/faz'] = m['/foo/bar/baz']
|
230
|
+
# is essentially the same as:
|
231
|
+
m.('/foo/bar/baz' => '/faz')
|
232
|
+
end
|
233
|
+
```
|
234
|
+
|
235
|
+
## Development
|
236
|
+
|
237
|
+
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec`
|
238
|
+
to run the tests. You can also run `bin/console` for an interactive prompt that will allow
|
239
|
+
you to experiment.
|
240
|
+
|
241
|
+
## Contributing
|
242
|
+
|
243
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/akuzko/rehash.
|
244
|
+
|
245
|
+
## License
|
246
|
+
|
247
|
+
The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
|
248
|
+
|
data/Rakefile
ADDED
data/bin/console
ADDED
@@ -0,0 +1,67 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require "bundler/setup"
|
4
|
+
require "rehash"
|
5
|
+
|
6
|
+
using Rehash
|
7
|
+
|
8
|
+
hash = {
|
9
|
+
foo: {
|
10
|
+
bar: {
|
11
|
+
baz: 1
|
12
|
+
}
|
13
|
+
},
|
14
|
+
other_foo: 2,
|
15
|
+
foos: [
|
16
|
+
{ bar: { baz: '3-1' } },
|
17
|
+
{ bar: { baz: '3-2' } }
|
18
|
+
],
|
19
|
+
foos2: [
|
20
|
+
{ bar: { baz: '4-1' } },
|
21
|
+
{ bar: { baz: '4-2' } }
|
22
|
+
],
|
23
|
+
big_foo: {
|
24
|
+
nested: {
|
25
|
+
bar1: { baz: '5-1' },
|
26
|
+
bar2: { baz: '5-2' },
|
27
|
+
bar3: { baz: '5-3' }
|
28
|
+
}
|
29
|
+
},
|
30
|
+
items: [6],
|
31
|
+
config: [
|
32
|
+
{name: 'important_value', value: 'yes'},
|
33
|
+
{name: 'secondary_value', value: 'no'}
|
34
|
+
]
|
35
|
+
}
|
36
|
+
|
37
|
+
rehash = hash.map_with do |m|
|
38
|
+
m.(
|
39
|
+
'/foo/bar/baz' => '/faz',
|
40
|
+
'/other_foo' => '/foo',
|
41
|
+
'/items[0]' => '/first_item'
|
42
|
+
)
|
43
|
+
|
44
|
+
m.('/foos' => '/foos') do |items|
|
45
|
+
items.map { |item| item.map_with('/bar/baz' => '/value') }
|
46
|
+
end
|
47
|
+
|
48
|
+
m.map_array('/foos2' => '/other_foos') do |im|
|
49
|
+
im.('/bar/baz' => '/value')
|
50
|
+
end
|
51
|
+
|
52
|
+
m.map_hash('/big_foo/nested' => '/') do |hm|
|
53
|
+
hm.(
|
54
|
+
'/bar1/baz' => '/big_baz1',
|
55
|
+
'/bar2/baz' => '/big_baz2',
|
56
|
+
'/bar3/baz' => '/big_baz3'
|
57
|
+
)
|
58
|
+
end
|
59
|
+
|
60
|
+
m.('/config[name:important_value]/value' => '/important')
|
61
|
+
m.('/config[name:missing_value]/value' => '/two', default: 2) do |val|
|
62
|
+
val * 2
|
63
|
+
end
|
64
|
+
end
|
65
|
+
|
66
|
+
require "pry"
|
67
|
+
Pry.start
|
data/bin/setup
ADDED
data/lib/rehash.rb
ADDED
@@ -0,0 +1,26 @@
|
|
1
|
+
require "rehash/version"
|
2
|
+
require "rehash/mapper"
|
3
|
+
require "rehash/hash_extension"
|
4
|
+
require "rehash/refinement"
|
5
|
+
|
6
|
+
module Rehash
|
7
|
+
@@default_options = {delimiter: '/'.freeze, symbolize_keys: true}.freeze
|
8
|
+
|
9
|
+
module_function
|
10
|
+
|
11
|
+
def default_options(value = nil)
|
12
|
+
return @@default_options if value.nil?
|
13
|
+
|
14
|
+
@@default_options = @@default_options.merge(value).freeze
|
15
|
+
end
|
16
|
+
|
17
|
+
def map(hash, opts_or_mapping = {})
|
18
|
+
if block_given?
|
19
|
+
mapper = Mapper.new(hash, default_options.merge(opts_or_mapping))
|
20
|
+
yield mapper
|
21
|
+
mapper.result
|
22
|
+
else
|
23
|
+
Mapper.new(hash).(opts_or_mapping)
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
@@ -0,0 +1,93 @@
|
|
1
|
+
module Rehash
|
2
|
+
class Mapper
|
3
|
+
attr_reader :result
|
4
|
+
|
5
|
+
def initialize(source, opts = Rehash.default_options)
|
6
|
+
@source = source
|
7
|
+
@result = {}
|
8
|
+
@symbolize_keys = opts[:symbolize_keys]
|
9
|
+
@delimiter = opts[:delimiter]
|
10
|
+
end
|
11
|
+
|
12
|
+
def call(mapping, &block)
|
13
|
+
default = mapping.delete(:default) if mapping.key?(:default)
|
14
|
+
|
15
|
+
mapping.each do |from, to|
|
16
|
+
value = get_value(from)
|
17
|
+
value = default if value.nil? && !default.nil?
|
18
|
+
value = yield value if block_given?
|
19
|
+
put_value(to, value)
|
20
|
+
end
|
21
|
+
|
22
|
+
result
|
23
|
+
end
|
24
|
+
|
25
|
+
def [](path)
|
26
|
+
get_value(path)
|
27
|
+
end
|
28
|
+
|
29
|
+
def []=(path, value)
|
30
|
+
put_value(path, value)
|
31
|
+
end
|
32
|
+
|
33
|
+
def map_array(mapping)
|
34
|
+
call(mapping) do |value|
|
35
|
+
value.map do |item|
|
36
|
+
Rehash.map(item) do |item_re|
|
37
|
+
yield item_re
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
41
|
+
end
|
42
|
+
|
43
|
+
def map_hash(mapping)
|
44
|
+
call(mapping) do |value|
|
45
|
+
Rehash.map(value) do |nested_re|
|
46
|
+
yield nested_re
|
47
|
+
end
|
48
|
+
end
|
49
|
+
end
|
50
|
+
|
51
|
+
private
|
52
|
+
|
53
|
+
def get_value(path)
|
54
|
+
path.split(@delimiter).reject(&:empty?).reduce(@source) do |result, key|
|
55
|
+
return if !result
|
56
|
+
|
57
|
+
with_array_access, array_key, index = with_array_access?(key)
|
58
|
+
|
59
|
+
if with_array_access
|
60
|
+
lookup(result[array_key] || result[array_key.to_sym], index)
|
61
|
+
else
|
62
|
+
result[key] || result[key.to_sym]
|
63
|
+
end
|
64
|
+
end
|
65
|
+
end
|
66
|
+
|
67
|
+
def put_value(path, value)
|
68
|
+
keys = path.split(@delimiter).reject(&:empty?)
|
69
|
+
|
70
|
+
return @result.merge!(value) if keys.length == 0
|
71
|
+
|
72
|
+
keys.each_with_index.reduce(@result) do |res, (key, i)|
|
73
|
+
result_key = @symbolize_keys ? key.to_sym : key
|
74
|
+
if i == keys.length - 1
|
75
|
+
res[result_key] = value
|
76
|
+
else
|
77
|
+
res[result_key] = {}
|
78
|
+
end
|
79
|
+
end
|
80
|
+
end
|
81
|
+
|
82
|
+
def with_array_access?(key)
|
83
|
+
return key =~ /^([^\[\]]+)\[([\d\w\s&$_:-]+)\]$/, $1, $2
|
84
|
+
end
|
85
|
+
|
86
|
+
def lookup(array, index)
|
87
|
+
return array[index.to_i] unless index =~ /^([^:]+):(.+)$/
|
88
|
+
|
89
|
+
key, value = $1, $2
|
90
|
+
array.find { |item| (item[key] || item[key.to_sym]) == value }
|
91
|
+
end
|
92
|
+
end
|
93
|
+
end
|
data/rehash.gemspec
ADDED
@@ -0,0 +1,29 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require 'rehash/version'
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = "re-hash"
|
8
|
+
spec.version = Rehash::VERSION
|
9
|
+
spec.authors = ["Artem Kuzko"]
|
10
|
+
spec.email = ["a.kuzko@gmail.com"]
|
11
|
+
|
12
|
+
spec.summary = %q{Easy-to-use hash values mapping and transformation.}
|
13
|
+
spec.description = %q{Easy-to-use hash deeply nested values mapping and transformation.}
|
14
|
+
spec.homepage = "https://github.com/akuzko/rehash"
|
15
|
+
spec.license = "MIT"
|
16
|
+
|
17
|
+
spec.required_ruby_version = '>= 2.1.0'
|
18
|
+
|
19
|
+
spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
20
|
+
spec.bindir = "exe"
|
21
|
+
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
22
|
+
spec.require_paths = ["lib"]
|
23
|
+
|
24
|
+
spec.add_development_dependency "bundler", "~> 1.12"
|
25
|
+
spec.add_development_dependency "rake", "~> 10.0"
|
26
|
+
spec.add_development_dependency "rspec", "~> 3.0"
|
27
|
+
spec.add_development_dependency "pry"
|
28
|
+
spec.add_development_dependency "pry-nav"
|
29
|
+
end
|
metadata
ADDED
@@ -0,0 +1,129 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: re-hash
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Artem Kuzko
|
8
|
+
autorequire:
|
9
|
+
bindir: exe
|
10
|
+
cert_chain: []
|
11
|
+
date: 2019-03-22 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: bundler
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '1.12'
|
20
|
+
type: :development
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '1.12'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: rake
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '10.0'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '10.0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: rspec
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '3.0'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '3.0'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: pry
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - ">="
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - ">="
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: pry-nav
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - ">="
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '0'
|
76
|
+
type: :development
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - ">="
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '0'
|
83
|
+
description: Easy-to-use hash deeply nested values mapping and transformation.
|
84
|
+
email:
|
85
|
+
- a.kuzko@gmail.com
|
86
|
+
executables: []
|
87
|
+
extensions: []
|
88
|
+
extra_rdoc_files: []
|
89
|
+
files:
|
90
|
+
- ".gitignore"
|
91
|
+
- ".rspec"
|
92
|
+
- ".travis.yml"
|
93
|
+
- Gemfile
|
94
|
+
- LICENSE.txt
|
95
|
+
- README.md
|
96
|
+
- Rakefile
|
97
|
+
- bin/console
|
98
|
+
- bin/setup
|
99
|
+
- lib/rehash.rb
|
100
|
+
- lib/rehash/hash_extension.rb
|
101
|
+
- lib/rehash/mapper.rb
|
102
|
+
- lib/rehash/refinement.rb
|
103
|
+
- lib/rehash/version.rb
|
104
|
+
- rehash.gemspec
|
105
|
+
homepage: https://github.com/akuzko/rehash
|
106
|
+
licenses:
|
107
|
+
- MIT
|
108
|
+
metadata: {}
|
109
|
+
post_install_message:
|
110
|
+
rdoc_options: []
|
111
|
+
require_paths:
|
112
|
+
- lib
|
113
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
114
|
+
requirements:
|
115
|
+
- - ">="
|
116
|
+
- !ruby/object:Gem::Version
|
117
|
+
version: 2.1.0
|
118
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
119
|
+
requirements:
|
120
|
+
- - ">="
|
121
|
+
- !ruby/object:Gem::Version
|
122
|
+
version: '0'
|
123
|
+
requirements: []
|
124
|
+
rubyforge_project:
|
125
|
+
rubygems_version: 2.4.8
|
126
|
+
signing_key:
|
127
|
+
specification_version: 4
|
128
|
+
summary: Easy-to-use hash values mapping and transformation.
|
129
|
+
test_files: []
|