jsonapi.rb 1.4.4 → 1.4.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 71f3acfa93d3beb62249295caf3eb1281bb3a26f
4
- data.tar.gz: 55736764463a1fc310d5ec1a83d6f29dcb4c06ef
3
+ metadata.gz: 850595e9b5bf8986638858acb52e4a64f4882dab
4
+ data.tar.gz: ff03ece83d7e7a167a8ff58014e010d59eeeb224
5
5
  SHA512:
6
- metadata.gz: 94ecad8c622c9d085b834855ab494eeffc25366c8ec107c74234e8874b5f3243635c6ac9f80b220fae689101735501c94c621fec6b5e3f82cf8f46a73a072f86
7
- data.tar.gz: a0d360b993b759726a8f90ccefcca9d4ca2312a089a7d354fc96b1c8ac9bc722cbea507e8538f9a612aafd55c8bb83e9fefee07639500db11e52da96c4030e6f
6
+ metadata.gz: d5ab4e7832394a0ba81c95d3995afb1795915629273cfc00a65f573405a98935f943f3b6a0637e7200e0f34f983681b87facf71c48eac28f207a0fe5e3dc2d81
7
+ data.tar.gz: b70da22e0a92a35333ea9d82ee63ae639c529c8eb751597ab43c0ecfe25ab0956070df89a0930ecce8b62a64a23a889f5db3bb52a6e410ac83e3137682529033
@@ -2,6 +2,11 @@ inherit_gem:
2
2
  rubocop-rails_config:
3
3
  - config/rails.yml
4
4
 
5
+ require: rubocop-performance
6
+
7
+ Performance:
8
+ Enabled: true
9
+
5
10
  Rails:
6
11
  Enabled: true
7
12
 
@@ -8,7 +8,7 @@ GIT
8
8
  PATH
9
9
  remote: .
10
10
  specs:
11
- jsonapi.rb (1.4.4)
11
+ jsonapi.rb (1.4.5)
12
12
  fast_jsonapi (~> 1.5)
13
13
  rack
14
14
  ransack
@@ -16,43 +16,43 @@ PATH
16
16
  GEM
17
17
  remote: https://rubygems.org/
18
18
  specs:
19
- actioncable (5.2.2)
20
- actionpack (= 5.2.2)
19
+ actioncable (5.2.3)
20
+ actionpack (= 5.2.3)
21
21
  nio4r (~> 2.0)
22
22
  websocket-driver (>= 0.6.1)
23
- actionmailer (5.2.2)
24
- actionpack (= 5.2.2)
25
- actionview (= 5.2.2)
26
- activejob (= 5.2.2)
23
+ actionmailer (5.2.3)
24
+ actionpack (= 5.2.3)
25
+ actionview (= 5.2.3)
26
+ activejob (= 5.2.3)
27
27
  mail (~> 2.5, >= 2.5.4)
28
28
  rails-dom-testing (~> 2.0)
29
- actionpack (5.2.2)
30
- actionview (= 5.2.2)
31
- activesupport (= 5.2.2)
29
+ actionpack (5.2.3)
30
+ actionview (= 5.2.3)
31
+ activesupport (= 5.2.3)
32
32
  rack (~> 2.0)
33
33
  rack-test (>= 0.6.3)
34
34
  rails-dom-testing (~> 2.0)
35
35
  rails-html-sanitizer (~> 1.0, >= 1.0.2)
36
- actionview (5.2.2)
37
- activesupport (= 5.2.2)
36
+ actionview (5.2.3)
37
+ activesupport (= 5.2.3)
38
38
  builder (~> 3.1)
39
39
  erubi (~> 1.4)
40
40
  rails-dom-testing (~> 2.0)
41
41
  rails-html-sanitizer (~> 1.0, >= 1.0.3)
42
- activejob (5.2.2)
43
- activesupport (= 5.2.2)
42
+ activejob (5.2.3)
43
+ activesupport (= 5.2.3)
44
44
  globalid (>= 0.3.6)
45
- activemodel (5.2.2)
46
- activesupport (= 5.2.2)
47
- activerecord (5.2.2)
48
- activemodel (= 5.2.2)
49
- activesupport (= 5.2.2)
45
+ activemodel (5.2.3)
46
+ activesupport (= 5.2.3)
47
+ activerecord (5.2.3)
48
+ activemodel (= 5.2.3)
49
+ activesupport (= 5.2.3)
50
50
  arel (>= 9.0)
51
- activestorage (5.2.2)
52
- actionpack (= 5.2.2)
53
- activerecord (= 5.2.2)
51
+ activestorage (5.2.3)
52
+ actionpack (= 5.2.3)
53
+ activerecord (= 5.2.3)
54
54
  marcel (~> 0.3.1)
