introspective_grape 0.4.0 → 0.5.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (42) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/lint.yml +23 -0
  3. data/.github/workflows/test.yml +18 -0
  4. data/.rubocop.yml +84 -1173
  5. data/.ruby-version +1 -1
  6. data/CHANGELOG.md +23 -0
  7. data/Gemfile +3 -5
  8. data/README.md +95 -63
  9. data/Rakefile +1 -6
  10. data/introspective_grape.gemspec +63 -52
  11. data/lib/introspective_grape/api.rb +166 -137
  12. data/lib/introspective_grape/camel_snake.rb +5 -3
  13. data/lib/introspective_grape/configuration.rb +15 -0
  14. data/lib/introspective_grape/create_helpers.rb +3 -5
  15. data/lib/introspective_grape/doc.rb +19 -5
  16. data/lib/introspective_grape/filters.rb +98 -83
  17. data/lib/introspective_grape/formatter/camel_json.rb +2 -3
  18. data/lib/introspective_grape/helpers.rb +55 -48
  19. data/lib/introspective_grape/snake_params.rb +1 -2
  20. data/lib/introspective_grape/traversal.rb +33 -31
  21. data/lib/introspective_grape/validators.rb +23 -23
  22. data/lib/introspective_grape/version.rb +3 -1
  23. data/lib/introspective_grape.rb +3 -1
  24. data/spec/dummy/Gemfile +5 -4
  25. data/spec/dummy/app/api/api_helpers.rb +1 -1
  26. data/spec/dummy/app/api/dummy/company_api.rb +1 -1
  27. data/spec/dummy/app/api/dummy/project_api.rb +1 -0
  28. data/spec/dummy/app/api/dummy/sessions.rb +1 -1
  29. data/spec/dummy/app/api/dummy_api.rb +8 -2
  30. data/spec/dummy/app/assets/config/manifest.js +4 -0
  31. data/spec/dummy/app/models/user.rb +1 -1
  32. data/spec/dummy/config/database.yml +1 -1
  33. data/spec/rails_helper.rb +1 -1
  34. metadata +161 -41
  35. data/.coveralls.yml +0 -2
  36. data/.travis.yml +0 -40
  37. data/bin/rails +0 -12
  38. data/gemfiles/Gemfile.rails.5.0.0 +0 -14
  39. data/gemfiles/Gemfile.rails.5.0.1 +0 -14
  40. data/gemfiles/Gemfile.rails.5.1.0 +0 -14
  41. data/gemfiles/Gemfile.rails.5.2.0 +0 -14
  42. data/gemfiles/Gemfile.rails.master +0 -14
metadata CHANGED
@@ -1,49 +1,85 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: introspective_grape
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Josh Buermann
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-10-20 00:00:00.000000000 Z
11
+ date: 2021-10-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ">"
17
+ - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: 5.0.0
19
+ version: '5.2'
20
20
  type: :runtime
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: 5.0.0
26
+ version: '5.2'
27
27
  - !ruby/object:Gem::Dependency
28
- name: grape
28
+ name: schema_validations
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - "~>"
31
+ - - ">="
32
32
  - !ruby/object:Gem::Version
33
- version: 1.2.0
34
- - - "<"
33
+ version: '0'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
35
39
  - !ruby/object:Gem::Version
36
- version: 1.2.5
40
+ version: '0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: rack
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ">="
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
37
48
  type: :runtime
38
49
  prerelease: false
39
50
  version_requirements: !ruby/object:Gem::Requirement
40
51
  requirements:
41
- - - "~>"
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: grape
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ">="
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ type: :runtime
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ">="
42
67
  - !ruby/object:Gem::Version
43
- version: 1.2.0
44
- - - "<"
68
+ version: '0'
69
+ - !ruby/object:Gem::Dependency
70
+ name: dry-types
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - ">="
74
+ - !ruby/object:Gem::Version
75
+ version: '0'
76
+ type: :runtime
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - ">="
45
81
  - !ruby/object:Gem::Version
46
- version: 1.2.5
82
+ version: '0'
47
83
  - !ruby/object:Gem::Dependency
48
84
  name: grape-entity
49
85
  requirement: !ruby/object:Gem::Requirement
@@ -86,6 +122,20 @@ dependencies:
86
122
  - - ">="
87
123
  - !ruby/object:Gem::Version
88
124
  version: '0'
125
+ - !ruby/object:Gem::Dependency
126
+ name: grape-kaminari
127
+ requirement: !ruby/object:Gem::Requirement
128
+ requirements:
129
+ - - ">="
130
+ - !ruby/object:Gem::Version
131
+ version: '0'
132
+ type: :runtime
133
+ prerelease: false
134
+ version_requirements: !ruby/object:Gem::Requirement
135
+ requirements:
136
+ - - ">="
137
+ - !ruby/object:Gem::Version
138
+ version: '0'
89
139
  - !ruby/object:Gem::Dependency
