json_api_responders 2.6.0 → 2.7.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/test.yml +24 -0
- data/.gitignore +0 -1
- data/Gemfile.lock +72 -0
- data/json_api_responders.gemspec +2 -1
- data/lib/json_api_responders/responder/actions.rb +1 -1
- data/lib/json_api_responders/responder.rb +2 -2
- data/lib/json_api_responders/version.rb +1 -1
- data/lib/json_api_responders.rb +3 -1
- metadata +23 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ecf51675d2f2b3e3a6208800ec9f29aa601e2ebf31b33eea1127d925e6a2cb86
|
4
|
+
data.tar.gz: 69dd03066147c3beb5435c7aaa0357f41f89a69624da832a81857a7d5bda659e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1d634452083be4d39a5353ee67afcda0071bd7df540a1c86446e52ed96a342f4a9c07ed2c0805c32165fee226fa3a5ffcfd289ba5bceb825e6d209ce6084d088
|
7
|
+
data.tar.gz: a53084be6c3a5b50c0baaa43630bf0fea0fea2483c6baddc38a3165c13dc90928bae975a3e1ee8789da27d1d332ffeeee40e8261216ebad4bee75ff0f0540502
|
@@ -0,0 +1,24 @@
|
|
1
|
+
name: Test
|
2
|
+
|
3
|
+
on:
|
4
|
+
push:
|
5
|
+
branches: [ master ]
|
6
|
+
pull_request:
|
7
|
+
branches: [ master ]
|
8
|
+
|
9
|
+
jobs:
|
10
|
+
test:
|
11
|
+
name: Ruby ${{ matrix.ruby }}
|
12
|
+
runs-on: ubuntu-latest
|
13
|
+
strategy:
|
14
|
+
matrix:
|
15
|
+
ruby: [2.7, '3.0', 3.1]
|
16
|
+
|
17
|
+
steps:
|
18
|
+
- uses: actions/checkout@v3
|
19
|
+
- uses: ruby/setup-ruby@v1
|
20
|
+
with:
|
21
|
+
ruby-version: ${{ matrix.ruby }}
|
22
|
+
bundler-cache: true
|
23
|
+
- name: Run tests
|
24
|
+
run: bundle exec rake
|
data/.gitignore
CHANGED
data/Gemfile.lock
ADDED
@@ -0,0 +1,72 @@
|
|
1
|
+
PATH
|
2
|
+
remote: .
|
3
|
+
specs:
|
4
|
+
json_api_responders (2.7.0)
|
5
|
+
activemodel
|
6
|
+
|
7
|
+
GEM
|
8
|
+
remote: https://rubygems.org/
|
9
|
+
specs:
|
10
|
+
activemodel (7.0.3)
|
11
|
+
activesupport (= 7.0.3)
|
12
|
+
activesupport (7.0.3)
|
13
|
+
concurrent-ruby (~> 1.0, >= 1.0.2)
|
14
|
+
i18n (>= 1.6, < 2)
|
15
|
+
minitest (>= 5.1)
|
16
|
+
tzinfo (~> 2.0)
|
17
|
+
byebug (11.1.3)
|
18
|
+
codeclimate-test-reporter (1.0.9)
|
19
|
+
simplecov (<= 0.13)
|
20
|
+
coderay (1.1.3)
|
21
|
+
concurrent-ruby (1.1.10)
|
22
|
+
diff-lcs (1.5.0)
|
23
|
+
docile (1.1.5)
|
24
|
+
i18n (1.10.0)
|
25
|
+
concurrent-ruby (~> 1.0)
|
26
|
+
json (2.6.1)
|
27
|
+
method_source (1.0.0)
|
28
|
+
minitest (5.15.0)
|
29
|
+
pry (0.13.1)
|
30
|
+
coderay (~> 1.1)
|
31
|
+
method_source (~> 1.0)
|
32
|
+
pry-byebug (3.9.0)
|
33
|
+
byebug (~> 11.0)
|
34
|
+
pry (~> 0.13.0)
|
35
|
+
rack (2.2.3)
|
36
|
+
rake (10.5.0)
|
37
|
+
rspec (3.11.0)
|
38
|
+
rspec-core (~> 3.11.0)
|
39
|
+
rspec-expectations (~> 3.11.0)
|
40
|
+
rspec-mocks (~> 3.11.0)
|
41
|
+
rspec-core (3.11.0)
|
42
|
+
rspec-support (~> 3.11.0)
|
43
|
+
rspec-expectations (3.11.0)
|
44
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
45
|
+
rspec-support (~> 3.11.0)
|
46
|
+
rspec-mocks (3.11.1)
|
47
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
48
|
+
rspec-support (~> 3.11.0)
|
49
|
+
rspec-support (3.11.0)
|
50
|
+
simplecov (0.13.0)
|
51
|
+
docile (~> 1.1.0)
|
52
|
+
json (>= 1.8, < 3)
|
53
|
+
simplecov-html (~> 0.10.0)
|
54
|
+
simplecov-html (0.10.2)
|
55
|
+
tzinfo (2.0.4)
|
56
|
+
concurrent-ruby (~> 1.0)
|
57
|
+
|
58
|
+
PLATFORMS
|
59
|
+
ruby
|
60
|
+
|
61
|
+
DEPENDENCIES
|
62
|
+
bundler
|
63
|
+
codeclimate-test-reporter
|
64
|
+
json_api_responders!
|
65
|
+
pry-byebug
|
66
|
+
rack
|
67
|
+
rake (~> 10.0)
|
68
|
+
rspec
|
69
|
+
simplecov
|
70
|
+
|
71
|
+
BUNDLED WITH
|
72
|
+
2.3.13
|
data/json_api_responders.gemspec
CHANGED
@@ -26,7 +26,7 @@ Gem::Specification.new do |spec|
|
|
26
26
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
27
27
|
spec.require_paths = ['lib']
|
28
28
|
|
29
|
-
spec.add_development_dependency 'bundler'
|
29
|
+
spec.add_development_dependency 'bundler'
|
30
30
|
spec.add_development_dependency 'rake', '~> 10.0'
|
31
31
|
# spec.add_development_dependency 'rspec-rails'
|
32
32
|
spec.add_development_dependency 'rspec'
|
@@ -34,4 +34,5 @@ Gem::Specification.new do |spec|
|
|
34
34
|
spec.add_development_dependency 'pry-byebug'
|
35
35
|
spec.add_development_dependency 'simplecov'
|
36
36
|
spec.add_development_dependency 'codeclimate-test-reporter'
|
37
|
+
spec.add_dependency 'activemodel'
|
37
38
|
end
|
@@ -37,7 +37,7 @@ module JsonApiResponders
|
|
37
37
|
|
38
38
|
def render_error
|
39
39
|
controller.render(
|
40
|
-
render_options.merge(
|
40
|
+
**render_options.merge(
|
41
41
|
json: error_render_options,
|
42
42
|
status: error_status
|
43
43
|
)
|
@@ -66,7 +66,7 @@ module JsonApiResponders
|
|
66
66
|
errors[:errors] << { detail: on_error(:detail) } if on_error(:detail)
|
67
67
|
|
68
68
|
if resource.respond_to?(:errors)
|
69
|
-
if ActiveModel.version >= Gem::Version.new("6.1")
|
69
|
+
if ::ActiveModel.version >= Gem::Version.new("6.1")
|
70
70
|
resource.errors.each do |error|
|
71
71
|
errors[:errors] << error_response(error.attribute, error.message)
|
72
72
|
end
|
data/lib/json_api_responders.rb
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
require 'active_model'
|
2
|
+
|
1
3
|
require 'json_api_responders/version'
|
2
4
|
require 'json_api_responders/errors'
|
3
5
|
require 'json_api_responders/responder'
|
@@ -24,7 +26,7 @@ module JsonApiResponders
|
|
24
26
|
def respond_with(resource, options = {})
|
25
27
|
options = { params: params }.merge(options)
|
26
28
|
JsonApiResponders.config.check_required_options(options)
|
27
|
-
Responder.new(self, resource, options).respond!
|
29
|
+
Responder.new(self, resource, **options).respond!
|
28
30
|
end
|
29
31
|
|
30
32
|
def respond_with_error(status, detail = nil)
|
metadata
CHANGED
@@ -1,29 +1,29 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: json_api_responders
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.7.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Stanko Krtalić Rusendić
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2022-05-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- - "
|
17
|
+
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '
|
19
|
+
version: '0'
|
20
20
|
type: :development
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- - "
|
24
|
+
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: '
|
26
|
+
version: '0'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: rake
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -108,6 +108,20 @@ dependencies:
|
|
108
108
|
- - ">="
|
109
109
|
- !ruby/object:Gem::Version
|
110
110
|
version: '0'
|
111
|
+
- !ruby/object:Gem::Dependency
|
112
|
+
name: activemodel
|
113
|
+
requirement: !ruby/object:Gem::Requirement
|
114
|
+
requirements:
|
115
|
+
- - ">="
|
116
|
+
- !ruby/object:Gem::Version
|
117
|
+
version: '0'
|
118
|
+
type: :runtime
|
119
|
+
prerelease: false
|
120
|
+
version_requirements: !ruby/object:Gem::Requirement
|
121
|
+
requirements:
|
122
|
+
- - ">="
|
123
|
+
- !ruby/object:Gem::Version
|
124
|
+
version: '0'
|
111
125
|
description: Automatically respond to JSON::API requests
|
112
126
|
email:
|
113
127
|
- stanko.krtalic@gmail.com
|
@@ -116,11 +130,13 @@ extensions: []
|
|
116
130
|
extra_rdoc_files: []
|
117
131
|
files:
|
118
132
|
- ".codeclimate.yml"
|
133
|
+
- ".github/workflows/test.yml"
|
119
134
|
- ".gitignore"
|
120
135
|
- ".rspec"
|
121
136
|
- ".rubocop.yml"
|
122
137
|
- ".travis.yml"
|
123
138
|
- Gemfile
|
139
|
+
- Gemfile.lock
|
124
140
|
- README.md
|
125
141
|
- Rakefile
|
126
142
|
- bin/console
|
@@ -152,7 +168,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
152
168
|
- !ruby/object:Gem::Version
|
153
169
|
version: '0'
|
154
170
|
requirements: []
|
155
|
-
rubygems_version: 3.
|
171
|
+
rubygems_version: 3.2.3
|
156
172
|
signing_key:
|
157
173
|
specification_version: 4
|
158
174
|
summary: Automatically respond to JSON::API requests
|