55
- activesupport (5.2.2)
55
+ activesupport (5.2.3)
56
56
  concurrent-ruby (~> 1.0, >= 1.0.2)
57
57
  i18n (>= 0.7, < 2)
58
58
  minitest (~> 5.1)
@@ -60,20 +60,20 @@ GEM
60
60
  arel (9.0.0)
61
61
  ast (2.4.0)
62
62
  builder (3.2.3)
63
- concurrent-ruby (1.1.4)
63
+ concurrent-ruby (1.1.5)
64
64
  crass (1.0.4)
65
65
  diff-lcs (1.3)
66
66
  docile (1.3.1)
67
67
  erubi (1.8.0)
68
68
  fast_jsonapi (1.5)
69
69
  activesupport (>= 4.2)
70
- ffaker (2.10.0)
70
+ ffaker (2.11.0)
71
71
  globalid (0.4.2)
72
72
  activesupport (>= 4.2.0)
73
- i18n (1.5.3)
73
+ i18n (1.6.0)
74
74
  concurrent-ruby (~> 1.0)
75
75
  jaro_winkler (1.5.2)
76
- json (2.1.0)
76
+ json (2.2.0)
77
77
  loofah (2.2.3)
78
78
  crass (~> 1.0.2)
79
79
  nokogiri (>= 1.5.9)
@@ -87,36 +87,36 @@ GEM
87
87
  mini_portile2 (2.4.0)
88
88
  minitest (5.11.3)
89
89
  nio4r (2.3.1)
90
- nokogiri (1.10.1)
90
+ nokogiri (1.10.3)
91
91
  mini_portile2 (~> 2.4.0)
92
- parallel (1.13.0)
93
- parser (2.6.0.0)
92
+ parallel (1.17.0)
93
+ parser (2.6.2.1)
94
94
  ast (~> 2.4.0)
95
- powerpack (0.1.2)
96
- rack (2.0.6)
95
+ psych (3.1.0)
96
+ rack (2.0.7)
97
97
  rack-test (1.1.0)
98
98
  rack (>= 1.0, < 3)
99
- rails (5.2.2)
100
- actioncable (= 5.2.2)
101
- actionmailer (= 5.2.2)
102
- actionpack (= 5.2.2)
103
- actionview (= 5.2.2)
104
- activejob (= 5.2.2)
105
- activemodel (= 5.2.2)
106
- activerecord (= 5.2.2)
107
- activestorage (= 5.2.2)
108
- activesupport (= 5.2.2)
99
+ rails (5.2.3)
100
+ actioncable (= 5.2.3)
101
+ actionmailer (= 5.2.3)
102
+ actionpack (= 5.2.3)
103
+ actionview (= 5.2.3)
104
+ activejob (= 5.2.3)
105
+ activemodel (= 5.2.3)
106
+ activerecord (= 5.2.3)
107
+ activestorage (= 5.2.3)
108
+ activesupport (= 5.2.3)
109
109
  bundler (>= 1.3.0)
110
- railties (= 5.2.2)
110
+ railties (= 5.2.3)
111
111
  sprockets-rails (>= 2.0.0)
112
112
  rails-dom-testing (2.0.3)
113
113
  activesupport (>= 4.2.0)
114
114
  nokogiri (>= 1.6)
115
115
  rails-html-sanitizer (1.0.4)
116
116
  loofah (~> 2.2, >= 2.2.2)
117
- railties (5.2.2)
118
- actionpack (= 5.2.2)
119
- activesupport (= 5.2.2)
117
+ railties (5.2.3)
118
+ actionpack (= 5.2.3)
119
+ activesupport (= 5.2.3)
120
120
  method_source
121
121
  rake (>= 0.8.7)
122
122
  thor (>= 0.19.0, < 2.0)
@@ -133,7 +133,7 @@ GEM
133
133
  rspec-mocks (~> 3.8.0)
134
134
  rspec-core (3.8.0)
135
135
  rspec-support (~> 3.8.0)
136
- rspec-expectations (3.8.2)
136
+ rspec-expectations (3.8.3)
137
137
  diff-lcs (>= 1.2.0, < 2.0)
138
138
  rspec-support (~> 3.8.0)
139
139
  rspec-mocks (3.8.0)
@@ -148,17 +148,19 @@ GEM
148
148
  rspec-mocks (~> 3.8.0)
149
149
  rspec-support (~> 3.8.0)
150
150
  rspec-support (3.8.0)
151
- rubocop (0.64.0)
151
+ rubocop (0.67.2)
152
152
  jaro_winkler (~> 1.5.1)
153
153
  parallel (~> 1.10)