90
140
  name: pundit
91
141
  requirement: !ruby/object:Gem::Requirement
@@ -118,16 +168,16 @@ dependencies:
118
168
  name: sqlite3
119
169
  requirement: !ruby/object:Gem::Requirement
120
170
  requirements:
121
- - - "<"
171
+ - - ">="
122
172
  - !ruby/object:Gem::Version
123
- version: 1.4.0
173
+ version: '0'
124
174
  type: :development
125
175
  prerelease: false
126
176
  version_requirements: !ruby/object:Gem::Requirement
127
177
  requirements:
128
- - - "<"
178
+ - - ">="
129
179
  - !ruby/object:Gem::Version
130
- version: 1.4.0
180
+ version: '0'
131
181
  - !ruby/object:Gem::Dependency
132
182
  name: rspec-rails
133
183
  requirement: !ruby/object:Gem::Requirement
@@ -143,7 +193,7 @@ dependencies:
143
193
  - !ruby/object:Gem::Version
144
194
  version: '3.0'
145
195
  - !ruby/object:Gem::Dependency
146
- name: devise
196
+ name: coveralls_reborn
147
197
  requirement: !ruby/object:Gem::Requirement
148
198
  requirements:
149
199
  - - ">="
@@ -157,19 +207,75 @@ dependencies:
157
207
  - !ruby/object:Gem::Version
158
208
  version: '0'
159
209
  - !ruby/object:Gem::Dependency
160
- name: paperclip
210
+ name: simplecov
161
211
  requirement: !ruby/object:Gem::Requirement
162
212
  requirements:
163
213
  - - ">="
164
214
  - !ruby/object:Gem::Version
165
- version: 5.2.0
215
+ version: '0'
166
216
  type: :development
167
217
  prerelease: false
168
218
  version_requirements: !ruby/object:Gem::Requirement
169
219
  requirements:
170
220
  - - ">="
171
221
  - !ruby/object:Gem::Version
172
- version: 5.2.0
222
+ version: '0'
223
+ - !ruby/object:Gem::Dependency
224
+ name: bundler-audit
225
+ requirement: !ruby/object:Gem::Requirement
226
+ requirements:
227
+ - - ">="
228
+ - !ruby/object:Gem::Version
229
+ version: '0'
230
+ type: :development
231
+ prerelease: false
232
+ version_requirements: !ruby/object:Gem::Requirement
233
+ requirements:
234
+ - - ">="
235
+ - !ruby/object:Gem::Version
236
+ version: '0'
237
+ - !ruby/object:Gem::Dependency
238
+ name: brakeman
239
+ requirement: !ruby/object:Gem::Requirement
240
+ requirements:
241
+ - - ">="
242
+ - !ruby/object:Gem::Version
243
+ version: '0'
244
+ type: :development
245
+ prerelease: false
246
+ version_requirements: !ruby/object:Gem::Requirement
247
+ requirements:
248
+ - - ">="
249
+ - !ruby/object:Gem::Version
250
+ version: '0'
251
+ - !ruby/object:Gem::Dependency
252
+ name: rubocop
253
+ requirement: !ruby/object:Gem::Requirement
254
+ requirements:
255
+ - - ">="
256
+ - !ruby/object:Gem::Version
257
+ version: '0'
258
+ type: :development
259
+ prerelease: false
260
+ version_requirements: !ruby/object:Gem::Requirement
261
+ requirements:
262
+ - - ">="
263
+ - !ruby/object:Gem::Version
264
+ version: '0'
265
+ - !ruby/object:Gem::Dependency
266
+ name: byebug
267
+ requirement: !ruby/object:Gem::Requirement
268
+ requirements:
269
+ - - ">="
270
+ - !ruby/object:Gem::Version
271
+ version: '0'
272
+ type: :development
273
+ prerelease: false
274
+ version_requirements: !ruby/object:Gem::Requirement
275
+ requirements:
276
+ - - ">="
277
+ - !ruby/object:Gem::Version
278
+ version: '0'
173
279
  - !ruby/object:Gem::Dependency
174
280
  name: machinist_redux
175
281
  requirement: !ruby/object:Gem::Requirement
@@ -185,7 +291,7 @@ dependencies:
185
291
  - !ruby/object:Gem::Version
186
292
  version: '0'
187
293
  - !ruby/object:Gem::Dependency
188
- name: simplecov
294
+ name: paperclip
189
295
  requirement: !ruby/object:Gem::Requirement
190
296
  requirements:
191
297
  - - ">="
@@ -212,19 +318,36 @@ dependencies:
212
318
  - - ">="
