objectifier 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 +9 -0
- data/.rspec +2 -0
- data/.travis.yml +4 -0
- data/Gemfile +4 -0
- data/Guardfile +42 -0
- data/LICENSE.txt +21 -0
- data/README.md +101 -0
- data/Rakefile +6 -0
- data/bin/console +14 -0
- data/bin/setup +8 -0
- data/lib/objectifier.rb +16 -0
- data/lib/objectifier/array_value.rb +73 -0
- data/lib/objectifier/map_value.rb +82 -0
- data/lib/objectifier/result.rb +58 -0
- data/lib/objectifier/scalar_value.rb +56 -0
- data/lib/objectifier/transformer_factory.rb +26 -0
- data/lib/objectifier/version.rb +3 -0
- data/objectifier.gemspec +26 -0
- metadata +118 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 928a6d7f9b3ac93bc01021176a357972f49874fa
|
4
|
+
data.tar.gz: 792a43d2ae0268e0af02fcd31254230a26b7e96c
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: f4eca05dfd26f9812fcb053c3453b8f706676e5d914113749881abe441191b6e8fe41d690c5983f3054fc0f8ac533ad21abfe9c98868b0a4d8311fec3e737b43
|
7
|
+
data.tar.gz: 1aa93f41a75c979431ade89d62f1d8a5d43441c528b52555504e39ac890689eb0d39a4edea6f8950b98948dabc559af0b63d5e02a93223da0916920b9c8764be
|
data/.gitignore
ADDED
data/.rspec
ADDED
data/.travis.yml
ADDED
data/Gemfile
ADDED
data/Guardfile
ADDED
@@ -0,0 +1,42 @@
|
|
1
|
+
# A sample Guardfile
|
2
|
+
# More info at https://github.com/guard/guard#readme
|
3
|
+
|
4
|
+
## Uncomment and set this to only include directories you want to watch
|
5
|
+
# directories %w(app lib config test spec features) \
|
6
|
+
# .select{|d| Dir.exists?(d) ? d : UI.warning("Directory #{d} does not exist")}
|
7
|
+
|
8
|
+
## Note: if you are using the `directories` clause above and you are not
|
9
|
+
## watching the project directory ('.'), then you will want to move
|
10
|
+
## the Guardfile to a watched dir and symlink it back, e.g.
|
11
|
+
#
|
12
|
+
# $ mkdir config
|
13
|
+
# $ mv Guardfile config/
|
14
|
+
# $ ln -s config/Guardfile .
|
15
|
+
#
|
16
|
+
# and, you'll have to watch "config/Guardfile" instead of "Guardfile"
|
17
|
+
|
18
|
+
# Note: The cmd option is now required due to the increasing number of ways
|
19
|
+
# rspec may be run, below are examples of the most common uses.
|
20
|
+
# * bundler: 'bundle exec rspec'
|
21
|
+
# * bundler binstubs: 'bin/rspec'
|
22
|
+
# * spring: 'bin/rspec' (This will use spring if running and you have
|
23
|
+
# installed the spring binstubs per the docs)
|
24
|
+
# * zeus: 'zeus rspec' (requires the server to be started separately)
|
25
|
+
# * 'just' rspec: 'rspec'
|
26
|
+
|
27
|
+
guard :rspec, cmd: "bundle exec rspec" do
|
28
|
+
require "guard/rspec/dsl"
|
29
|
+
dsl = Guard::RSpec::Dsl.new(self)
|
30
|
+
|
31
|
+
# Feel free to open issues for suggestions and improvements
|
32
|
+
|
33
|
+
# RSpec files
|
34
|
+
rspec = dsl.rspec
|
35
|
+
watch(rspec.spec_helper) { rspec.spec_dir }
|
36
|
+
watch(rspec.spec_support) { rspec.spec_dir }
|
37
|
+
watch(rspec.spec_files)
|
38
|
+
|
39
|
+
# Ruby files
|
40
|
+
ruby = dsl.ruby
|
41
|
+
dsl.watch_spec_files_for(ruby.lib_files)
|
42
|
+
end
|
data/LICENSE.txt
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2016 Nigel Rantor
|
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,101 @@
|
|
1
|
+
# Objectifier
|
2
|
+
|
3
|
+
[![Build Status](https://travis-ci.org/wiggly/objectifier.svg?branch=master)](https://travis-ci.org/wiggly/objectifier)
|
4
|
+
|
5
|
+
De-serialise plain hashes into objects.
|
6
|
+
|
7
|
+
The rationale behind this is to be able to take input from external sources such as REST calls or log files and turn them into graphs of objects or find out why they cannot be tranformed.
|
8
|
+
|
9
|
+
This is the first cut of the code and it currently only handles a small number of types but you can add your own already. Better default types will be coming soon.
|
10
|
+
|
11
|
+
## Installation
|
12
|
+
|
13
|
+
Add this line to your application's Gemfile:
|
14
|
+
|
15
|
+
```ruby
|
16
|
+
gem 'objectifier'
|
17
|
+
```
|
18
|
+
|
19
|
+
And then execute:
|
20
|
+
|
21
|
+
$ bundle
|
22
|
+
|
23
|
+
Or install it yourself as:
|
24
|
+
|
25
|
+
$ gem install objectifier
|
26
|
+
|
27
|
+
## Usage
|
28
|
+
|
29
|
+
Create custom transformers, create an objectifier and use it to de-serialise hashes.
|
30
|
+
|
31
|
+
```
|
32
|
+
require 'objectifier'
|
33
|
+
require 'money'
|
34
|
+
|
35
|
+
# Add a custom tranformer for Money values
|
36
|
+
Objectifier.factories.add_type(
|
37
|
+
Money,
|
38
|
+
->(name, value) {
|
39
|
+
Objectifier::ValueResult.new(name, Money.new(value["amount"], value["code"]))
|
40
|
+
})
|
41
|
+
|
42
|
+
# define an objectifier that can be used to de-serialise a given format
|
43
|
+
obj = Objectifier.define do
|
44
|
+
item :name, type: String, required: false
|
45
|
+
|
46
|
+
items :accounts, type: Integer
|
47
|
+
|
48
|
+
item :budget, type: Money
|
49
|
+
|
50
|
+
item :length, type: Integer, required: false
|
51
|
+
|
52
|
+
map :activity do
|
53
|
+
item :clicks, type: Integer
|
54
|
+
item :ctr, type: Float
|
55
|
+
end
|
56
|
+
end
|
57
|
+
|
58
|
+
# some test parameters
|
59
|
+
parameters = {
|
60
|
+
"name" => "Billy",
|
61
|
+
|
62
|
+
"accounts" => [ "100", "300", "150", "23" ],
|
63
|
+
|
64
|
+
"budget" => {
|
65
|
+
"amount" => "10.00.0",
|
66
|
+
"code" => "GBP",
|
67
|
+
},
|
68
|
+
|
69
|
+
"length" => "42",
|
70
|
+
|
71
|
+
"activity" => {
|
72
|
+
"clicks" => "83351",
|
73
|
+
"ctr" => "3.1",
|
74
|
+
},
|
75
|
+
}
|
76
|
+
|
77
|
+
# transform input into real objects or return detailed error messages
|
78
|
+
result = obj.call(parameters)
|
79
|
+
|
80
|
+
if result.success?
|
81
|
+
puts result.value
|
82
|
+
else
|
83
|
+
puts result
|
84
|
+
end
|
85
|
+
```
|
86
|
+
|
87
|
+
## Development
|
88
|
+
|
89
|
+
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
90
|
+
|
91
|
+
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
|
92
|
+
|
93
|
+
|
94
|
+
## Contributing
|
95
|
+
|
96
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/wiggly/objectifier.
|
97
|
+
|
98
|
+
|
99
|
+
## License
|
100
|
+
|
101
|
+
The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
|
data/Rakefile
ADDED
data/bin/console
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require "bundler/setup"
|
4
|
+
require "objectifier"
|
5
|
+
|
6
|
+
# You can add fixtures and/or initialization code here to make experimenting
|
7
|
+
# with your gem easier. You can also use a different console, if you like.
|
8
|
+
|
9
|
+
# (If you use this, don't forget to add pry to your Gemfile!)
|
10
|
+
# require "pry"
|
11
|
+
# Pry.start
|
12
|
+
|
13
|
+
require "irb"
|
14
|
+
IRB.start
|
data/bin/setup
ADDED
data/lib/objectifier.rb
ADDED
@@ -0,0 +1,16 @@
|
|
1
|
+
require "objectifier/version"
|
2
|
+
require "objectifier/result"
|
3
|
+
require "objectifier/scalar_value"
|
4
|
+
require "objectifier/array_value"
|
5
|
+
require "objectifier/map_value"
|
6
|
+
require "objectifier/transformer_factory"
|
7
|
+
|
8
|
+
module Objectifier
|
9
|
+
def self.factories
|
10
|
+
@factories ||= TransformerFactory.new
|
11
|
+
end
|
12
|
+
|
13
|
+
def self.define(&block)
|
14
|
+
MapValue.new("",&block)
|
15
|
+
end
|
16
|
+
end
|
@@ -0,0 +1,73 @@
|
|
1
|
+
require "objectifier/result"
|
2
|
+
|
3
|
+
module Objectifier
|
4
|
+
class ArrayValue
|
5
|
+
attr_reader :name, :type
|
6
|
+
|
7
|
+
def initialize(name, **args)
|
8
|
+
raise ArgumentError, "name required" if name.nil?
|
9
|
+
raise ArgumentError, "type required" unless args[:type]
|
10
|
+
|
11
|
+
@name = name.to_s
|
12
|
+
@type = args[:type]
|
13
|
+
@required = args.fetch(:required, true)
|
14
|
+
end
|
15
|
+
|
16
|
+
def required?
|
17
|
+
@required
|
18
|
+
end
|
19
|
+
|
20
|
+
def call(parameters)
|
21
|
+
if @required && !key_present(parameters)
|
22
|
+
ErrorResult.err(@name, "required field missing")
|
23
|
+
elsif key_present(parameters)
|
24
|
+
transform(key_value(parameters))
|
25
|
+
else
|
26
|
+
SuccessResult.new(@name)
|
27
|
+
end
|
28
|
+
end
|
29
|
+
|
30
|
+
def pp(indent = "")
|
31
|
+
"#{indent} #{to_s}"
|
32
|
+
end
|
33
|
+
|
34
|
+
protected
|
35
|
+
|
36
|
+
def key_present(parameters)
|
37
|
+
parameters.has_key?(@name)
|
38
|
+
end
|
39
|
+
|
40
|
+
def key_value(parameters)
|
41
|
+
parameters.fetch(
|
42
|
+
@name,
|
43
|
+
parameters[@name]
|
44
|
+
)
|
45
|
+
end
|
46
|
+
|
47
|
+
def transform(value)
|
48
|
+
return ErrorResult.err(@name, "items must be Array type") unless value.kind_of? Array
|
49
|
+
|
50
|
+
|
51
|
+
# TODO return result type
|
52
|
+
result = value.map { |element| Objectifier.factories.for_type(@type).call(@name, element) }
|
53
|
+
|
54
|
+
values, errors = result.partition do |v|
|
55
|
+
v.success?
|
56
|
+
end
|
57
|
+
|
58
|
+
if errors.empty?
|
59
|
+
xr = values.map do |v|
|
60
|
+
v.value
|
61
|
+
end
|
62
|
+
|
63
|
+
ValueResult.new(@scope, xr)
|
64
|
+
else
|
65
|
+
errors.reduce(ErrorResult.new) { |total, err| total.merge(err) }.scope(@scope)
|
66
|
+
end
|
67
|
+
end
|
68
|
+
|
69
|
+
def to_s
|
70
|
+
"array %s - type: %s - required: %s" % [ @name, @type.to_s, @required.to_s ]
|
71
|
+
end
|
72
|
+
end
|
73
|
+
end
|
@@ -0,0 +1,82 @@
|
|
1
|
+
require "objectifier/result"
|
2
|
+
|
3
|
+
module Objectifier
|
4
|
+
class MapValue
|
5
|
+
attr_reader :rules
|
6
|
+
|
7
|
+
def initialize(scope = "", &block)
|
8
|
+
@scope = scope.to_s
|
9
|
+
@rules = Hash.new
|
10
|
+
instance_eval &block
|
11
|
+
end
|
12
|
+
|
13
|
+
def name
|
14
|
+
@scope
|
15
|
+
end
|
16
|
+
|
17
|
+
def required?
|
18
|
+
@rules.values.reduce(false) do |req, rule|
|
19
|
+
req || rule.required?
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
23
|
+
def item(name, **args)
|
24
|
+
@rules[name.to_s] = ScalarValue.new(name, args)
|
25
|
+
true
|
26
|
+
end
|
27
|
+
|
28
|
+
def items(name, **args)
|
29
|
+
@rules[name.to_s] = ArrayValue.new(name, args)
|
30
|
+
true
|
31
|
+
end
|
32
|
+
|
33
|
+
def map(name, &block)
|
34
|
+
@rules[name.to_s] = MapValue.new(name, &block)
|
35
|
+
true
|
36
|
+
end
|
37
|
+
|
38
|
+
def pp(indent = "")
|
39
|
+
next_indent = "#{indent} "
|
40
|
+
str = "#{indent} #{@scope} {\n"
|
41
|
+
str << @rules.values.map { |r| r.pp(next_indent) }.join("\n")
|
42
|
+
str << "\n#{indent}}\n"
|
43
|
+
str
|
44
|
+
end
|
45
|
+
|
46
|
+
def to_s
|
47
|
+
pp("")
|
48
|
+
end
|
49
|
+
|
50
|
+
# examine parameters and return a hash of massaged data or an error results
|
51
|
+
def call(parameters)
|
52
|
+
|
53
|
+
if @scope.length > 0
|
54
|
+
parameters = parameters.fetch(
|
55
|
+
@scope,
|
56
|
+
parameters.fetch(
|
57
|
+
@scope.to_s,
|
58
|
+
{}))
|
59
|
+
end
|
60
|
+
|
61
|
+
ok, errors = @rules.values.map do |rule|
|
62
|
+
rule.call(parameters)
|
63
|
+
end.partition do |result|
|
64
|
+
result.success?
|
65
|
+
end
|
66
|
+
|
67
|
+
if errors.empty?
|
68
|
+
values = ok.select(&:value?)
|
69
|
+
|
70
|
+
if values.empty?
|
71
|
+
SuccessResult.new(@scope)
|
72
|
+
else
|
73
|
+
ValueResult.new(
|
74
|
+
@scope,
|
75
|
+
Hash[values.map { |v| [ v.name, v.value ] }])
|
76
|
+
end
|
77
|
+
else
|
78
|
+
errors.reduce(ErrorResult.new) { |total, err| total.merge(err) }.scope(@scope)
|
79
|
+
end
|
80
|
+
end
|
81
|
+
end
|
82
|
+
end
|
@@ -0,0 +1,58 @@
|
|
1
|
+
module Objectifier
|
2
|
+
class SuccessResult
|
3
|
+
attr_reader :name
|
4
|
+
|
5
|
+
def initialize(name)
|
6
|
+
@name = name
|
7
|
+
end
|
8
|
+
|
9
|
+
def success?
|
10
|
+
true
|
11
|
+
end
|
12
|
+
|
13
|
+
def value?
|
14
|
+
false
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
18
|
+
class ValueResult < SuccessResult
|
19
|
+
attr_reader :value
|
20
|
+
|
21
|
+
def initialize(name, value)
|
22
|
+
super(name)
|
23
|
+
@value = value
|
24
|
+
end
|
25
|
+
|
26
|
+
def value?
|
27
|
+
true
|
28
|
+
end
|
29
|
+
end
|
30
|
+
|
31
|
+
class ErrorResult < Hash
|
32
|
+
def initialize
|
33
|
+
super
|
34
|
+
end
|
35
|
+
|
36
|
+
def self.err(name, value)
|
37
|
+
new.tap do |x|
|
38
|
+
x[name] = value
|
39
|
+
end
|
40
|
+
end
|
41
|
+
|
42
|
+
def scope(name)
|
43
|
+
reduce(self.class.new) do |h, kvp|
|
44
|
+
k, v = kvp
|
45
|
+
h[name.to_s+"."+k.to_s] = v
|
46
|
+
h
|
47
|
+
end
|
48
|
+
end
|
49
|
+
|
50
|
+
def success?
|
51
|
+
false
|
52
|
+
end
|
53
|
+
|
54
|
+
def value?
|
55
|
+
false
|
56
|
+
end
|
57
|
+
end
|
58
|
+
end
|
@@ -0,0 +1,56 @@
|
|
1
|
+
require "objectifier/result"
|
2
|
+
|
3
|
+
module Objectifier
|
4
|
+
class ScalarValue
|
5
|
+
attr_reader :name, :type
|
6
|
+
|
7
|
+
def initialize(name, **args)
|
8
|
+
raise ArgumentError, "name required" if name.nil?
|
9
|
+
raise ArgumentError, "type required" unless args[:type]
|
10
|
+
@name = name.to_s
|
11
|
+
@type = args[:type] # TODO: check type is valid?
|
12
|
+
@required = args.fetch(:required, true)
|
13
|
+
end
|
14
|
+
|
15
|
+
def required?
|
16
|
+
@required
|
17
|
+
end
|
18
|
+
|
19
|
+
def call(parameters)
|
20
|
+
if @required && !key_present(parameters)
|
21
|
+
ErrorResult.err(@name, "required field missing")
|
22
|
+
elsif key_present(parameters)
|
23
|
+
transform(key_value(parameters))
|
24
|
+
else
|
25
|
+
# TODO: this is not a failure...
|
26
|
+
SuccessResult.new(@name)
|
27
|
+
end
|
28
|
+
end
|
29
|
+
|
30
|
+
def pp(indent = "")
|
31
|
+
"#{indent} #{to_s}"
|
32
|
+
end
|
33
|
+
|
34
|
+
def to_s
|
35
|
+
"scalar %s - type: %s - required: %s" % [ @name, @type.to_s, @required.to_s ]
|
36
|
+
end
|
37
|
+
|
38
|
+
protected
|
39
|
+
|
40
|
+
def key_present(parameters)
|
41
|
+
parameters.has_key?(@name)
|
42
|
+
end
|
43
|
+
|
44
|
+
def key_value(parameters)
|
45
|
+
parameters.fetch(
|
46
|
+
@name,
|
47
|
+
parameters[@name]
|
48
|
+
)
|
49
|
+
end
|
50
|
+
|
51
|
+
def transform(value)
|
52
|
+
Objectifier.factories.for_type(@type).call(@name, value)
|
53
|
+
end
|
54
|
+
|
55
|
+
end
|
56
|
+
end
|
@@ -0,0 +1,26 @@
|
|
1
|
+
require "objectifier/result"
|
2
|
+
|
3
|
+
module Objectifier
|
4
|
+
class TransformerFactory
|
5
|
+
def initialize
|
6
|
+
@t = Hash.new { |h,k| raise "unknown type #{@type}" }
|
7
|
+
@t[String] = ->(name, value) { ValueResult.new(name, value.to_s) }
|
8
|
+
@t[Integer] = ->(name, value) {
|
9
|
+
begin
|
10
|
+
ValueResult.new(name, Integer(value))
|
11
|
+
rescue => e
|
12
|
+
ErrorResult.err(name, e.message)
|
13
|
+
end
|
14
|
+
}
|
15
|
+
@t[Float] = ->(name, value) { ValueResult.new(name, value.to_f) }
|
16
|
+
end
|
17
|
+
|
18
|
+
def add_type(type, transformer)
|
19
|
+
@t[type] = transformer
|
20
|
+
end
|
21
|
+
|
22
|
+
def for_type(type)
|
23
|
+
@t[type]
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
data/objectifier.gemspec
ADDED
@@ -0,0 +1,26 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require 'objectifier/version'
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = "objectifier"
|
8
|
+
spec.version = Objectifier::VERSION
|
9
|
+
spec.authors = ["Nigel Rantor"]
|
10
|
+
spec.email = ["wiggly@wiggly.org"]
|
11
|
+
|
12
|
+
spec.summary = %q{De-serialize plain hashes into real object graphs}
|
13
|
+
spec.description = %q{Customize how you de-serialise hashes into real objects.}
|
14
|
+
spec.homepage = "http://github.com/wiggly/objectifier"
|
15
|
+
spec.license = "MIT"
|
16
|
+
|
17
|
+
spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
18
|
+
spec.bindir = "exe"
|
19
|
+
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
20
|
+
spec.require_paths = ["lib"]
|
21
|
+
|
22
|
+
spec.add_development_dependency "bundler"
|
23
|
+
spec.add_development_dependency "rake"
|
24
|
+
spec.add_development_dependency "guard-rspec"
|
25
|
+
spec.add_development_dependency "simplecov"
|
26
|
+
end
|
metadata
ADDED
@@ -0,0 +1,118 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: objectifier
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Nigel Rantor
|
8
|
+
autorequire:
|
9
|
+
bindir: exe
|
10
|
+
cert_chain: []
|
11
|
+
date: 2016-10-13 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: '0'
|
20
|
+
type: :development
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ">="
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '0'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: rake
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ">="
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ">="
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: guard-rspec
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - ">="
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ">="
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: simplecov
|
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
|
+
description: Customize how you de-serialise hashes into real objects.
|
70
|
+
email:
|
71
|
+
- wiggly@wiggly.org
|
72
|
+
executables: []
|
73
|
+
extensions: []
|
74
|
+
extra_rdoc_files: []
|
75
|
+
files:
|
76
|
+
- ".gitignore"
|
77
|
+
- ".rspec"
|
78
|
+
- ".travis.yml"
|
79
|
+
- Gemfile
|
80
|
+
- Guardfile
|
81
|
+
- LICENSE.txt
|
82
|
+
- README.md
|
83
|
+
- Rakefile
|
84
|
+
- bin/console
|
85
|
+
- bin/setup
|
86
|
+
- lib/objectifier.rb
|
87
|
+
- lib/objectifier/array_value.rb
|
88
|
+
- lib/objectifier/map_value.rb
|
89
|
+
- lib/objectifier/result.rb
|
90
|
+
- lib/objectifier/scalar_value.rb
|
91
|
+
- lib/objectifier/transformer_factory.rb
|
92
|
+
- lib/objectifier/version.rb
|
93
|
+
- objectifier.gemspec
|
94
|
+
homepage: http://github.com/wiggly/objectifier
|
95
|
+
licenses:
|
96
|
+
- MIT
|
97
|
+
metadata: {}
|
98
|
+
post_install_message:
|
99
|
+
rdoc_options: []
|
100
|
+
require_paths:
|
101
|
+
- lib
|
102
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
103
|
+
requirements:
|
104
|
+
- - ">="
|
105
|
+
- !ruby/object:Gem::Version
|
106
|
+
version: '0'
|
107
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
108
|
+
requirements:
|
109
|
+
- - ">="
|
110
|
+
- !ruby/object:Gem::Version
|
111
|
+
version: '0'
|
112
|
+
requirements: []
|
113
|
+
rubyforge_project:
|
114
|
+
rubygems_version: 2.5.1
|
115
|
+
signing_key:
|
116
|
+
specification_version: 4
|
117
|
+
summary: De-serialize plain hashes into real object graphs
|
118
|
+
test_files: []
|