openstax_api 9.3.0 → 9.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/openstax/api/engine.rb +0 -2
- data/lib/openstax/api/roar.rb +6 -3
- data/lib/openstax/api/version.rb +1 -1
- metadata +25 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6edbd981e494d9f1063ba9d150596c629c7d0bf3908f87809664a6ce18befa2f
|
4
|
+
data.tar.gz: 35a521253e0bc888a538e28aeaaccac1b5380fbb9529cd6a8a202b540d2ec48e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 14638e9706ece06c415252c5765fd334da5ac00e04ab6489c289bb606ed647adc48430bae0be3df93531c1c39e699e702207eeb7a3ee654a0460177cfb39e48c
|
7
|
+
data.tar.gz: 37e430223b7aef6665c9cb4f9065cef1f41e90cf6dc67795dc29cc04fb49c354e23cb0c0105ddb751de472b26dc58b86378194d54b1594861542ba4879909270
|
data/lib/openstax/api/engine.rb
CHANGED
@@ -13,8 +13,6 @@ module OpenStax
|
|
13
13
|
class Engine < ::Rails::Engine
|
14
14
|
isolate_namespace OpenStax::Api
|
15
15
|
|
16
|
-
config.autoload_paths += Dir[config.root.join('app', 'representers', '{**}')]
|
17
|
-
|
18
16
|
config.generators do |g|
|
19
17
|
g.test_framework :rspec, fixture: false
|
20
18
|
g.fixture_replacement :factory_bot, dir: 'spec/factories'
|
data/lib/openstax/api/roar.rb
CHANGED
@@ -151,7 +151,10 @@ module OpenStax
|
|
151
151
|
|
152
152
|
case errors
|
153
153
|
when ActiveModel::Errors, Lev::BetterActiveModelErrors
|
154
|
-
hash[:errors] = errors.map do |
|
154
|
+
hash[:errors] = errors.map do |error|
|
155
|
+
attribute = error.attribute
|
156
|
+
message = error.message
|
157
|
+
|
155
158
|
{
|
156
159
|
code: "#{attribute.to_s}_#{message.to_s.gsub(/[\s-]/, '_').gsub(/[^\w]/, '')}",
|
157
160
|
message: errors.full_message(attribute, message)
|
@@ -163,8 +166,8 @@ module OpenStax
|
|
163
166
|
end
|
164
167
|
else
|
165
168
|
hash[:errors] = [errors].flatten.map do |error|
|
166
|
-
error.is_a?(Hash) ? error :
|
167
|
-
|
169
|
+
error.is_a?(Hash) ? error :
|
170
|
+
{ code: error.to_s.underscore, message: error.to_s.humanize }
|
168
171
|
end
|
169
172
|
end
|
170
173
|
|
data/lib/openstax/api/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: openstax_api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 9.
|
4
|
+
version: 9.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dante Soares
|
@@ -9,22 +9,28 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2021-02-01 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rails
|
16
16
|
requirement: !ruby/object:Gem::Requirement
|
17
17
|
requirements:
|
18
|
-
- - "
|
18
|
+
- - ">="
|
19
19
|
- !ruby/object:Gem::Version
|
20
20
|
version: '5.2'
|
21
|
+
- - "<"
|
22
|
+
- !ruby/object:Gem::Version
|
23
|
+
version: '7'
|
21
24
|
type: :runtime
|
22
25
|
prerelease: false
|
23
26
|
version_requirements: !ruby/object:Gem::Requirement
|
24
27
|
requirements:
|
25
|
-
- - "
|
28
|
+
- - ">="
|
26
29
|
- !ruby/object:Gem::Version
|
27
30
|
version: '5.2'
|
31
|
+
- - "<"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '7'
|
28
34
|
- !ruby/object:Gem::Dependency
|
29
35
|
name: representable
|
30
36
|
requirement: !ruby/object:Gem::Requirement
|
@@ -165,6 +171,20 @@ dependencies:
|
|
165
171
|
- - ">="
|
166
172
|
- !ruby/object:Gem::Version
|
167
173
|
version: '0'
|
174
|
+
- !ruby/object:Gem::Dependency
|
175
|
+
name: listen
|
176
|
+
requirement: !ruby/object:Gem::Requirement
|
177
|
+
requirements:
|
178
|
+
- - ">="
|
179
|
+
- !ruby/object:Gem::Version
|
180
|
+
version: '0'
|
181
|
+
type: :development
|
182
|
+
prerelease: false
|
183
|
+
version_requirements: !ruby/object:Gem::Requirement
|
184
|
+
requirements:
|
185
|
+
- - ">="
|
186
|
+
- !ruby/object:Gem::Version
|
187
|
+
version: '0'
|
168
188
|
- !ruby/object:Gem::Dependency
|
169
189
|
name: sqlite3
|
170
190
|
requirement: !ruby/object:Gem::Requirement
|
@@ -282,7 +302,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
282
302
|
- !ruby/object:Gem::Version
|
283
303
|
version: '0'
|
284
304
|
requirements: []
|
285
|
-
rubygems_version: 3.
|
305
|
+
rubygems_version: 3.2.7
|
286
306
|
signing_key:
|
287
307
|
specification_version: 4
|
288
308
|
summary: API utilities for OpenStax products and tools.
|