213
319
  - !ruby/object:Gem::Version
214
320
  version: '0'
215
- description: Introspectively configure deeply nested RESTful Grape APIs for ActiveRecord
216
- models.
321
+ - !ruby/object:Gem::Dependency
322
+ name: devise
323
+ requirement: !ruby/object:Gem::Requirement
324
+ requirements:
325
+ - - ">="
326
+ - !ruby/object:Gem::Version
327
+ version: '0'
328
+ type: :development
329
+ prerelease: false
330
+ version_requirements: !ruby/object:Gem::Requirement
331
+ requirements:
332
+ - - ">="
333
+ - !ruby/object:Gem::Version
334
+ version: '0'
335
+ description: |2
336
+ IntrospectiveGrape provides handling for deeply nested relations according to the models'
337
+ `accepts_nested_attributes_for` declarations, generating all the necessary
338
+ boilerplate for flexible and consistent bulk endpoints on plural associations,
339
+ and building nested routes for the same.
217
340
  email:
218
341
  - buermann@gmail.com
219
342
  executables: []
220
343
  extensions: []
221
344
  extra_rdoc_files: []
222
345
  files:
223
- - ".coveralls.yml"
346
+ - ".github/workflows/lint.yml"
347
+ - ".github/workflows/test.yml"
224
348
  - ".gitignore"
225
349
  - ".rubocop.yml"
226
350
  - ".ruby-version"
227
- - ".travis.yml"
228
351
  - CHANGELOG.md
229
352
  - Gemfile
230
353
  - MIT-LICENSE
@@ -237,16 +360,11 @@ files:
237
360
  - app/mailers/.keep
238
361
  - app/models/.keep
239
362
  - app/views/.keep
240
- - bin/rails
241
- - gemfiles/Gemfile.rails.5.0.0
242
- - gemfiles/Gemfile.rails.5.0.1
243
- - gemfiles/Gemfile.rails.5.1.0
244
- - gemfiles/Gemfile.rails.5.2.0
245
- - gemfiles/Gemfile.rails.master
246
363
  - introspective_grape.gemspec
247
364
  - lib/introspective_grape.rb
248
365
  - lib/introspective_grape/api.rb
249
366
  - lib/introspective_grape/camel_snake.rb
367
+ - lib/introspective_grape/configuration.rb
250
368
  - lib/introspective_grape/create_helpers.rb
251
369
  - lib/introspective_grape/doc.rb
252
370
  - lib/introspective_grape/filters.rb
@@ -272,6 +390,7 @@ files:
272
390
  - spec/dummy/app/api/dummy_api.rb
273
391
  - spec/dummy/app/api/error_handlers.rb
274
392
  - spec/dummy/app/api/permissions_helper.rb
393
+ - spec/dummy/app/assets/config/manifest.js
275
394
  - spec/dummy/app/assets/images/.keep
276
395
  - spec/dummy/app/assets/javascripts/application.js
277
396
  - spec/dummy/app/assets/stylesheets/application.css
@@ -404,7 +523,7 @@ homepage: https://github.com/buermann/introspective_grape
404
523
  licenses:
405
524
  - MIT
406
525
  metadata: {}
407
- post_install_message:
526
+ post_install_message:
408
527
  rdoc_options: []
409
528
  require_paths:
410
529
  - lib
@@ -412,18 +531,18 @@ required_ruby_version: !ruby/object:Gem::Requirement
412
531
  requirements:
413
532
  - - ">="
414
533
  - !ruby/object:Gem::Version
415
- version: '2.3'
534
+ version: '2.5'
416
535
  required_rubygems_version: !ruby/object:Gem::Requirement
417
536
  requirements:
418
537
  - - ">="
419
538
  - !ruby/object:Gem::Version
420
539
  version: '0'
421
540
  requirements: []
422
- rubygems_version: 3.1.2
423
- signing_key:
541
+ rubyforge_project:
542
+ rubygems_version: 2.7.3
543
+ signing_key:
424
544
  specification_version: 4
425
- summary: Introspectively configure deeply nested RESTful Grape APIs for ActiveRecord
426
- models.
545
+ summary: Quickly configure Grape APIs around your database schema and models.
427
546
  test_files:
428
547
  - spec/dummy/Gemfile
429
548
  - spec/dummy/README.rdoc
@@ -440,6 +559,7 @@ test_files:
440
559
  - spec/dummy/app/api/dummy_api.rb
441
560
  - spec/dummy/app/api/error_handlers.rb
442
561
  - spec/dummy/app/api/permissions_helper.rb
562
+ - spec/dummy/app/assets/config/manifest.js
443
563
  - spec/dummy/app/assets/images/.keep
