jpie 0.1.0

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.
Files changed (48) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +21 -0
  3. data/.rspec +3 -0
  4. data/.rubocop.yml +65 -0
  5. data/.travis.yml +7 -0
  6. data/Gemfile +21 -0
  7. data/Gemfile.lock +312 -0
  8. data/README.md +2159 -0
  9. data/Rakefile +8 -0
  10. data/bin/console +15 -0
  11. data/bin/setup +8 -0
  12. data/jpie.gemspec +31 -0
  13. data/kiln/app/resources/user_message_resource.rb +2 -0
  14. data/lib/jpie.rb +6 -0
  15. data/lib/json_api/active_storage/deserialization.rb +106 -0
  16. data/lib/json_api/active_storage/detection.rb +74 -0
  17. data/lib/json_api/active_storage/serialization.rb +32 -0
  18. data/lib/json_api/configuration.rb +58 -0
  19. data/lib/json_api/controllers/base_controller.rb +26 -0
  20. data/lib/json_api/controllers/concerns/controller_helpers.rb +223 -0
  21. data/lib/json_api/controllers/concerns/resource_actions.rb +657 -0
  22. data/lib/json_api/controllers/relationships_controller.rb +504 -0
  23. data/lib/json_api/controllers/resources_controller.rb +6 -0
  24. data/lib/json_api/errors/parameter_not_allowed.rb +19 -0
  25. data/lib/json_api/railtie.rb +75 -0
  26. data/lib/json_api/resources/active_storage_blob_resource.rb +11 -0
  27. data/lib/json_api/resources/resource.rb +238 -0
  28. data/lib/json_api/resources/resource_loader.rb +35 -0
  29. data/lib/json_api/routing.rb +72 -0
  30. data/lib/json_api/serialization/deserializer.rb +362 -0
  31. data/lib/json_api/serialization/serializer.rb +320 -0
  32. data/lib/json_api/support/active_storage_support.rb +85 -0
  33. data/lib/json_api/support/collection_query.rb +406 -0
  34. data/lib/json_api/support/instrumentation.rb +42 -0
  35. data/lib/json_api/support/param_helpers.rb +51 -0
  36. data/lib/json_api/support/relationship_guard.rb +16 -0
  37. data/lib/json_api/support/relationship_helpers.rb +74 -0
  38. data/lib/json_api/support/resource_identifier.rb +87 -0
  39. data/lib/json_api/support/responders.rb +100 -0
  40. data/lib/json_api/support/response_helpers.rb +10 -0
  41. data/lib/json_api/support/sort_parsing.rb +21 -0
  42. data/lib/json_api/support/type_conversion.rb +21 -0
  43. data/lib/json_api/testing/test_helper.rb +76 -0
  44. data/lib/json_api/testing.rb +3 -0
  45. data/lib/json_api/version.rb +5 -0
  46. data/lib/json_api.rb +50 -0
  47. data/lib/rubocop/cop/custom/hash_value_omission.rb +53 -0
  48. metadata +128 -0
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 9828881d37d5a2d46abe1473e1a36e0732e8041f7c1928f064697ca3190599d5
4
+ data.tar.gz: 884490a5465ff04550e31a62f69ab7cac037a149e6e435009efc05bc0ed3a58c
5
+ SHA512:
6
+ metadata.gz: 2c8b3034bc3e93a4ddc92aa322e771355f4f8491ac12630e580c20e5045a8ae3d770d1b78ef67637a3e4e1320e46311daeca4b2546c723393248ee17973a7a8c
7
+ data.tar.gz: 66b6e80434d5ea11c8b375dde1b3e5fa0432c6027fdd6a75582e8c7f7eb51cccebbb8f1c4c26cecd5a9c3a37c4c62f74ac9e9e8bd1bb786fb6027185e932911f
data/.gitignore ADDED
@@ -0,0 +1,21 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /_yardoc/
4
+ /coverage/
5
+ /doc/
6
+ /pkg/
7
+ /spec/reports/
8
+ /tmp/
9
+
10
+ # Gem builds
11
+ *.gem
12
+
13
+ # rspec failure tracking
14
+ .rspec_status
15
+
16
+ # test log files
17
+ spec/dummy/log/*.log
18
+ spec/dummy/log/*.log.*
19
+
20
+ # dummy app tmp directory
21
+ spec/dummy/tmp/
data/.rspec ADDED
@@ -0,0 +1,3 @@
1
+ --format documentation
2
+ --color
3
+ --require spec_helper
data/.rubocop.yml ADDED
@@ -0,0 +1,65 @@
1
+ require:
2
+ - ./lib/rubocop/cop/custom/hash_value_omission.rb
3
+
4
+ AllCops:
5
+ NewCops: enable
6
+ TargetRubyVersion: 3.4
7
+ SuggestExtensions: false
8
+ Exclude:
9
+ - "vendor/**/*"
10
+ - "tmp/**/*"
11
+ - "spec/dummy/**/*"
12
+ - "**/*.gemspec"
13
+
14
+ Gemspec/DevelopmentDependencies:
15
+ Enabled: false
16
+
17
+ Metrics/AbcSize:
18
+ Enabled: false
19
+
20
+ Metrics/BlockLength:
21
+ Enabled: false
22
+
23
+ Metrics/BlockNesting:
24
+ Enabled: false
25
+
26
+ Metrics/ClassLength:
27
+ Enabled: false
28
+
29
+ Metrics/CollectionLiteralLength:
30
+ Enabled: false
31
+
32
+ Metrics/CyclomaticComplexity:
33
+ Enabled: true
34
+ Max: 7
35
+
36
+ Metrics/MethodLength:
37
+ Enabled: true
38
+ Max: 10
39
+
40
+ Metrics/ModuleLength:
41
+ Enabled: true
42
+ Max: 150
43
+
44
+ Metrics/ParameterLists:
45
+ Enabled: true
46
+ Max: 5
47
+
48
+ Metrics/PerceivedComplexity:
49
+ Enabled: true
50
+ Max: 8
51
+
52
+ Naming/PredicatePrefix:
53
+ Enabled: false
54
+
55
+ Style/Documentation:
56
+ Enabled: false
57
+
58
+ Style/DocumentationMethod:
59
+ Enabled: false
60
+
61
+ Style/StringLiterals:
62
+ EnforcedStyle: double_quotes
63
+
64
+ Custom/HashValueOmission:
65
+ Enabled: true
data/.travis.yml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ sudo: false
3
+ language: ruby
4
+ cache: bundler
5
+ rvm:
6
+ - 2.6.10
7
+ before_install: gem install bundler -v 1.17.2
data/Gemfile ADDED
@@ -0,0 +1,21 @@
1
+ # frozen_string_literal: true
2
+
3
+ source "https://rubygems.org"
4
+
5
+ git_source(:github) { |repo_name| "https://github.com/#{repo_name}" }
6
+
7
+ # Specify your gem's dependencies in json_api.gemspec
8
+ gemspec
9
+
10
+ group :development, :test do
11
+ gem 'appraisal', '~> 2.4'
12
+ gem 'bundler', '~> 2.0'
13
+ gem 'json_schemer', '~> 2.4'
14
+ gem 'pundit', '~> 2.3'
15
+ gem 'rake', '~> 13.0'
16
+ gem 'rspec', '~> 3.12'
17
+ gem 'rspec-rails', '~> 6.0'
18
+ gem 'rubocop', '~> 1.0'
19
+ gem 'rubocop-rails', '~> 2.0'
20
+ gem 'sqlite3', '>= 2.1'
21
+ end
data/Gemfile.lock ADDED
@@ -0,0 +1,312 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ json_api (0.1.0)
5
+ actionpack (>= 8.0.0)
6
+ rails (>= 8.0.0)
7
+
8
+ GEM
9
+ remote: https://rubygems.org/
10
+ specs:
11
+ action_text-trix (2.1.15)
12
+ railties
13
+ actioncable (8.1.1)
14
+ actionpack (= 8.1.1)
15
+ activesupport (= 8.1.1)
16
+ nio4r (~> 2.0)
17
+ websocket-driver (>= 0.6.1)
18
+ zeitwerk (~> 2.6)
19
+ actionmailbox (8.1.1)
20
+ actionpack (= 8.1.1)
21
+ activejob (= 8.1.1)
22
+ activerecord (= 8.1.1)
23
+ activestorage (= 8.1.1)
24
+ activesupport (= 8.1.1)
25
+ mail (>= 2.8.0)
26
+ actionmailer (8.1.1)
27
+ actionpack (= 8.1.1)
28
+ actionview (= 8.1.1)
29
+ activejob (= 8.1.1)
30
+ activesupport (= 8.1.1)
31
+ mail (>= 2.8.0)
32
+ rails-dom-testing (~> 2.2)
33
+ actionpack (8.1.1)
34
+ actionview (= 8.1.1)
35
+ activesupport (= 8.1.1)
36
+ nokogiri (>= 1.8.5)
37
+ rack (>= 2.2.4)
38
+ rack-session (>= 1.0.1)
39
+ rack-test (>= 0.6.3)
40
+ rails-dom-testing (~> 2.2)
41
+ rails-html-sanitizer (~> 1.6)
42
+ useragent (~> 0.16)
43
+ actiontext (8.1.1)
44
+ action_text-trix (~> 2.1.15)
45
+ actionpack (= 8.1.1)
46
+ activerecord (= 8.1.1)
47
+ activestorage (= 8.1.1)
48
+ activesupport (= 8.1.1)
49
+ globalid (>= 0.6.0)
50
+ nokogiri (>= 1.8.5)
51
+ actionview (8.1.1)
52
+ activesupport (= 8.1.1)
53
+ builder (~> 3.1)
54
+ erubi (~> 1.11)
55
+ rails-dom-testing (~> 2.2)
56
+ rails-html-sanitizer (~> 1.6)
57
+ activejob (8.1.1)
58
+ activesupport (= 8.1.1)
59
+ globalid (>= 0.3.6)
60
+ activemodel (8.1.1)
61
+ activesupport (= 8.1.1)
62
+ activerecord (8.1.1)
63
+ activemodel (= 8.1.1)
64
+ activesupport (= 8.1.1)
65
+ timeout (>= 0.4.0)
66
+ activestorage (8.1.1)
67
+ actionpack (= 8.1.1)
68
+ activejob (= 8.1.1)
69
+ activerecord (= 8.1.1)
70
+ activesupport (= 8.1.1)
71
+ marcel (~> 1.0)
72
+ activesupport (8.1.1)
73
+ base64
74
+ bigdecimal
75
+ concurrent-ruby (~> 1.0, >= 1.3.1)
76
+ connection_pool (>= 2.2.5)
77
+ drb
78
+ i18n (>= 1.6, < 2)
79
+ json
80
+ logger (>= 1.4.2)
81
+ minitest (>= 5.1)
82
+ securerandom (>= 0.3)
83
+ tzinfo (~> 2.0, >= 2.0.5)
84
+ uri (>= 0.13.1)
85
+ appraisal (2.5.0)
86
+ bundler
87
+ rake
88
+ thor (>= 0.14.0)
89
+ ast (2.4.3)
90
+ base64 (0.3.0)
91
+ bigdecimal (3.3.1)
92
+ builder (3.3.0)
93
+ concurrent-ruby (1.3.5)
94
+ connection_pool (2.5.4)
95
+ crass (1.0.6)
96
+ date (3.5.0)
97
+ diff-lcs (1.6.2)
98
+ drb (2.2.3)
99
+ erb (6.0.0)
100
+ erubi (1.13.1)
101
+ globalid (1.3.0)
102
+ activesupport (>= 6.1)
103
+ hana (1.3.7)
104
+ i18n (1.14.7)
105
+ concurrent-ruby (~> 1.0)
106
+ io-console (0.8.1)
107
+ irb (1.15.3)
108
+ pp (>= 0.6.0)
109
+ rdoc (>= 4.0.0)
110
+ reline (>= 0.4.2)
111
+ json (2.16.0)
112
+ json_schemer (2.4.0)
113
+ bigdecimal
114
+ hana (~> 1.3)
115
+ regexp_parser (~> 2.0)
116
+ simpleidn (~> 0.2)
117
+ language_server-protocol (3.17.0.5)
118
+ lint_roller (1.1.0)
119
+ logger (1.7.0)
120
+ loofah (2.24.1)
121
+ crass (~> 1.0.2)
122
+ nokogiri (>= 1.12.0)
123
+ mail (2.9.0)
124
+ logger
125
+ mini_mime (>= 0.1.1)
126
+ net-imap
127
+ net-pop
128
+ net-smtp
129
+ marcel (1.1.0)
130
+ mini_mime (1.1.5)
131
+ minitest (5.26.2)
132
+ net-imap (0.5.12)
133
+ date
134
+ net-protocol
135
+ net-pop (0.1.2)
136
+ net-protocol
137
+ net-protocol (0.2.2)
138
+ timeout
139
+ net-smtp (0.5.1)
140
+ net-protocol
141
+ nio4r (2.7.5)
142
+ nokogiri (1.18.10-aarch64-linux-gnu)
143
+ racc (~> 1.4)
144
+ nokogiri (1.18.10-aarch64-linux-musl)
145
+ racc (~> 1.4)
146
+ nokogiri (1.18.10-arm-linux-gnu)
147
+ racc (~> 1.4)
148
+ nokogiri (1.18.10-arm-linux-musl)
149
+ racc (~> 1.4)
150
+ nokogiri (1.18.10-arm64-darwin)
151
+ racc (~> 1.4)
152
+ nokogiri (1.18.10-x86_64-darwin)
153
+ racc (~> 1.4)
154
+ nokogiri (1.18.10-x86_64-linux-gnu)
155
+ racc (~> 1.4)
156
+ nokogiri (1.18.10-x86_64-linux-musl)
157
+ racc (~> 1.4)
158
+ parallel (1.27.0)
159
+ parser (3.3.10.0)
160
+ ast (~> 2.4.1)
161
+ racc
162
+ pp (0.6.3)
163
+ prettyprint
164
+ prettyprint (0.2.0)
165
+ prism (1.6.0)
166
+ psych (5.2.6)
167
+ date
168
+ stringio
169
+ pundit (2.5.2)
170
+ activesupport (>= 3.0.0)
171
+ racc (1.8.1)
172
+ rack (3.2.4)
173
+ rack-session (2.1.1)
174
+ base64 (>= 0.1.0)
175
+ rack (>= 3.0.0)
176
+ rack-test (2.2.0)
177
+ rack (>= 1.3)
178
+ rackup (2.2.1)
179
+ rack (>= 3)
180
+ rails (8.1.1)
181
+ actioncable (= 8.1.1)
182
+ actionmailbox (= 8.1.1)
183
+ actionmailer (= 8.1.1)
184
+ actionpack (= 8.1.1)
185
+ actiontext (= 8.1.1)
186
+ actionview (= 8.1.1)
187
+ activejob (= 8.1.1)
188
+ activemodel (= 8.1.1)
189
+ activerecord (= 8.1.1)
190
+ activestorage (= 8.1.1)
191
+ activesupport (= 8.1.1)
192
+ bundler (>= 1.15.0)
193
+ railties (= 8.1.1)
194
+ rails-dom-testing (2.3.0)
195
+ activesupport (>= 5.0.0)
196
+ minitest
197
+ nokogiri (>= 1.6)
198
+ rails-html-sanitizer (1.6.2)
199
+ loofah (~> 2.21)
200
+ nokogiri (>= 1.15.7, != 1.16.7, != 1.16.6, != 1.16.5, != 1.16.4, != 1.16.3, != 1.16.2, != 1.16.1, != 1.16.0.rc1, != 1.16.0)
201
+ railties (8.1.1)
202
+ actionpack (= 8.1.1)
203
+ activesupport (= 8.1.1)
204
+ irb (~> 1.13)
205
+ rackup (>= 1.0.0)
206
+ rake (>= 12.2)
207
+ thor (~> 1.0, >= 1.2.2)
208
+ tsort (>= 0.2)
209
+ zeitwerk (~> 2.6)
210
+ rainbow (3.1.1)
211
+ rake (13.3.1)
212
+ rdoc (6.15.1)
213
+ erb
214
+ psych (>= 4.0.0)
215
+ tsort
216
+ regexp_parser (2.11.3)
217
+ reline (0.6.3)
218
+ io-console (~> 0.5)
219
+ rspec (3.13.2)
220
+ rspec-core (~> 3.13.0)
221
+ rspec-expectations (~> 3.13.0)
222
+ rspec-mocks (~> 3.13.0)
223
+ rspec-core (3.13.6)
224
+ rspec-support (~> 3.13.0)
225
+ rspec-expectations (3.13.5)
226
+ diff-lcs (>= 1.2.0, < 2.0)
227
+ rspec-support (~> 3.13.0)
228
+ rspec-mocks (3.13.7)
229
+ diff-lcs (>= 1.2.0, < 2.0)
230
+ rspec-support (~> 3.13.0)
231
+ rspec-rails (6.1.5)
232
+ actionpack (>= 6.1)
233
+ activesupport (>= 6.1)
234
+ railties (>= 6.1)
235
+ rspec-core (~> 3.13)
236
+ rspec-expectations (~> 3.13)
237
+ rspec-mocks (~> 3.13)
238
+ rspec-support (~> 3.13)
239
+ rspec-support (3.13.6)
240
+ rubocop (1.81.7)
241
+ json (~> 2.3)
242
+ language_server-protocol (~> 3.17.0.2)
243
+ lint_roller (~> 1.1.0)
244
+ parallel (~> 1.10)
245
+ parser (>= 3.3.0.2)
246
+ rainbow (>= 2.2.2, < 4.0)
247
+ regexp_parser (>= 2.9.3, < 3.0)
248
+ rubocop-ast (>= 1.47.1, < 2.0)
249
+ ruby-progressbar (~> 1.7)
250
+ unicode-display_width (>= 2.4.0, < 4.0)
251
+ rubocop-ast (1.48.0)
252
+ parser (>= 3.3.7.2)
253
+ prism (~> 1.4)
254
+ rubocop-rails (2.34.0)
255
+ activesupport (>= 4.2.0)
256
+ lint_roller (~> 1.1)
257
+ rack (>= 1.1)
258
+ rubocop (>= 1.75.0, < 2.0)
259
+ rubocop-ast (>= 1.44.0, < 2.0)
260
+ ruby-progressbar (1.13.0)
261
+ securerandom (0.4.1)
262
+ simpleidn (0.2.3)
263
+ sqlite3 (2.8.0-aarch64-linux-gnu)
264
+ sqlite3 (2.8.0-aarch64-linux-musl)
265
+ sqlite3 (2.8.0-arm-linux-gnu)
266
+ sqlite3 (2.8.0-arm-linux-musl)
267
+ sqlite3 (2.8.0-arm64-darwin)
268
+ sqlite3 (2.8.0-x86_64-darwin)
269
+ sqlite3 (2.8.0-x86_64-linux-gnu)
270
+ sqlite3 (2.8.0-x86_64-linux-musl)
271
+ stringio (3.1.8)
272
+ thor (1.4.0)
273
+ timeout (0.4.4)
274
+ tsort (0.2.0)
275
+ tzinfo (2.0.6)
276
+ concurrent-ruby (~> 1.0)
277
+ unicode-display_width (3.2.0)
278
+ unicode-emoji (~> 4.1)
279
+ unicode-emoji (4.1.0)
280
+ uri (1.1.1)
281
+ useragent (0.16.11)
282
+ websocket-driver (0.8.0)
283
+ base64
284
+ websocket-extensions (>= 0.1.0)
285
+ websocket-extensions (0.1.5)
286
+ zeitwerk (2.7.3)
287
+
288
+ PLATFORMS
289
+ aarch64-linux-gnu
290
+ aarch64-linux-musl
291
+ arm-linux-gnu
292
+ arm-linux-musl
293
+ arm64-darwin
294
+ x86_64-darwin
295
+ x86_64-linux-gnu
296
+ x86_64-linux-musl
297
+
298
+ DEPENDENCIES
299
+ appraisal (~> 2.4)
300
+ bundler (~> 2.0)
301
+ json_api!
302
+ json_schemer (~> 2.4)
303
+ pundit (~> 2.3)
304
+ rake (~> 13.0)
305
+ rspec (~> 3.12)
306
+ rspec-rails (~> 6.0)
307
+ rubocop (~> 1.0)
308
+ rubocop-rails (~> 2.0)
309
+ sqlite3 (>= 2.1)
310
+
311
+ BUNDLED WITH
312
+ 2.7.2