jat 0.0.1 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +7 -0
- data/README.md +21 -0
- data/jat.gemspec +37 -0
- data/lib/jat/attribute.rb +85 -0
- data/lib/jat/config.rb +38 -0
- data/lib/jat/plugins/_activerecord_preloads/_activerecord_preloads.rb +29 -0
- data/lib/jat/plugins/_activerecord_preloads/lib/preloader.rb +89 -0
- data/lib/jat/plugins/_json_api_activerecord/_json_api_activerecord.rb +22 -0
- data/lib/jat/plugins/_json_api_activerecord/lib/preloads.rb +84 -0
- data/lib/jat/plugins/_preloads/_preloads.rb +53 -0
- data/lib/jat/plugins/_preloads/lib/format_user_preloads.rb +52 -0
- data/lib/jat/plugins/_preloads/lib/preloads_with_path.rb +78 -0
- data/lib/jat/plugins/cache/cache.rb +39 -0
- data/lib/jat/plugins/camel_lower/camel_lower.rb +18 -0
- data/lib/jat/plugins/json_api/json_api.rb +207 -0
- data/lib/jat/plugins/json_api/lib/construct_traversal_map.rb +91 -0
- data/lib/jat/plugins/json_api/lib/map.rb +54 -0
- data/lib/jat/plugins/json_api/lib/params/fields/parse.rb +27 -0
- data/lib/jat/plugins/json_api/lib/params/fields/validate.rb +55 -0
- data/lib/jat/plugins/json_api/lib/params/fields.rb +23 -0
- data/lib/jat/plugins/json_api/lib/params/include/parse.rb +55 -0
- data/lib/jat/plugins/json_api/lib/params/include/validate.rb +29 -0
- data/lib/jat/plugins/json_api/lib/params/include.rb +49 -0
- data/lib/jat/plugins/json_api/lib/presenters/document_links_presenter.rb +48 -0
- data/lib/jat/plugins/json_api/lib/presenters/document_meta_presenter.rb +48 -0
- data/lib/jat/plugins/json_api/lib/presenters/jsonapi_presenter.rb +48 -0
- data/lib/jat/plugins/json_api/lib/presenters/links_presenter.rb +48 -0
- data/lib/jat/plugins/json_api/lib/presenters/meta_presenter.rb +48 -0
- data/lib/jat/plugins/json_api/lib/presenters/relationship_links_presenter.rb +53 -0
- data/lib/jat/plugins/json_api/lib/presenters/relationship_meta_presenter.rb +53 -0
- data/lib/jat/plugins/json_api/lib/response.rb +239 -0
- data/lib/jat/plugins/json_api/lib/traversal_map.rb +34 -0
- data/lib/jat/plugins/simple_api/lib/construct_traversal_map.rb +45 -0
- data/lib/jat/plugins/simple_api/lib/map.rb +29 -0
- data/lib/jat/plugins/simple_api/lib/params/parse.rb +68 -0
- data/lib/jat/plugins/simple_api/lib/response.rb +134 -0
- data/lib/jat/plugins/simple_api/simple_api.rb +65 -0
- data/lib/jat/plugins/to_str/to_str.rb +44 -0
- data/lib/jat/plugins.rb +39 -0
- data/lib/jat/presenter.rb +51 -0
- data/lib/jat/utils/enum_deep_dup.rb +29 -0
- data/lib/jat/utils/enum_deep_freeze.rb +19 -0
- data/lib/jat.rb +66 -144
- data/test/lib/jat/attribute_test.rb +142 -0
- data/test/lib/jat/config_test.rb +57 -0
- data/test/lib/jat/plugins/_activerecord_preloads/_activerecord_preloads_test.rb +40 -0
- data/test/lib/jat/plugins/_activerecord_preloads/lib/preloader_test.rb +98 -0
- data/test/lib/jat/plugins/_json_api_activerecord/_json_api_activerecord_test.rb +29 -0
- data/test/lib/jat/plugins/_json_api_activerecord/lib/preloads_test.rb +191 -0
- data/test/lib/jat/plugins/_preloads/_preloads_test.rb +68 -0
- data/test/lib/jat/plugins/_preloads/lib/format_user_preloads_test.rb +47 -0
- data/test/lib/jat/plugins/_preloads/lib/preloads_with_path_test.rb +33 -0
- data/test/lib/jat/plugins/cache/cache_test.rb +82 -0
- data/test/lib/jat/plugins/camel_lower/camel_lower_test.rb +78 -0
- data/test/lib/jat/plugins/json_api/json_api_test.rb +154 -0
- data/test/lib/jat/plugins/json_api/lib/construct_traversal_map_test.rb +119 -0
- data/test/lib/jat/plugins/json_api/lib/map_test.rb +117 -0
- data/test/lib/jat/plugins/json_api/lib/params/fields/parse_test.rb +24 -0
- data/test/lib/jat/plugins/json_api/lib/params/fields/validate_test.rb +47 -0
- data/test/lib/jat/plugins/json_api/lib/params/fields_test.rb +37 -0
- data/test/lib/jat/plugins/json_api/lib/params/include/parse_test.rb +46 -0
- data/test/lib/jat/plugins/json_api/lib/params/include/validate_test.rb +51 -0
- data/test/lib/jat/plugins/json_api/lib/params/include_test.rb +41 -0
- data/test/lib/jat/plugins/json_api/lib/presenters/document_links_presenter_test.rb +69 -0
- data/test/lib/jat/plugins/json_api/lib/presenters/document_meta_presenter_test.rb +69 -0
- data/test/lib/jat/plugins/json_api/lib/presenters/jsonapi_presenter_test.rb +69 -0
- data/test/lib/jat/plugins/json_api/lib/presenters/links_presenter_test.rb +69 -0
- data/test/lib/jat/plugins/json_api/lib/presenters/meta_presenter_test.rb +69 -0
- data/test/lib/jat/plugins/json_api/lib/presenters/relationship_links_presenter_test.rb +75 -0
- data/test/lib/jat/plugins/json_api/lib/presenters/relationship_meta_presenter_test.rb +75 -0
- data/test/lib/jat/plugins/json_api/lib/response_test.rb +489 -0
- data/test/lib/jat/plugins/json_api/lib/traversal_map_test.rb +58 -0
- data/test/lib/jat/plugins/simple_api/lib/construct_traversal_map_test.rb +100 -0
- data/test/lib/jat/plugins/simple_api/lib/map_test.rb +56 -0
- data/test/lib/jat/plugins/simple_api/lib/params/parse_test.rb +71 -0
- data/test/lib/jat/plugins/simple_api/lib/response_test.rb +342 -0
- data/test/lib/jat/plugins/simple_api/simple_api_test.rb +81 -0
- data/test/lib/jat/plugins/to_str/to_str_test.rb +52 -0
- data/test/lib/jat/presenter_test.rb +61 -0
- data/test/lib/jat/utils/enum_deep_dup_test.rb +31 -0
- data/test/lib/jat/utils/enum_deep_freeze_test.rb +28 -0
- data/test/lib/jat_test.rb +120 -0
- data/test/lib/plugin_test.rb +49 -0
- data/test/support/activerecord.rb +24 -0
- data/test/test_helper.rb +16 -0
- data/test/test_plugin.rb +59 -0
- metadata +240 -11
@@ -0,0 +1,120 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "test_helper"
|
4
|
+
|
5
|
+
describe Jat do
|
6
|
+
let(:jat_class) { Class.new(Jat) }
|
7
|
+
|
8
|
+
describe ".plugin" do
|
9
|
+
it "raises error when trying to load not a symbol or module" do
|
10
|
+
plugin = "TEST_PLUGIN"
|
11
|
+
error = assert_raises(Jat::Error) { jat_class.plugin(plugin) }
|
12
|
+
|
13
|
+
error_message = "Plugin class must be a Symbol or a Module, #{plugin.inspect} given"
|
14
|
+
assert_equal error_message, error.message
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
18
|
+
describe ".config" do
|
19
|
+
it "returns config object" do
|
20
|
+
config = jat_class.config
|
21
|
+
assert_equal jat_class::Config, config.class
|
22
|
+
end
|
23
|
+
end
|
24
|
+
|
25
|
+
describe ".inherited" do
|
26
|
+
let(:parent) { jat_class }
|
27
|
+
|
28
|
+
it "inherits config class with same options" do
|
29
|
+
parent.config[:foo] = :bar
|
30
|
+
child = Class.new(parent)
|
31
|
+
|
32
|
+
assert_equal parent::Config, child::Config.superclass
|
33
|
+
assert_equal :bar, child.config[:foo]
|
34
|
+
end
|
35
|
+
|
36
|
+
it "inherits attributes" do
|
37
|
+
parent.attribute(:foo) { :bar }
|
38
|
+
child = Class.new(parent)
|
39
|
+
|
40
|
+
assert_equal parent::Attribute, child::Attribute.superclass
|
41
|
+
assert child.attributes[:foo]
|
42
|
+
end
|
43
|
+
|
44
|
+
it "inherits presenter" do
|
45
|
+
child = Class.new(parent)
|
46
|
+
assert_equal parent::Presenter, child::Presenter.superclass
|
47
|
+
end
|
48
|
+
end
|
49
|
+
|
50
|
+
describe ".call" do
|
51
|
+
it "returns self" do
|
52
|
+
assert_equal jat_class, jat_class.call
|
53
|
+
end
|
54
|
+
end
|
55
|
+
|
56
|
+
describe ".to_h" do
|
57
|
+
it "raises error that we should add some response generation plugin" do
|
58
|
+
error = assert_raises(Jat::Error) { jat_class.to_h(nil) }
|
59
|
+
|
60
|
+
error_message = "Method #to_h must be implemented by plugin"
|
61
|
+
assert_equal error_message, error.message
|
62
|
+
end
|
63
|
+
|
64
|
+
it "initializes serializer instance with provided attributes" do
|
65
|
+
jat_class.expects(:new).with("obj", "context")
|
66
|
+
jat_class.to_h("obj", "context")
|
67
|
+
end
|
68
|
+
|
69
|
+
it "adds empty hash context when context not provided" do
|
70
|
+
jat_class.expects(:new).with("obj", {})
|
71
|
+
jat_class.to_h("obj")
|
72
|
+
end
|
73
|
+
end
|
74
|
+
|
75
|
+
describe ".attributes" do
|
76
|
+
it "initializes new attributes hash" do
|
77
|
+
assert_equal({}, jat_class.attributes)
|
78
|
+
assert_same jat_class.attributes, jat_class.instance_variable_get(:@attributes)
|
79
|
+
end
|
80
|
+
end
|
81
|
+
|
82
|
+
describe ".attribute" do
|
83
|
+
it "adds new attribute to attributes hash" do
|
84
|
+
attribute = jat_class.attribute :foo
|
85
|
+
assert_equal jat_class.attributes[:foo], attribute
|
86
|
+
end
|
87
|
+
|
88
|
+
it "adds method to Presenter class" do
|
89
|
+
jat_class.attribute :foo
|
90
|
+
assert jat_class::Presenter.method_defined?(:foo)
|
91
|
+
end
|
92
|
+
end
|
93
|
+
|
94
|
+
describe "#initialize" do
|
95
|
+
it "initializes object and context attributes" do
|
96
|
+
jat = jat_class.new("obj", "context")
|
97
|
+
|
98
|
+
assert_equal "obj", jat.object
|
99
|
+
assert_equal "context", jat.context
|
100
|
+
end
|
101
|
+
end
|
102
|
+
|
103
|
+
describe "#to_h" do
|
104
|
+
it "raises error" do
|
105
|
+
jat = jat_class.new(nil, nil)
|
106
|
+
|
107
|
+
error = assert_raises(Jat::Error) { jat.to_h }
|
108
|
+
error_message = "Method #to_h must be implemented by plugin"
|
109
|
+
assert_equal error_message, error.message
|
110
|
+
end
|
111
|
+
end
|
112
|
+
|
113
|
+
describe "#config" do
|
114
|
+
it "returns self class config" do
|
115
|
+
jat = jat_class.new(nil, nil)
|
116
|
+
|
117
|
+
assert_same jat.config, jat_class.config
|
118
|
+
end
|
119
|
+
end
|
120
|
+
end
|
@@ -0,0 +1,49 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "test_helper"
|
4
|
+
require "test_plugin"
|
5
|
+
|
6
|
+
describe "plugin system" do
|
7
|
+
describe "Jat.plugin" do
|
8
|
+
let(:jat_class) { Class.new(Jat) }
|
9
|
+
let(:components) { [jat_class, jat_class::Attribute, jat_class::Config, jat_class::Presenter] }
|
10
|
+
|
11
|
+
before do
|
12
|
+
components.each do |component|
|
13
|
+
component::InstanceMethods.send(:define_method, :foo) { :foo }
|
14
|
+
component::ClassMethods.send(:define_method, :foo) { :foo }
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
18
|
+
after do
|
19
|
+
components.each do |component|
|
20
|
+
component::InstanceMethods.send(:undef_method, :foo)
|
21
|
+
component::ClassMethods.send(:undef_method, :foo)
|
22
|
+
end
|
23
|
+
end
|
24
|
+
|
25
|
+
it "allows the plugin to override base methods of core classes" do
|
26
|
+
components.each do |component|
|
27
|
+
assert_equal :foo, component.foo
|
28
|
+
assert_equal :foo, component.allocate.foo
|
29
|
+
end
|
30
|
+
|
31
|
+
jat_class.plugin(TestPlugin)
|
32
|
+
|
33
|
+
components.each do |component|
|
34
|
+
assert_equal :plugin_foo, component.foo
|
35
|
+
assert_equal :plugin_foo, component.allocate.foo
|
36
|
+
end
|
37
|
+
end
|
38
|
+
|
39
|
+
it "loads dependencies before loading plugin" do
|
40
|
+
jat_class.plugin(TestPlugin)
|
41
|
+
assert_equal :foo, jat_class.config[:before_load]
|
42
|
+
end
|
43
|
+
|
44
|
+
it "after_loads after loading plugin" do
|
45
|
+
jat_class.plugin(TestPlugin)
|
46
|
+
assert_equal :plugin_foo, jat_class.config[:after_load]
|
47
|
+
end
|
48
|
+
end
|
49
|
+
end
|
@@ -0,0 +1,24 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "active_record"
|
4
|
+
|
5
|
+
conn = ActiveRecord::Base.establish_connection(adapter: "sqlite3", database: ":memory:").connection
|
6
|
+
|
7
|
+
conn.create_table(:users) do |t|
|
8
|
+
t.string :name
|
9
|
+
end
|
10
|
+
|
11
|
+
conn.create_table(:comments) do |t|
|
12
|
+
t.belongs_to :user, index: false
|
13
|
+
t.text :text
|
14
|
+
end
|
15
|
+
|
16
|
+
module AR
|
17
|
+
class User < ActiveRecord::Base
|
18
|
+
has_many :comments
|
19
|
+
end
|
20
|
+
|
21
|
+
class Comment < ActiveRecord::Base
|
22
|
+
belongs_to :user
|
23
|
+
end
|
24
|
+
end
|
data/test/test_helper.rb
ADDED
@@ -0,0 +1,16 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "simplecov"
|
4
|
+
SimpleCov.start
|
5
|
+
|
6
|
+
if RUBY_VERSION >= "2.7"
|
7
|
+
Warning[:deprecated] = true
|
8
|
+
Warning[:experimental] = true
|
9
|
+
end
|
10
|
+
|
11
|
+
require "bundler/setup"
|
12
|
+
require "minitest/autorun"
|
13
|
+
require "mocha/minitest"
|
14
|
+
require "pry-byebug"
|
15
|
+
|
16
|
+
require_relative "../lib/jat"
|
data/test/test_plugin.rb
ADDED
@@ -0,0 +1,59 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module TestPlugin
|
4
|
+
def self.before_load(jat_class, *)
|
5
|
+
jat_class.config[:before_load] = jat_class.foo
|
6
|
+
end
|
7
|
+
|
8
|
+
def self.after_load(jat_class, *)
|
9
|
+
jat_class.config[:after_load] = jat_class.foo
|
10
|
+
end
|
11
|
+
|
12
|
+
module ClassMethods
|
13
|
+
def foo
|
14
|
+
:plugin_foo
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
18
|
+
module InstanceMethods
|
19
|
+
def foo
|
20
|
+
:plugin_foo
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
24
|
+
module AttributeClassMethods
|
25
|
+
def foo
|
26
|
+
:plugin_foo
|
27
|
+
end
|
28
|
+
end
|
29
|
+
|
30
|
+
module AttributeMethods
|
31
|
+
def foo
|
32
|
+
:plugin_foo
|
33
|
+
end
|
34
|
+
end
|
35
|
+
|
36
|
+
module ConfigClassMethods
|
37
|
+
def foo
|
38
|
+
:plugin_foo
|
39
|
+
end
|
40
|
+
end
|
41
|
+
|
42
|
+
module ConfigMethods
|
43
|
+
def foo
|
44
|
+
:plugin_foo
|
45
|
+
end
|
46
|
+
end
|
47
|
+
|
48
|
+
module PresenterClassMethods
|
49
|
+
def foo
|
50
|
+
:plugin_foo
|
51
|
+
end
|
52
|
+
end
|
53
|
+
|
54
|
+
module PresenterMethods
|
55
|
+
def foo
|
56
|
+
:plugin_foo
|
57
|
+
end
|
58
|
+
end
|
59
|
+
end
|
metadata
CHANGED
@@ -1,28 +1,214 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jat
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
|
-
-
|
7
|
+
- Andrey Glushkov
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
12
|
-
dependencies:
|
13
|
-
|
14
|
-
|
15
|
-
|
11
|
+
date: 2021-09-30 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: minitest
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '5.14'
|
20
|
+
type: :development
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '5.14'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: mocha
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '1.12'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '1.12'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: rake
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '13.0'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '13.0'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: standard
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - "~>"
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '1.0'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - "~>"
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '1.0'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: simplecov
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - "~>"
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '0.21'
|
76
|
+
type: :development
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - "~>"
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '0.21'
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: activerecord
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - "~>"
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '6.0'
|
90
|
+
type: :development
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - "~>"
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '6.0'
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
name: sqlite3
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - "~>"
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: '1.4'
|
104
|
+
type: :development
|
105
|
+
prerelease: false
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - "~>"
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: '1.4'
|
111
|
+
description: |
|
112
|
+
The JAT serializer allows you to generate a JSON response based on the fields requested by the client.
|
113
|
+
Besides, it avoids manually adding includes and solves N+1 problems on its own.
|
16
114
|
email: aglushkov@shakuro.com
|
17
115
|
executables: []
|
18
116
|
extensions: []
|
19
117
|
extra_rdoc_files: []
|
20
118
|
files:
|
119
|
+
- CHANGELOG.md
|
120
|
+
- README.md
|
121
|
+
- jat.gemspec
|
21
122
|
- lib/jat.rb
|
123
|
+
- lib/jat/attribute.rb
|
124
|
+
- lib/jat/config.rb
|
125
|
+
- lib/jat/plugins.rb
|
126
|
+
- lib/jat/plugins/_activerecord_preloads/_activerecord_preloads.rb
|
127
|
+
- lib/jat/plugins/_activerecord_preloads/lib/preloader.rb
|
128
|
+
- lib/jat/plugins/_json_api_activerecord/_json_api_activerecord.rb
|
129
|
+
- lib/jat/plugins/_json_api_activerecord/lib/preloads.rb
|
130
|
+
- lib/jat/plugins/_preloads/_preloads.rb
|
131
|
+
- lib/jat/plugins/_preloads/lib/format_user_preloads.rb
|
132
|
+
- lib/jat/plugins/_preloads/lib/preloads_with_path.rb
|
133
|
+
- lib/jat/plugins/cache/cache.rb
|
134
|
+
- lib/jat/plugins/camel_lower/camel_lower.rb
|
135
|
+
- lib/jat/plugins/json_api/json_api.rb
|
136
|
+
- lib/jat/plugins/json_api/lib/construct_traversal_map.rb
|
137
|
+
- lib/jat/plugins/json_api/lib/map.rb
|
138
|
+
- lib/jat/plugins/json_api/lib/params/fields.rb
|
139
|
+
- lib/jat/plugins/json_api/lib/params/fields/parse.rb
|
140
|
+
- lib/jat/plugins/json_api/lib/params/fields/validate.rb
|
141
|
+
- lib/jat/plugins/json_api/lib/params/include.rb
|
142
|
+
- lib/jat/plugins/json_api/lib/params/include/parse.rb
|
143
|
+
- lib/jat/plugins/json_api/lib/params/include/validate.rb
|
144
|
+
- lib/jat/plugins/json_api/lib/presenters/document_links_presenter.rb
|
145
|
+
- lib/jat/plugins/json_api/lib/presenters/document_meta_presenter.rb
|
146
|
+
- lib/jat/plugins/json_api/lib/presenters/jsonapi_presenter.rb
|
147
|
+
- lib/jat/plugins/json_api/lib/presenters/links_presenter.rb
|
148
|
+
- lib/jat/plugins/json_api/lib/presenters/meta_presenter.rb
|
149
|
+
- lib/jat/plugins/json_api/lib/presenters/relationship_links_presenter.rb
|
150
|
+
- lib/jat/plugins/json_api/lib/presenters/relationship_meta_presenter.rb
|
151
|
+
- lib/jat/plugins/json_api/lib/response.rb
|
152
|
+
- lib/jat/plugins/json_api/lib/traversal_map.rb
|
153
|
+
- lib/jat/plugins/simple_api/lib/construct_traversal_map.rb
|
154
|
+
- lib/jat/plugins/simple_api/lib/map.rb
|
155
|
+
- lib/jat/plugins/simple_api/lib/params/parse.rb
|
156
|
+
- lib/jat/plugins/simple_api/lib/response.rb
|
157
|
+
- lib/jat/plugins/simple_api/simple_api.rb
|
158
|
+
- lib/jat/plugins/to_str/to_str.rb
|
159
|
+
- lib/jat/presenter.rb
|
160
|
+
- lib/jat/utils/enum_deep_dup.rb
|
161
|
+
- lib/jat/utils/enum_deep_freeze.rb
|
162
|
+
- test/lib/jat/attribute_test.rb
|
163
|
+
- test/lib/jat/config_test.rb
|
164
|
+
- test/lib/jat/plugins/_activerecord_preloads/_activerecord_preloads_test.rb
|
165
|
+
- test/lib/jat/plugins/_activerecord_preloads/lib/preloader_test.rb
|
166
|
+
- test/lib/jat/plugins/_json_api_activerecord/_json_api_activerecord_test.rb
|
167
|
+
- test/lib/jat/plugins/_json_api_activerecord/lib/preloads_test.rb
|
168
|
+
- test/lib/jat/plugins/_preloads/_preloads_test.rb
|
169
|
+
- test/lib/jat/plugins/_preloads/lib/format_user_preloads_test.rb
|
170
|
+
- test/lib/jat/plugins/_preloads/lib/preloads_with_path_test.rb
|
171
|
+
- test/lib/jat/plugins/cache/cache_test.rb
|
172
|
+
- test/lib/jat/plugins/camel_lower/camel_lower_test.rb
|
173
|
+
- test/lib/jat/plugins/json_api/json_api_test.rb
|
174
|
+
- test/lib/jat/plugins/json_api/lib/construct_traversal_map_test.rb
|
175
|
+
- test/lib/jat/plugins/json_api/lib/map_test.rb
|
176
|
+
- test/lib/jat/plugins/json_api/lib/params/fields/parse_test.rb
|
177
|
+
- test/lib/jat/plugins/json_api/lib/params/fields/validate_test.rb
|
178
|
+
- test/lib/jat/plugins/json_api/lib/params/fields_test.rb
|
179
|
+
- test/lib/jat/plugins/json_api/lib/params/include/parse_test.rb
|
180
|
+
- test/lib/jat/plugins/json_api/lib/params/include/validate_test.rb
|
181
|
+
- test/lib/jat/plugins/json_api/lib/params/include_test.rb
|
182
|
+
- test/lib/jat/plugins/json_api/lib/presenters/document_links_presenter_test.rb
|
183
|
+
- test/lib/jat/plugins/json_api/lib/presenters/document_meta_presenter_test.rb
|
184
|
+
- test/lib/jat/plugins/json_api/lib/presenters/jsonapi_presenter_test.rb
|
185
|
+
- test/lib/jat/plugins/json_api/lib/presenters/links_presenter_test.rb
|
186
|
+
- test/lib/jat/plugins/json_api/lib/presenters/meta_presenter_test.rb
|
187
|
+
- test/lib/jat/plugins/json_api/lib/presenters/relationship_links_presenter_test.rb
|
188
|
+
- test/lib/jat/plugins/json_api/lib/presenters/relationship_meta_presenter_test.rb
|
189
|
+
- test/lib/jat/plugins/json_api/lib/response_test.rb
|
190
|
+
- test/lib/jat/plugins/json_api/lib/traversal_map_test.rb
|
191
|
+
- test/lib/jat/plugins/simple_api/lib/construct_traversal_map_test.rb
|
192
|
+
- test/lib/jat/plugins/simple_api/lib/map_test.rb
|
193
|
+
- test/lib/jat/plugins/simple_api/lib/params/parse_test.rb
|
194
|
+
- test/lib/jat/plugins/simple_api/lib/response_test.rb
|
195
|
+
- test/lib/jat/plugins/simple_api/simple_api_test.rb
|
196
|
+
- test/lib/jat/plugins/to_str/to_str_test.rb
|
197
|
+
- test/lib/jat/presenter_test.rb
|
198
|
+
- test/lib/jat/utils/enum_deep_dup_test.rb
|
199
|
+
- test/lib/jat/utils/enum_deep_freeze_test.rb
|
200
|
+
- test/lib/jat_test.rb
|
201
|
+
- test/lib/plugin_test.rb
|
202
|
+
- test/support/activerecord.rb
|
203
|
+
- test/test_helper.rb
|
204
|
+
- test/test_plugin.rb
|
22
205
|
homepage: https://github.com/aglushkov/jat
|
23
206
|
licenses:
|
24
207
|
- MIT
|
25
|
-
metadata:
|
208
|
+
metadata:
|
209
|
+
bug_tracker_uri: https://github.com/aglushkov/jat/issues
|
210
|
+
changelog_uri: https://github.com/aglushkov/jat/blob/master/CHANGELOG.md
|
211
|
+
source_code_uri: https://github.com/aglushkov/jat
|
26
212
|
post_install_message:
|
27
213
|
rdoc_options: []
|
28
214
|
require_paths:
|
@@ -38,8 +224,51 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
38
224
|
- !ruby/object:Gem::Version
|
39
225
|
version: '0'
|
40
226
|
requirements: []
|
41
|
-
rubygems_version: 3.
|
227
|
+
rubygems_version: 3.2.1
|
42
228
|
signing_key:
|
43
229
|
specification_version: 4
|
44
|
-
summary: JSON API
|
45
|
-
test_files:
|
230
|
+
summary: JSON API TOOLKIT
|
231
|
+
test_files:
|
232
|
+
- test/lib/jat/attribute_test.rb
|
233
|
+
- test/lib/jat/config_test.rb
|
234
|
+
- test/lib/jat/plugins/_activerecord_preloads/_activerecord_preloads_test.rb
|
235
|
+
- test/lib/jat/plugins/_activerecord_preloads/lib/preloader_test.rb
|
236
|
+
- test/lib/jat/plugins/_json_api_activerecord/_json_api_activerecord_test.rb
|
237
|
+
- test/lib/jat/plugins/_json_api_activerecord/lib/preloads_test.rb
|
238
|
+
- test/lib/jat/plugins/_preloads/_preloads_test.rb
|
239
|
+
- test/lib/jat/plugins/_preloads/lib/format_user_preloads_test.rb
|
240
|
+
- test/lib/jat/plugins/_preloads/lib/preloads_with_path_test.rb
|
241
|
+
- test/lib/jat/plugins/cache/cache_test.rb
|
242
|
+
- test/lib/jat/plugins/camel_lower/camel_lower_test.rb
|
243
|
+
- test/lib/jat/plugins/json_api/json_api_test.rb
|
244
|
+
- test/lib/jat/plugins/json_api/lib/construct_traversal_map_test.rb
|
245
|
+
- test/lib/jat/plugins/json_api/lib/map_test.rb
|
246
|
+
- test/lib/jat/plugins/json_api/lib/params/fields/parse_test.rb
|
247
|
+
- test/lib/jat/plugins/json_api/lib/params/fields/validate_test.rb
|
248
|
+
- test/lib/jat/plugins/json_api/lib/params/fields_test.rb
|
249
|
+
- test/lib/jat/plugins/json_api/lib/params/include/parse_test.rb
|
250
|
+
- test/lib/jat/plugins/json_api/lib/params/include/validate_test.rb
|
251
|
+
- test/lib/jat/plugins/json_api/lib/params/include_test.rb
|
252
|
+
- test/lib/jat/plugins/json_api/lib/presenters/document_links_presenter_test.rb
|
253
|
+
- test/lib/jat/plugins/json_api/lib/presenters/document_meta_presenter_test.rb
|
254
|
+
- test/lib/jat/plugins/json_api/lib/presenters/jsonapi_presenter_test.rb
|
255
|
+
- test/lib/jat/plugins/json_api/lib/presenters/links_presenter_test.rb
|
256
|
+
- test/lib/jat/plugins/json_api/lib/presenters/meta_presenter_test.rb
|
257
|
+
- test/lib/jat/plugins/json_api/lib/presenters/relationship_links_presenter_test.rb
|
258
|
+
- test/lib/jat/plugins/json_api/lib/presenters/relationship_meta_presenter_test.rb
|
259
|
+
- test/lib/jat/plugins/json_api/lib/response_test.rb
|
260
|
+
- test/lib/jat/plugins/json_api/lib/traversal_map_test.rb
|
261
|
+
- test/lib/jat/plugins/simple_api/lib/construct_traversal_map_test.rb
|
262
|
+
- test/lib/jat/plugins/simple_api/lib/map_test.rb
|
263
|
+
- test/lib/jat/plugins/simple_api/lib/params/parse_test.rb
|
264
|
+
- test/lib/jat/plugins/simple_api/lib/response_test.rb
|
265
|
+
- test/lib/jat/plugins/simple_api/simple_api_test.rb
|
266
|
+
- test/lib/jat/plugins/to_str/to_str_test.rb
|
267
|
+
- test/lib/jat/presenter_test.rb
|
268
|
+
- test/lib/jat/utils/enum_deep_dup_test.rb
|
269
|
+
- test/lib/jat/utils/enum_deep_freeze_test.rb
|
270
|
+
- test/lib/jat_test.rb
|
271
|
+
- test/lib/plugin_test.rb
|
272
|
+
- test/support/activerecord.rb
|
273
|
+
- test/test_helper.rb
|
274
|
+
- test/test_plugin.rb
|