154
154
  parser (>= 2.5, != 2.5.1.1)
155
- powerpack (~> 0.1)
155
+ psych (>= 3.1.0)
156
156
  rainbow (>= 2.2.2, < 4.0)
157
157
  ruby-progressbar (~> 1.7)
158
- unicode-display_width (~> 1.4.0)
159
- rubocop-rails_config (0.4.3)
158
+ unicode-display_width (>= 1.4.0, < 1.6)
159
+ rubocop-performance (1.1.0)
160
+ rubocop (>= 0.67.0)
161
+ rubocop-rails_config (0.5.1)
160
162
  railties (>= 3.0)
161
- rubocop (~> 0.58)
163
+ rubocop (~> 0.60)
162
164
  ruby-progressbar (1.10.0)
163
165
  simplecov (0.16.1)
164
166
  docile (~> 1.1)
@@ -177,11 +179,11 @@ GEM
177
179
  thread_safe (0.3.6)
178
180
  tzinfo (1.2.5)
179
181
  thread_safe (~> 0.1)
180
- unicode-display_width (1.4.1)
182
+ unicode-display_width (1.5.0)
181
183
  websocket-driver (0.7.0)
182
184
  websocket-extensions (>= 0.1.0)
183
185
  websocket-extensions (0.1.3)
184
- yard (0.9.18)
186
+ yard (0.9.19)
185
187
  yardstick (0.9.9)
186
188
  yard (~> 0.8, >= 0.8.7.2)
187
189
 
@@ -193,9 +195,10 @@ DEPENDENCIES
193
195
  ffaker
194
196
  jsonapi-rspec!
195
197
  jsonapi.rb!
196
- rails (~> 5)
198
+ rails
197
199
  rspec (~> 3.0)
198
200
  rspec-rails
201
+ rubocop-performance
199
202
  rubocop-rails_config
200
203
  simplecov
201
204
  sqlite3 (~> 1.3.6)
data/README.md CHANGED
@@ -216,7 +216,7 @@ class MyController < ActionController::Base
216
216
  private
217
217
 
218
218
  # Overwrite/whitelist the includes
219
- def jsonapi_include(resources)
219
+ def jsonapi_include
220
220
  super & ['wanted_attribute']
221
221
  end
222
222
  end
@@ -35,4 +35,5 @@ Gem::Specification.new do |spec|
35
35
  spec.add_development_dependency 'yardstick'
36
36
  spec.add_development_dependency 'rubocop-rails_config'
37
37
  spec.add_development_dependency 'simplecov'
38
+ spec.add_development_dependency 'rubocop-performance'
38
39
  end
@@ -19,7 +19,7 @@ module JSONAPI
19
19
  code = error_hash[:error] unless error_hash[:error].is_a?(Hash)
20
20
  code ||= error_hash[:message] || :invalid
21
21
  # `parameterize` separator arguments are different on Rails 4 vs 5...
22
- code.to_s.delete("''").parameterize.gsub('-', '_')
22
+ code.to_s.delete("''").parameterize.tr('-', '_')
23
23
  end
24
24
 
25
25
  attribute :detail do |object, params|
@@ -32,7 +32,9 @@ module JSONAPI
32
32
  error_key, nil, error_hash[:error]
33
33
  )
34
34
  elsif error_hash[:error].present?
35
- message = errors_object.generate_message(error_key, error_hash[:error])
35
+ message = errors_object.generate_message(
36
+ error_key, error_hash[:error], error_hash
37
+ )
36
38
  else
37
39
  message = error_hash[:message]
38
40
  end
@@ -1,3 +1,3 @@
1
1
  module JSONAPI
2
- VERSION = '1.4.4'
2
+ VERSION = '1.4.5'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jsonapi.rb
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.4.4
4
+ version: 1.4.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stas Suscov
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-03-17 00:00:00.000000000 Z
11
+ date: 2019-04-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: fast_jsonapi
@@ -192,6 +192,20 @@ dependencies:
192
192
  - - ">="
193
193
  - !ruby/object:Gem::Version
194
194
  version: '0'
195
+ - !ruby/object:Gem::Dependency
196
+ name: rubocop-performance
197
+ requirement: !ruby/object:Gem::Requirement
198
+ requirements:
199
+ - - ">="
200
+ - !ruby/object:Gem::Version
201
+ version: '0'
202
+ type: :development
203
+ prerelease: false
204
+ version_requirements: !ruby/object:Gem::Requirement
205
+ requirements:
206
+ - - ">="
207
+ - !ruby/object:Gem::Version
208
+ version: '0'
195
209
  description: JSON:API serialization, error handling, filtering and pagination.
196
210
  email:
197
211
  - stas@nerd.ro