444
564
  - spec/dummy/app/assets/javascripts/application.js
445
565
  - spec/dummy/app/assets/stylesheets/application.css
data/.coveralls.yml DELETED
@@ -1,2 +0,0 @@
1
- service_name: travis-ci
2
-
data/.travis.yml DELETED
@@ -1,40 +0,0 @@
1
- language: ruby
2
- before_install:
3
- - gem install bundler -v 1.17.3
4
- install: bundle install --jobs=1 --retry=1
5
- script:
6
- - bundle install
7
- - bundle exec rspec
8
-
9
- rvm:
10
- - 2.3.1
11
- - 2.4.0
12
- - 2.5.0
13
- - ruby-head
14
- - jruby-head
15
- gemfile:
16
- - gemfiles/Gemfile.rails.5.0.1
17
- - gemfiles/Gemfile.rails.5.1.0
18
- - gemfiles/Gemfile.rails.5.2.0
19
- - gemfiles/Gemfile.rails.master
20
-
21
- matrix:
22
- exclude:
23
- - rvm: jruby-9.0.4.0
24
- gemfile: gemfiles/Gemfile.rails.5.0.1
25
- - rvm: jruby-9.0.4.0
26
- gemfile: gemfiles/Gemfile.rails.master
27
- allow_failures:
28
- - rvm: ruby-head
29
- - rvm: jruby-head
30
-
31
- env:
32
- global:
33
- - JRUBY_OPTS="-J-Xmx1024m --debug"
34
-
35
- notifications:
36
- email:
37
- recipients:
38
- - buermann@gmail.com
39
- on_success: change
40
- on_failure: always
data/bin/rails DELETED
@@ -1,12 +0,0 @@
1
- #!/usr/bin/env ruby
2
- # This command will automatically be run when you run "rails" with Rails 4 gems installed from the root of your application.
3
-
4
- ENGINE_ROOT = File.expand_path('../..', __FILE__)
5
- ENGINE_PATH = File.expand_path('../../lib/introspective_grape/engine', __FILE__)
6
-
7
- # Set up gems listed in the Gemfile.
8
- ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__)
9
- require 'bundler/setup' if File.exist?(ENV['BUNDLE_GEMFILE'])
10
-
11
- require 'rails/all'
12
- require 'rails/engine/commands'
@@ -1,14 +0,0 @@
1
- source 'https://rubygems.org'
2
-
3
- gemspec :path => '../'
4
-
5
- gem 'rails', '5.0.0'
6
- gem 'grape'
7
- gem 'grape-kaminari', :github => 'alexey-klimuk/grape-kaminari'
8
- gem 'grape-swagger'
9
- gem 'nokogiri'
10
- gem 'coveralls', require: false
11
-
12
- group :development,:test do
13
- gem 'rspec'
14
- end
@@ -1,14 +0,0 @@
1
- source 'https://rubygems.org'
2
-
3
- gemspec :path => '../'
4
-
5
- gem 'rails', '5.0.1'
6
- gem 'grape'
7
- gem 'grape-kaminari', :github => 'alexey-klimuk/grape-kaminari'
8
- gem 'grape-swagger'
9
- gem 'nokogiri'
10
- gem 'coveralls', require: false
11
-
12
- group :development,:test do
13
- gem 'rspec'
14
- end
@@ -1,14 +0,0 @@
1
- source 'https://rubygems.org'
2
-
3
- gemspec :path => '../'
4
-
5
- gem 'rails', '5.1.0'
6
- gem 'grape'
7
- gem 'grape-kaminari', :github => 'alexey-klimuk/grape-kaminari'
8
- gem 'grape-swagger'
9
- gem 'nokogiri'
10
- gem 'coveralls', require: false
11
-
12
- group :development,:test do
13
- gem 'rspec'
14
- end
@@ -1,14 +0,0 @@
1
- source 'https://rubygems.org'
2
-
3
- gemspec :path => '../'
4
-
5
- gem 'rails', '5.2.0'
6
- gem 'grape'
7
- gem 'grape-kaminari', :github => 'alexey-klimuk/grape-kaminari'
8
- gem 'grape-swagger'
9
- gem 'nokogiri'
10
- gem 'coveralls', require: false
11
-
12
- group :development,:test do
13
- gem 'rspec'
14
- end
@@ -1,14 +0,0 @@
1
- source 'https://rubygems.org'
2
-
3
- gemspec :path => '../'
4
-
5
- gem 'rails'
6
- gem 'grape'
7
- gem 'grape-kaminari', :github => 'alexey-klimuk/grape-kaminari'
8
- gem 'grape-swagger'
9
- gem 'nokogiri'
10
- gem 'coveralls', require: false
11
-
12
- group :development,:test do
13
- gem 'rspec'
14
- end