camille 1.3.0 → 1.5.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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +12 -0
- data/Gemfile.lock +105 -95
- data/lib/camille/controller.rb +6 -2
- data/lib/camille/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 901863ce3680f14f101ac00cac0ef9f6b64b84413f483e52e90583149eb54d80
|
|
4
|
+
data.tar.gz: 309265868f68ea69fa5b5b3af60d43813ec8f8602abb8fc8f49c089c7c94fea1
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: e6f3f740d1bbdd532760262e74594e19853b51950c47c9222bea76264b0bf6b4a6839cc0963a3b70778203f34ee867a5c77aa1685232719490c1a47ec939de39
|
|
7
|
+
data.tar.gz: 79655aa7f4adf210cd0884655f445e9d094f218624fd2be62fedea30e6a5a82fc900a222a4337d28c88c46034ef264d8cfdfb0b01f985a25d83068962f4807ae
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 1.5.0
|
|
4
|
+
|
|
5
|
+
### Fixed
|
|
6
|
+
|
|
7
|
+
* Allow Camille::Controller::ParamsTypeError to be rescued by `rescue_from` in controllers.
|
|
8
|
+
|
|
9
|
+
## 1.4.0
|
|
10
|
+
|
|
11
|
+
### Added
|
|
12
|
+
|
|
13
|
+
* Added Camille::Controller::ParamsTypeError and Camille::Controller::ResponseTypeError to indicate source of TypeError.
|
|
14
|
+
|
|
3
15
|
## 1.3.0
|
|
4
16
|
|
|
5
17
|
### Added
|
data/Gemfile.lock
CHANGED
|
@@ -1,72 +1,71 @@
|
|
|
1
1
|
PATH
|
|
2
2
|
remote: .
|
|
3
3
|
specs:
|
|
4
|
-
camille (1.
|
|
4
|
+
camille (1.4.0)
|
|
5
5
|
rails (>= 6.1, < 8.1)
|
|
6
6
|
|
|
7
7
|
GEM
|
|
8
8
|
remote: https://rubygems.org/
|
|
9
9
|
specs:
|
|
10
|
-
actioncable (
|
|
11
|
-
actionpack (=
|
|
12
|
-
activesupport (=
|
|
10
|
+
actioncable (8.0.4)
|
|
11
|
+
actionpack (= 8.0.4)
|
|
12
|
+
activesupport (= 8.0.4)
|
|
13
13
|
nio4r (~> 2.0)
|
|
14
14
|
websocket-driver (>= 0.6.1)
|
|
15
15
|
zeitwerk (~> 2.6)
|
|
16
|
-
actionmailbox (
|
|
17
|
-
actionpack (=
|
|
18
|
-
activejob (=
|
|
19
|
-
activerecord (=
|
|
20
|
-
activestorage (=
|
|
21
|
-
activesupport (=
|
|
16
|
+
actionmailbox (8.0.4)
|
|
17
|
+
actionpack (= 8.0.4)
|
|
18
|
+
activejob (= 8.0.4)
|
|
19
|
+
activerecord (= 8.0.4)
|
|
20
|
+
activestorage (= 8.0.4)
|
|
21
|
+
activesupport (= 8.0.4)
|
|
22
22
|
mail (>= 2.8.0)
|
|
23
|
-
actionmailer (
|
|
24
|
-
actionpack (=
|
|
25
|
-
actionview (=
|
|
26
|
-
activejob (=
|
|
27
|
-
activesupport (=
|
|
23
|
+
actionmailer (8.0.4)
|
|
24
|
+
actionpack (= 8.0.4)
|
|
25
|
+
actionview (= 8.0.4)
|
|
26
|
+
activejob (= 8.0.4)
|
|
27
|
+
activesupport (= 8.0.4)
|
|
28
28
|
mail (>= 2.8.0)
|
|
29
29
|
rails-dom-testing (~> 2.2)
|
|
30
|
-
actionpack (
|
|
31
|
-
actionview (=
|
|
32
|
-
activesupport (=
|
|
30
|
+
actionpack (8.0.4)
|
|
31
|
+
actionview (= 8.0.4)
|
|
32
|
+
activesupport (= 8.0.4)
|
|
33
33
|
nokogiri (>= 1.8.5)
|
|
34
|
-
|
|
35
|
-
rack (>= 2.2.4, < 3.2)
|
|
34
|
+
rack (>= 2.2.4)
|
|
36
35
|
rack-session (>= 1.0.1)
|
|
37
36
|
rack-test (>= 0.6.3)
|
|
38
37
|
rails-dom-testing (~> 2.2)
|
|
39
38
|
rails-html-sanitizer (~> 1.6)
|
|
40
39
|
useragent (~> 0.16)
|
|
41
|
-
actiontext (
|
|
42
|
-
actionpack (=
|
|
43
|
-
activerecord (=
|
|
44
|
-
activestorage (=
|
|
45
|
-
activesupport (=
|
|
40
|
+
actiontext (8.0.4)
|
|
41
|
+
actionpack (= 8.0.4)
|
|
42
|
+
activerecord (= 8.0.4)
|
|
43
|
+
activestorage (= 8.0.4)
|
|
44
|
+
activesupport (= 8.0.4)
|
|
46
45
|
globalid (>= 0.6.0)
|
|
47
46
|
nokogiri (>= 1.8.5)
|
|
48
|
-
actionview (
|
|
49
|
-
activesupport (=
|
|
47
|
+
actionview (8.0.4)
|
|
48
|
+
activesupport (= 8.0.4)
|
|
50
49
|
builder (~> 3.1)
|
|
51
50
|
erubi (~> 1.11)
|
|
52
51
|
rails-dom-testing (~> 2.2)
|
|
53
52
|
rails-html-sanitizer (~> 1.6)
|
|
54
|
-
activejob (
|
|
55
|
-
activesupport (=
|
|
53
|
+
activejob (8.0.4)
|
|
54
|
+
activesupport (= 8.0.4)
|
|
56
55
|
globalid (>= 0.3.6)
|
|
57
|
-
activemodel (
|
|
58
|
-
activesupport (=
|
|
59
|
-
activerecord (
|
|
60
|
-
activemodel (=
|
|
61
|
-
activesupport (=
|
|
56
|
+
activemodel (8.0.4)
|
|
57
|
+
activesupport (= 8.0.4)
|
|
58
|
+
activerecord (8.0.4)
|
|
59
|
+
activemodel (= 8.0.4)
|
|
60
|
+
activesupport (= 8.0.4)
|
|
62
61
|
timeout (>= 0.4.0)
|
|
63
|
-
activestorage (
|
|
64
|
-
actionpack (=
|
|
65
|
-
activejob (=
|
|
66
|
-
activerecord (=
|
|
67
|
-
activesupport (=
|
|
62
|
+
activestorage (8.0.4)
|
|
63
|
+
actionpack (= 8.0.4)
|
|
64
|
+
activejob (= 8.0.4)
|
|
65
|
+
activerecord (= 8.0.4)
|
|
66
|
+
activesupport (= 8.0.4)
|
|
68
67
|
marcel (~> 1.0)
|
|
69
|
-
activesupport (
|
|
68
|
+
activesupport (8.0.4)
|
|
70
69
|
base64
|
|
71
70
|
benchmark (>= 0.3)
|
|
72
71
|
bigdecimal
|
|
@@ -78,39 +77,43 @@ GEM
|
|
|
78
77
|
minitest (>= 5.1)
|
|
79
78
|
securerandom (>= 0.3)
|
|
80
79
|
tzinfo (~> 2.0, >= 2.0.5)
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
80
|
+
uri (>= 0.13.1)
|
|
81
|
+
base64 (0.3.0)
|
|
82
|
+
benchmark (0.5.0)
|
|
83
|
+
bigdecimal (4.0.1)
|
|
84
84
|
builder (3.3.0)
|
|
85
|
-
concurrent-ruby (1.3.
|
|
86
|
-
connection_pool (
|
|
85
|
+
concurrent-ruby (1.3.6)
|
|
86
|
+
connection_pool (3.0.2)
|
|
87
87
|
crass (1.0.6)
|
|
88
|
-
date (3.
|
|
88
|
+
date (3.5.1)
|
|
89
89
|
diff-lcs (1.5.1)
|
|
90
|
-
drb (2.2.
|
|
91
|
-
|
|
92
|
-
|
|
90
|
+
drb (2.2.3)
|
|
91
|
+
erb (6.0.1)
|
|
92
|
+
erubi (1.13.1)
|
|
93
|
+
globalid (1.3.0)
|
|
93
94
|
activesupport (>= 6.1)
|
|
94
|
-
i18n (1.14.
|
|
95
|
+
i18n (1.14.8)
|
|
95
96
|
concurrent-ruby (~> 1.0)
|
|
96
|
-
io-console (0.8.
|
|
97
|
-
irb (1.
|
|
97
|
+
io-console (0.8.2)
|
|
98
|
+
irb (1.16.0)
|
|
99
|
+
pp (>= 0.6.0)
|
|
98
100
|
rdoc (>= 4.0.0)
|
|
99
101
|
reline (>= 0.4.2)
|
|
100
|
-
logger (1.
|
|
101
|
-
loofah (2.
|
|
102
|
+
logger (1.7.0)
|
|
103
|
+
loofah (2.25.0)
|
|
102
104
|
crass (~> 1.0.2)
|
|
103
105
|
nokogiri (>= 1.12.0)
|
|
104
|
-
mail (2.
|
|
106
|
+
mail (2.9.0)
|
|
107
|
+
logger
|
|
105
108
|
mini_mime (>= 0.1.1)
|
|
106
109
|
net-imap
|
|
107
110
|
net-pop
|
|
108
111
|
net-smtp
|
|
109
|
-
marcel (1.0
|
|
112
|
+
marcel (1.1.0)
|
|
110
113
|
mini_mime (1.1.5)
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
net-imap (0.
|
|
114
|
+
minitest (6.0.1)
|
|
115
|
+
prism (~> 1.5)
|
|
116
|
+
net-imap (0.6.2)
|
|
114
117
|
date
|
|
115
118
|
net-protocol
|
|
116
119
|
net-pop (0.1.2)
|
|
@@ -119,56 +122,61 @@ GEM
|
|
|
119
122
|
timeout
|
|
120
123
|
net-smtp (0.5.1)
|
|
121
124
|
net-protocol
|
|
122
|
-
nio4r (2.7.
|
|
123
|
-
nokogiri (1.
|
|
124
|
-
mini_portile2 (~> 2.8.2)
|
|
125
|
+
nio4r (2.7.5)
|
|
126
|
+
nokogiri (1.19.0-x86_64-linux-gnu)
|
|
125
127
|
racc (~> 1.4)
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
128
|
+
pp (0.6.3)
|
|
129
|
+
prettyprint
|
|
130
|
+
prettyprint (0.2.0)
|
|
131
|
+
prism (1.9.0)
|
|
132
|
+
psych (5.3.1)
|
|
129
133
|
date
|
|
130
134
|
stringio
|
|
131
135
|
racc (1.8.1)
|
|
132
|
-
rack (3.
|
|
133
|
-
rack-session (2.
|
|
136
|
+
rack (3.2.4)
|
|
137
|
+
rack-session (2.1.1)
|
|
138
|
+
base64 (>= 0.1.0)
|
|
134
139
|
rack (>= 3.0.0)
|
|
135
|
-
rack-test (2.
|
|
140
|
+
rack-test (2.2.0)
|
|
136
141
|
rack (>= 1.3)
|
|
137
|
-
rackup (2.
|
|
142
|
+
rackup (2.3.1)
|
|
138
143
|
rack (>= 3)
|
|
139
|
-
rails (
|
|
140
|
-
actioncable (=
|
|
141
|
-
actionmailbox (=
|
|
142
|
-
actionmailer (=
|
|
143
|
-
actionpack (=
|
|
144
|
-
actiontext (=
|
|
145
|
-
actionview (=
|
|
146
|
-
activejob (=
|
|
147
|
-
activemodel (=
|
|
148
|
-
activerecord (=
|
|
149
|
-
activestorage (=
|
|
150
|
-
activesupport (=
|
|
144
|
+
rails (8.0.4)
|
|
145
|
+
actioncable (= 8.0.4)
|
|
146
|
+
actionmailbox (= 8.0.4)
|
|
147
|
+
actionmailer (= 8.0.4)
|
|
148
|
+
actionpack (= 8.0.4)
|
|
149
|
+
actiontext (= 8.0.4)
|
|
150
|
+
actionview (= 8.0.4)
|
|
151
|
+
activejob (= 8.0.4)
|
|
152
|
+
activemodel (= 8.0.4)
|
|
153
|
+
activerecord (= 8.0.4)
|
|
154
|
+
activestorage (= 8.0.4)
|
|
155
|
+
activesupport (= 8.0.4)
|
|
151
156
|
bundler (>= 1.15.0)
|
|
152
|
-
railties (=
|
|
153
|
-
rails-dom-testing (2.
|
|
157
|
+
railties (= 8.0.4)
|
|
158
|
+
rails-dom-testing (2.3.0)
|
|
154
159
|
activesupport (>= 5.0.0)
|
|
155
160
|
minitest
|
|
156
161
|
nokogiri (>= 1.6)
|
|
157
162
|
rails-html-sanitizer (1.6.2)
|
|
158
163
|
loofah (~> 2.21)
|
|
159
164
|
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)
|
|
160
|
-
railties (
|
|
161
|
-
actionpack (=
|
|
162
|
-
activesupport (=
|
|
165
|
+
railties (8.0.4)
|
|
166
|
+
actionpack (= 8.0.4)
|
|
167
|
+
activesupport (= 8.0.4)
|
|
163
168
|
irb (~> 1.13)
|
|
164
169
|
rackup (>= 1.0.0)
|
|
165
170
|
rake (>= 12.2)
|
|
166
171
|
thor (~> 1.0, >= 1.2.2)
|
|
172
|
+
tsort (>= 0.2)
|
|
167
173
|
zeitwerk (~> 2.6)
|
|
168
|
-
rake (13.
|
|
169
|
-
rdoc (
|
|
174
|
+
rake (13.3.1)
|
|
175
|
+
rdoc (7.1.0)
|
|
176
|
+
erb
|
|
170
177
|
psych (>= 4.0.0)
|
|
171
|
-
|
|
178
|
+
tsort
|
|
179
|
+
reline (0.6.3)
|
|
172
180
|
io-console (~> 0.5)
|
|
173
181
|
rspec (3.13.0)
|
|
174
182
|
rspec-core (~> 3.13.0)
|
|
@@ -191,18 +199,20 @@ GEM
|
|
|
191
199
|
rspec-mocks (~> 3.13)
|
|
192
200
|
rspec-support (~> 3.13)
|
|
193
201
|
rspec-support (3.13.2)
|
|
194
|
-
securerandom (0.4.
|
|
195
|
-
stringio (3.
|
|
196
|
-
thor (1.
|
|
197
|
-
timeout (0.
|
|
202
|
+
securerandom (0.4.1)
|
|
203
|
+
stringio (3.2.0)
|
|
204
|
+
thor (1.5.0)
|
|
205
|
+
timeout (0.6.0)
|
|
206
|
+
tsort (0.2.0)
|
|
198
207
|
tzinfo (2.0.6)
|
|
199
208
|
concurrent-ruby (~> 1.0)
|
|
209
|
+
uri (1.1.1)
|
|
200
210
|
useragent (0.16.11)
|
|
201
|
-
websocket-driver (0.
|
|
211
|
+
websocket-driver (0.8.0)
|
|
202
212
|
base64
|
|
203
213
|
websocket-extensions (>= 0.1.0)
|
|
204
214
|
websocket-extensions (0.1.5)
|
|
205
|
-
zeitwerk (2.7.
|
|
215
|
+
zeitwerk (2.7.4)
|
|
206
216
|
|
|
207
217
|
PLATFORMS
|
|
208
218
|
x86_64-linux
|
data/lib/camille/controller.rb
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
module Camille
|
|
2
2
|
module Controller
|
|
3
3
|
class TypeError < ::StandardError; end
|
|
4
|
+
class ParamsTypeError < TypeError; end
|
|
5
|
+
class ResponseTypeError < TypeError; end
|
|
4
6
|
class ArgumentError < ::ArgumentError; end
|
|
5
7
|
class MissingRenderError < ::StandardError; end
|
|
6
8
|
|
|
@@ -23,7 +25,7 @@ module Camille
|
|
|
23
25
|
if result.type_error?
|
|
24
26
|
string_io = StringIO.new
|
|
25
27
|
Camille::TypeErrorPrinter.new(result).print(string_io)
|
|
26
|
-
raise
|
|
28
|
+
raise ResponseTypeError.new("\nType check failed for response.\n#{string_io.string}")
|
|
27
29
|
else
|
|
28
30
|
rendered = result.render.json
|
|
29
31
|
super(json: rendered)
|
|
@@ -52,7 +54,7 @@ module Camille
|
|
|
52
54
|
if check_result.type_error?
|
|
53
55
|
string_io = StringIO.new
|
|
54
56
|
Camille::TypeErrorPrinter.new(check_result).print(string_io)
|
|
55
|
-
raise
|
|
57
|
+
raise ParamsTypeError.new("\nType check failed for params.\n#{string_io.string}")
|
|
56
58
|
else
|
|
57
59
|
# Use the checked value which already has snake_case keys
|
|
58
60
|
self.params = ActionController::Parameters.new(check_result.value)
|
|
@@ -69,6 +71,8 @@ module Camille
|
|
|
69
71
|
raise_missing_render_error
|
|
70
72
|
end
|
|
71
73
|
result
|
|
74
|
+
rescue ParamsTypeError => e
|
|
75
|
+
rescue_with_handler(e) || raise
|
|
72
76
|
rescue ActionController::MissingExactTemplate
|
|
73
77
|
raise_missing_render_error
|
|
74
78
|
end
|
data/lib/camille/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: camille
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.
|
|
4
|
+
version: 1.5.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- merely
|
|
@@ -122,7 +122,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
122
122
|
- !ruby/object:Gem::Version
|
|
123
123
|
version: '0'
|
|
124
124
|
requirements: []
|
|
125
|
-
rubygems_version:
|
|
125
|
+
rubygems_version: 4.0.3
|
|
126
126
|
specification_version: 4
|
|
127
127
|
summary: Typed API schema for Rails with TypeScript codegen
|
|
128
128
|
test_files: []
|