normalizr_ruby 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 +10 -0
- data/.travis.yml +4 -0
- data/Gemfile +4 -0
- data/LICENSE.txt +21 -0
- data/README.md +185 -0
- data/Rakefile +10 -0
- data/bin/console +14 -0
- data/bin/setup +8 -0
- data/lib/generators/normalizr_ruby/schema/USAGE +8 -0
- data/lib/generators/normalizr_ruby/schema/schema_generator.rb +11 -0
- data/lib/generators/normalizr_ruby/schema/templates/schema.rb +5 -0
- data/lib/normalizr_ruby/converter.rb +50 -0
- data/lib/normalizr_ruby/key_transform.rb +45 -0
- data/lib/normalizr_ruby/normalizable.rb +15 -0
- data/lib/normalizr_ruby/schema.rb +49 -0
- data/lib/normalizr_ruby/version.rb +3 -0
- data/lib/normalizr_ruby.rb +15 -0
- data/normalizr_ruby.gemspec +31 -0
- metadata +192 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: ad4f4f6adc8e503d8fca73d97b300924fb13b19a
|
4
|
+
data.tar.gz: 5e5260114c387d049b7375aadc4e8fc6b8d57f17
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: f5790d6d59dbe7bb08ee27c6985748521cc58fd8b639fb12c6c10eb63739264a7b2176eb757541b8ddbe2d722d276daed64ceb7a43760206bd36803a30599d64
|
7
|
+
data.tar.gz: 4d88c5d43d4e2789aeea86dec7dbf3291f0095a94e41c9634c98c0a1ace337a9e0fd9c50282aeb72218a55b13036135c80ef79f1872d609686a50cbae8c18256
|
data/.gitignore
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) 2016 shinya takahashi
|
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,185 @@
|
|
1
|
+
# NormalizrRuby
|
2
|
+
[![Build Status](https://travis-ci.org/oreshinya/normalizr_ruby.svg?branch=master)](https://travis-ci.org/oreshinya/normalizr_ruby)
|
3
|
+
|
4
|
+
[Normalizr](https://github.com/paularmstrong/normalizr) format JSON generator.
|
5
|
+
|
6
|
+
## Installation
|
7
|
+
|
8
|
+
```ruby
|
9
|
+
gem "normalizr_ruby"
|
10
|
+
```
|
11
|
+
|
12
|
+
## Getting Started
|
13
|
+
|
14
|
+
Include `NormalizrRuby::Normalizable` in your `ApplicationController`:
|
15
|
+
|
16
|
+
```ruby
|
17
|
+
class ApplicationController < ActionController::API
|
18
|
+
include NormalizrRuby::Normalizable
|
19
|
+
end
|
20
|
+
```
|
21
|
+
|
22
|
+
Create a new normalizr's schema:
|
23
|
+
|
24
|
+
```
|
25
|
+
bundle exec rails g normalizr_ruby:schema user
|
26
|
+
```
|
27
|
+
|
28
|
+
This will generate a schema in `app/schemas/user_schema.rb` for your `User` model:
|
29
|
+
|
30
|
+
```ruby
|
31
|
+
class UserSchema < NormalizrRuby::Schema
|
32
|
+
attribute :id
|
33
|
+
end
|
34
|
+
```
|
35
|
+
|
36
|
+
You can customize it like this:
|
37
|
+
|
38
|
+
```ruby
|
39
|
+
class UserSchema < NormalizrRuby::Schema
|
40
|
+
attribute :id
|
41
|
+
attribute :first_name
|
42
|
+
attribute :last_name
|
43
|
+
attribute :full_name, if: :has_last_name?
|
44
|
+
association :team
|
45
|
+
association :comments, schema: CustomCommentSchema, if: :has_last_name?
|
46
|
+
|
47
|
+
def full_name
|
48
|
+
"#{object.first_name} #{object.last_name}"
|
49
|
+
end
|
50
|
+
|
51
|
+
def has_last_name?
|
52
|
+
object.last_name.present?
|
53
|
+
end
|
54
|
+
end
|
55
|
+
```
|
56
|
+
|
57
|
+
Render json like this:
|
58
|
+
|
59
|
+
```ruby
|
60
|
+
class UsersController < Applicationcontroller
|
61
|
+
def index
|
62
|
+
users = User.all
|
63
|
+
render json: users
|
64
|
+
end
|
65
|
+
end
|
66
|
+
```
|
67
|
+
|
68
|
+
You will get response like this:
|
69
|
+
|
70
|
+
```json
|
71
|
+
{
|
72
|
+
"result": [1, 2],
|
73
|
+
"entities": {
|
74
|
+
"teams": {
|
75
|
+
"1": { "id": 1, "name": "Team A" }
|
76
|
+
},
|
77
|
+
"users": {
|
78
|
+
"1": { "id": 1, "firstName": "Michael", "lastName": "Jackson", "fullName": "Michael Jackson", "team": 1, "comments": [2, 4] },
|
79
|
+
"2": { "id": 2, "firstName": "Tom", "lastName": null, "team": 1 }
|
80
|
+
},
|
81
|
+
"comments": {
|
82
|
+
"2": { "id": 2, "body": "Hello :)" },
|
83
|
+
"4": { "id": 4, "body": "World ;)" }
|
84
|
+
}
|
85
|
+
}
|
86
|
+
}
|
87
|
+
```
|
88
|
+
|
89
|
+
## Documents
|
90
|
+
|
91
|
+
### Schema
|
92
|
+
#### `::attribute(key, options)`
|
93
|
+
Add an attribute to normalized entity.
|
94
|
+
`if` option can make an attribute conditional, and it takes a symbol of a method name on the schema.
|
95
|
+
|
96
|
+
#### `::association(key, options)`
|
97
|
+
Add an association to normalized entity, and add associated entity to entities.
|
98
|
+
`if` option can make an association conditional, and it takes a symbol of a method name on the schema.
|
99
|
+
`schema` option can make specifying a schema.
|
100
|
+
|
101
|
+
#### `#object`
|
102
|
+
You can refer unnormalized resource.
|
103
|
+
|
104
|
+
#### `#props`
|
105
|
+
You can refer arbitray options.
|
106
|
+
|
107
|
+
For example:
|
108
|
+
|
109
|
+
```ruby
|
110
|
+
class UserSchema < NormalizrRuby::Schema
|
111
|
+
attribute :id
|
112
|
+
attribute :hoge
|
113
|
+
|
114
|
+
def hoge
|
115
|
+
props[:arbitray_option]
|
116
|
+
end
|
117
|
+
end
|
118
|
+
|
119
|
+
def UsersController < Applicationcontroller
|
120
|
+
def show
|
121
|
+
user = User.find(params[:id])
|
122
|
+
render json: user, normalizr: { arbitray_option: 1 }
|
123
|
+
end
|
124
|
+
end
|
125
|
+
```
|
126
|
+
|
127
|
+
#### `#context`
|
128
|
+
You can refer any values in all schemas
|
129
|
+
|
130
|
+
For example:
|
131
|
+
|
132
|
+
```ruby
|
133
|
+
class UserSchema < NormalizrRuby::Schema
|
134
|
+
attribute :id
|
135
|
+
attribute :is_current_user
|
136
|
+
|
137
|
+
def is_current_user
|
138
|
+
context[:current_user].id == object.id
|
139
|
+
end
|
140
|
+
end
|
141
|
+
```
|
142
|
+
|
143
|
+
### Render options
|
144
|
+
|
145
|
+
You can pass `normalizr`, and can pass any options as `props`.
|
146
|
+
But `schema` option can make specifying a schema.
|
147
|
+
|
148
|
+
```ruby
|
149
|
+
render json: user, normalizr: { schema: CustomUserSchema, hoge: 1, fuga: 2 }
|
150
|
+
```
|
151
|
+
|
152
|
+
### How to use context
|
153
|
+
|
154
|
+
You have to implement `normalizr_context` in any controller.
|
155
|
+
|
156
|
+
```ruby
|
157
|
+
class ApplicationController < ActionController::API
|
158
|
+
include NormalizrRuby::Normalizable
|
159
|
+
|
160
|
+
def normalizr_context
|
161
|
+
{ current_user: User.first }
|
162
|
+
end
|
163
|
+
end
|
164
|
+
```
|
165
|
+
|
166
|
+
### Configuration
|
167
|
+
|
168
|
+
You can specify key transform in your `config/initializers/normalizr_ruby.rb`.
|
169
|
+
|
170
|
+
```ruby
|
171
|
+
NormalizrRuby.config.key_transform = :camel_lower # default
|
172
|
+
```
|
173
|
+
|
174
|
+
| Option | Result |
|
175
|
+
|----|----|
|
176
|
+
| `:camel` | ExampleKey |
|
177
|
+
| `:camel_lower` | exampleKey |
|
178
|
+
| `:dash` | example-key |
|
179
|
+
| `:unaltered` | the original, unaltered key |
|
180
|
+
| `:underscore` | example_key |
|
181
|
+
| `nil` | use the default |
|
182
|
+
|
183
|
+
## License
|
184
|
+
|
185
|
+
MIT
|
data/Rakefile
ADDED
data/bin/console
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require "bundler/setup"
|
4
|
+
require "normalizr_ruby"
|
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
@@ -0,0 +1,11 @@
|
|
1
|
+
module NormalizrRuby
|
2
|
+
module Generators
|
3
|
+
class SchemaGenerator < ::Rails::Generators::NamedBase
|
4
|
+
source_root File.expand_path(File.join(File.dirname(__FILE__), 'templates'))
|
5
|
+
|
6
|
+
def create_schema
|
7
|
+
template 'schema.rb', File.join('app/schemas', class_path, "#{file_name}_schema.rb")
|
8
|
+
end
|
9
|
+
end
|
10
|
+
end
|
11
|
+
end
|
@@ -0,0 +1,50 @@
|
|
1
|
+
module NormalizrRuby
|
2
|
+
class Converter
|
3
|
+
class SchemaNotFound < StandardError; end
|
4
|
+
|
5
|
+
def self.get_schema_class(resource)
|
6
|
+
resource_class_name = resource.class.name
|
7
|
+
schema_class = "#{resource_class_name}Schema".safe_constantize
|
8
|
+
if schema_class.nil?
|
9
|
+
raise SchemaNotFound, "#{resource_class_name} is not found."
|
10
|
+
end
|
11
|
+
schema_class
|
12
|
+
end
|
13
|
+
|
14
|
+
def initialize(context)
|
15
|
+
@context = context
|
16
|
+
@entities = {}
|
17
|
+
@result = nil
|
18
|
+
end
|
19
|
+
|
20
|
+
def normalize(resource, options)
|
21
|
+
opts = options.presence || {}
|
22
|
+
@result = walk(resource, opts)
|
23
|
+
key_transform = NormalizrRuby.config.key_transform
|
24
|
+
normalized_hash = { result: @result, entities: @entities }
|
25
|
+
KeyTransform.send(key_transform, normalized_hash)
|
26
|
+
rescue SchemaNotFound => e
|
27
|
+
resource
|
28
|
+
end
|
29
|
+
|
30
|
+
def walk(resource, options)
|
31
|
+
result = nil
|
32
|
+
if resource.respond_to?(:map)
|
33
|
+
result = resource.map {|r| walk(r, options)}
|
34
|
+
else
|
35
|
+
schema_class = options[:schema].presence || self.class.get_schema_class(resource)
|
36
|
+
schema = schema_class.new(resource, @context, options.except(:schema))
|
37
|
+
result = schema.object.id
|
38
|
+
entity_key = schema.object.class.name.pluralize.to_sym
|
39
|
+
hash = schema.attributes
|
40
|
+
schema.associations.each do |association, assoc_options|
|
41
|
+
association_result = walk(schema.object.send(association), assoc_options)
|
42
|
+
hash[association] = association_result
|
43
|
+
end
|
44
|
+
@entities[entity_key] ||= {}
|
45
|
+
@entities[entity_key][result] = hash
|
46
|
+
end
|
47
|
+
result
|
48
|
+
end
|
49
|
+
end
|
50
|
+
end
|
@@ -0,0 +1,45 @@
|
|
1
|
+
module NormalizrRuby
|
2
|
+
module KeyTransform
|
3
|
+
module_function
|
4
|
+
|
5
|
+
def camel(value)
|
6
|
+
case value
|
7
|
+
when Hash then value.deep_transform_keys! { |key| camel(key) }
|
8
|
+
when Symbol then camel(value.to_s).to_sym
|
9
|
+
when String then value.underscore.camelize
|
10
|
+
else value
|
11
|
+
end
|
12
|
+
end
|
13
|
+
|
14
|
+
def camel_lower(value)
|
15
|
+
case value
|
16
|
+
when Hash then value.deep_transform_keys! { |key| camel_lower(key) }
|
17
|
+
when Symbol then camel_lower(value.to_s).to_sym
|
18
|
+
when String then value.underscore.camelize(:lower)
|
19
|
+
else value
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
23
|
+
def dash(value)
|
24
|
+
case value
|
25
|
+
when Hash then value.deep_transform_keys! { |key| dash(key) }
|
26
|
+
when Symbol then dash(value.to_s).to_sym
|
27
|
+
when String then value.underscore.dasherize
|
28
|
+
else value
|
29
|
+
end
|
30
|
+
end
|
31
|
+
|
32
|
+
def underscore(value)
|
33
|
+
case value
|
34
|
+
when Hash then value.deep_transform_keys! { |key| underscore(key) }
|
35
|
+
when Symbol then underscore(value.to_s).to_sym
|
36
|
+
when String then value.underscore
|
37
|
+
else value
|
38
|
+
end
|
39
|
+
end
|
40
|
+
|
41
|
+
def unaltered(value)
|
42
|
+
value
|
43
|
+
end
|
44
|
+
end
|
45
|
+
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
module NormalizrRuby
|
2
|
+
module Normalizable
|
3
|
+
extend ActiveSupport::Concern
|
4
|
+
include ActionController::Renderers
|
5
|
+
|
6
|
+
[:_render_option_json, :_render_with_renderer_json].each do |renderer_method|
|
7
|
+
define_method renderer_method do |resource, options|
|
8
|
+
context = respond_to?(:normalizr_context) ? normalizr_context : nil
|
9
|
+
converter = NormalizrRuby::Converter.new(context)
|
10
|
+
normalized_resource = converter.normalize(resource, options[:normalizr])
|
11
|
+
super(normalized_resource, options.except(:normalizr))
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
@@ -0,0 +1,49 @@
|
|
1
|
+
module NormalizrRuby
|
2
|
+
class Schema
|
3
|
+
attr_reader :object, :context, :props
|
4
|
+
|
5
|
+
class_attribute :_attributes
|
6
|
+
class_attribute :_associations
|
7
|
+
|
8
|
+
self._attributes ||= {}
|
9
|
+
self._associations ||= {}
|
10
|
+
|
11
|
+
def self.inherited(child)
|
12
|
+
super
|
13
|
+
child._attributes = _attributes.dup
|
14
|
+
child._associations = _associations.dup
|
15
|
+
end
|
16
|
+
|
17
|
+
def self.attribute(key, options = {})
|
18
|
+
_attributes[key] = options;
|
19
|
+
end
|
20
|
+
|
21
|
+
def self.association(key, options = {})
|
22
|
+
_associations[key] = options;
|
23
|
+
end
|
24
|
+
|
25
|
+
def initialize(object, context, props)
|
26
|
+
@object = object
|
27
|
+
@context = context
|
28
|
+
@props = props
|
29
|
+
end
|
30
|
+
|
31
|
+
def attributes
|
32
|
+
hash = {}
|
33
|
+
self.class._attributes.each do |key, options|
|
34
|
+
next if options[:if] && !send(options[:if])
|
35
|
+
hash[key] = respond_to?(key) ? send(key) : object.send(key)
|
36
|
+
end
|
37
|
+
hash
|
38
|
+
end
|
39
|
+
|
40
|
+
def associations
|
41
|
+
hash = {}
|
42
|
+
self.class._associations.each do |key, options|
|
43
|
+
next if options[:if] && !send(options[:if])
|
44
|
+
hash[key] = options.except(:if)
|
45
|
+
end
|
46
|
+
hash
|
47
|
+
end
|
48
|
+
end
|
49
|
+
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
require "active_support"
|
2
|
+
require "action_controller"
|
3
|
+
|
4
|
+
module NormalizrRuby
|
5
|
+
include ActiveSupport::Configurable
|
6
|
+
config_accessor :key_transform do
|
7
|
+
:camel_lower
|
8
|
+
end
|
9
|
+
end
|
10
|
+
|
11
|
+
require "normalizr_ruby/version"
|
12
|
+
require "normalizr_ruby/key_transform"
|
13
|
+
require "normalizr_ruby/schema"
|
14
|
+
require "normalizr_ruby/converter"
|
15
|
+
require "normalizr_ruby/normalizable"
|
@@ -0,0 +1,31 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require 'normalizr_ruby/version'
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = "normalizr_ruby"
|
8
|
+
spec.version = NormalizrRuby::VERSION
|
9
|
+
spec.authors = ["shinya takahashi"]
|
10
|
+
spec.email = ["s.takahashi313@gmail.com"]
|
11
|
+
|
12
|
+
spec.summary = "Normalizr format JSON response generator"
|
13
|
+
spec.description = "Normalizr format JSON response generator"
|
14
|
+
spec.homepage = "https://github.com/oreshinya/normalizr_ruby"
|
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_dependency "activesupport", [">= 5.0", "< 6"]
|
23
|
+
spec.add_dependency "actionpack", [">= 5.0", "< 6"]
|
24
|
+
|
25
|
+
spec.add_development_dependency "bundler", "~> 1.11"
|
26
|
+
spec.add_development_dependency "rake", "~> 10.0"
|
27
|
+
spec.add_development_dependency "activerecord", [">= 5.0", "< 6"]
|
28
|
+
spec.add_development_dependency "sqlite3"
|
29
|
+
spec.add_development_dependency "minitest"
|
30
|
+
spec.add_development_dependency "minitest-power_assert"
|
31
|
+
end
|
metadata
ADDED
@@ -0,0 +1,192 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: normalizr_ruby
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- shinya takahashi
|
8
|
+
autorequire:
|
9
|
+
bindir: exe
|
10
|
+
cert_chain: []
|
11
|
+
date: 2016-08-24 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: activesupport
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ">="
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '5.0'
|
20
|
+
- - "<"
|
21
|
+
- !ruby/object:Gem::Version
|
22
|
+
version: '6'
|
23
|
+
type: :runtime
|
24
|
+
prerelease: false
|
25
|
+
version_requirements: !ruby/object:Gem::Requirement
|
26
|
+
requirements:
|
27
|
+
- - ">="
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: '5.0'
|
30
|
+
- - "<"
|
31
|
+
- !ruby/object:Gem::Version
|
32
|
+
version: '6'
|
33
|
+
- !ruby/object:Gem::Dependency
|
34
|
+
name: actionpack
|
35
|
+
requirement: !ruby/object:Gem::Requirement
|
36
|
+
requirements:
|
37
|
+
- - ">="
|
38
|
+
- !ruby/object:Gem::Version
|
39
|
+
version: '5.0'
|
40
|
+
- - "<"
|
41
|
+
- !ruby/object:Gem::Version
|
42
|
+
version: '6'
|
43
|
+
type: :runtime
|
44
|
+
prerelease: false
|
45
|
+
version_requirements: !ruby/object:Gem::Requirement
|
46
|
+
requirements:
|
47
|
+
- - ">="
|
48
|
+
- !ruby/object:Gem::Version
|
49
|
+
version: '5.0'
|
50
|
+
- - "<"
|
51
|
+
- !ruby/object:Gem::Version
|
52
|
+
version: '6'
|
53
|
+
- !ruby/object:Gem::Dependency
|
54
|
+
name: bundler
|
55
|
+
requirement: !ruby/object:Gem::Requirement
|
56
|
+
requirements:
|
57
|
+
- - "~>"
|
58
|
+
- !ruby/object:Gem::Version
|
59
|
+
version: '1.11'
|
60
|
+
type: :development
|
61
|
+
prerelease: false
|
62
|
+
version_requirements: !ruby/object:Gem::Requirement
|
63
|
+
requirements:
|
64
|
+
- - "~>"
|
65
|
+
- !ruby/object:Gem::Version
|
66
|
+
version: '1.11'
|
67
|
+
- !ruby/object:Gem::Dependency
|
68
|
+
name: rake
|
69
|
+
requirement: !ruby/object:Gem::Requirement
|
70
|
+
requirements:
|
71
|
+
- - "~>"
|
72
|
+
- !ruby/object:Gem::Version
|
73
|
+
version: '10.0'
|
74
|
+
type: :development
|
75
|
+
prerelease: false
|
76
|
+
version_requirements: !ruby/object:Gem::Requirement
|
77
|
+
requirements:
|
78
|
+
- - "~>"
|
79
|
+
- !ruby/object:Gem::Version
|
80
|
+
version: '10.0'
|
81
|
+
- !ruby/object:Gem::Dependency
|
82
|
+
name: activerecord
|
83
|
+
requirement: !ruby/object:Gem::Requirement
|
84
|
+
requirements:
|
85
|
+
- - ">="
|
86
|
+
- !ruby/object:Gem::Version
|
87
|
+
version: '5.0'
|
88
|
+
- - "<"
|
89
|
+
- !ruby/object:Gem::Version
|
90
|
+
version: '6'
|
91
|
+
type: :development
|
92
|
+
prerelease: false
|
93
|
+
version_requirements: !ruby/object:Gem::Requirement
|
94
|
+
requirements:
|
95
|
+
- - ">="
|
96
|
+
- !ruby/object:Gem::Version
|
97
|
+
version: '5.0'
|
98
|
+
- - "<"
|
99
|
+
- !ruby/object:Gem::Version
|
100
|
+
version: '6'
|
101
|
+
- !ruby/object:Gem::Dependency
|
102
|
+
name: sqlite3
|
103
|
+
requirement: !ruby/object:Gem::Requirement
|
104
|
+
requirements:
|
105
|
+
- - ">="
|
106
|
+
- !ruby/object:Gem::Version
|
107
|
+
version: '0'
|
108
|
+
type: :development
|
109
|
+
prerelease: false
|
110
|
+
version_requirements: !ruby/object:Gem::Requirement
|
111
|
+
requirements:
|
112
|
+
- - ">="
|
113
|
+
- !ruby/object:Gem::Version
|
114
|
+
version: '0'
|
115
|
+
- !ruby/object:Gem::Dependency
|
116
|
+
name: minitest
|
117
|
+
requirement: !ruby/object:Gem::Requirement
|
118
|
+
requirements:
|
119
|
+
- - ">="
|
120
|
+
- !ruby/object:Gem::Version
|
121
|
+
version: '0'
|
122
|
+
type: :development
|
123
|
+
prerelease: false
|
124
|
+
version_requirements: !ruby/object:Gem::Requirement
|
125
|
+
requirements:
|
126
|
+
- - ">="
|
127
|
+
- !ruby/object:Gem::Version
|
128
|
+
version: '0'
|
129
|
+
- !ruby/object:Gem::Dependency
|
130
|
+
name: minitest-power_assert
|
131
|
+
requirement: !ruby/object:Gem::Requirement
|
132
|
+
requirements:
|
133
|
+
- - ">="
|
134
|
+
- !ruby/object:Gem::Version
|
135
|
+
version: '0'
|
136
|
+
type: :development
|
137
|
+
prerelease: false
|
138
|
+
version_requirements: !ruby/object:Gem::Requirement
|
139
|
+
requirements:
|
140
|
+
- - ">="
|
141
|
+
- !ruby/object:Gem::Version
|
142
|
+
version: '0'
|
143
|
+
description: Normalizr format JSON response generator
|
144
|
+
email:
|
145
|
+
- s.takahashi313@gmail.com
|
146
|
+
executables: []
|
147
|
+
extensions: []
|
148
|
+
extra_rdoc_files: []
|
149
|
+
files:
|
150
|
+
- ".gitignore"
|
151
|
+
- ".travis.yml"
|
152
|
+
- Gemfile
|
153
|
+
- LICENSE.txt
|
154
|
+
- README.md
|
155
|
+
- Rakefile
|
156
|
+
- bin/console
|
157
|
+
- bin/setup
|
158
|
+
- lib/generators/normalizr_ruby/schema/USAGE
|
159
|
+
- lib/generators/normalizr_ruby/schema/schema_generator.rb
|
160
|
+
- lib/generators/normalizr_ruby/schema/templates/schema.rb
|
161
|
+
- lib/normalizr_ruby.rb
|
162
|
+
- lib/normalizr_ruby/converter.rb
|
163
|
+
- lib/normalizr_ruby/key_transform.rb
|
164
|
+
- lib/normalizr_ruby/normalizable.rb
|
165
|
+
- lib/normalizr_ruby/schema.rb
|
166
|
+
- lib/normalizr_ruby/version.rb
|
167
|
+
- normalizr_ruby.gemspec
|
168
|
+
homepage: https://github.com/oreshinya/normalizr_ruby
|
169
|
+
licenses:
|
170
|
+
- MIT
|
171
|
+
metadata: {}
|
172
|
+
post_install_message:
|
173
|
+
rdoc_options: []
|
174
|
+
require_paths:
|
175
|
+
- lib
|
176
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
177
|
+
requirements:
|
178
|
+
- - ">="
|
179
|
+
- !ruby/object:Gem::Version
|
180
|
+
version: '0'
|
181
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
182
|
+
requirements:
|
183
|
+
- - ">="
|
184
|
+
- !ruby/object:Gem::Version
|
185
|
+
version: '0'
|
186
|
+
requirements: []
|
187
|
+
rubyforge_project:
|
188
|
+
rubygems_version: 2.5.1
|
189
|
+
signing_key:
|
190
|
+
specification_version: 4
|
191
|
+
summary: Normalizr format JSON response generator
|
192
|
+
test_files: []
|