grape_sorbet 0.0.10 → 0.0.12
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/.rubocop.yml +1 -1
- data/.ruby-version +1 -1
- data/CHANGELOG.md +18 -9
- data/Gemfile +1 -1
- data/Gemfile.lock +28 -28
- data/lib/grape_sorbet/version.rb +1 -1
- data/lib/tapioca/dsl/compilers/grape_endpoints.rb +18 -25
- data/rbi/grape.rbi +17 -3
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b72c831ecdbbb12f01e23bcbf0687d71c3a2c3c6301454bbb51ca22e8de1cbea
|
4
|
+
data.tar.gz: b139c41353dc24248152cf1b69079e028c3aa9c5add5df285adf1f06513def87
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ea559dae383fba80acba9d2f8b43c750ee7324b582df20f55552d0c09cb96eb7c3f1689764f7205f11383e97813113d7266c0d4c8826f8be8e07b8ff62452e86
|
7
|
+
data.tar.gz: f4c41761728a361f9838b8a307722f95679d6209d16cd40072aaba4334cf512ac64c8a77f54ac4b751f2e6f9dfad969677da0df4f927cee97d1ed35a0a24ca06
|
data/.rubocop.yml
CHANGED
data/.ruby-version
CHANGED
@@ -1 +1 @@
|
|
1
|
-
3.3.
|
1
|
+
3.3.4
|
data/CHANGELOG.md
CHANGED
@@ -1,38 +1,47 @@
|
|
1
|
+
## 0.0.12 (2024-08-08)
|
2
|
+
|
3
|
+
- Upgrade compiler for Tapioca 0.16 (#14)
|
4
|
+
- Bump dependencies and update RBI signatures (#13)
|
5
|
+
|
6
|
+
## 0.0.11 (2024-07-15)
|
7
|
+
|
8
|
+
- Add support for `options` param in `params` type signature (#12)
|
9
|
+
|
1
10
|
## 0.0.10 (2024-07-15)
|
2
11
|
|
3
|
-
- Add missing `extend`s to `PrivateAPIInstance`
|
12
|
+
- Add missing `extend`s to `PrivateAPIInstance` (#11)
|
4
13
|
|
5
14
|
## 0.0.9 (2024-07-15)
|
6
15
|
|
7
|
-
- Entity name setter method
|
16
|
+
- Entity name setter method (#10)
|
8
17
|
|
9
18
|
## 0.0.8 (2024-07-12)
|
10
19
|
|
11
|
-
- Improve types for `rescue_from`
|
20
|
+
- Improve types for `rescue_from` (#8)
|
12
21
|
|
13
22
|
## 0.0.7 (2024-07-03)
|
14
23
|
|
15
|
-
- Add signatures for `error!` and a few other methods
|
24
|
+
- Add signatures for `error!` and a few other methods (#6)
|
16
25
|
|
17
26
|
## 0.0.6 (2024-06-25)
|
18
27
|
|
19
|
-
- Add support for `rescue_from`
|
28
|
+
- Add support for `rescue_from` (#5)
|
20
29
|
|
21
30
|
## 0.0.5 (2024-06-24)
|
22
31
|
|
23
|
-
- Ignore anonymous helpers
|
32
|
+
- Ignore anonymous helpers (#4)
|
24
33
|
|
25
34
|
## 0.0.4 (2024-06-24)
|
26
35
|
|
27
|
-
- Update `grape.rbi`
|
36
|
+
- Update `grape.rbi` (#3)
|
28
37
|
|
29
38
|
## 0.0.3 (2024-06-05)
|
30
39
|
|
31
|
-
- Better support for callbacks
|
40
|
+
- Better support for callbacks (#2)
|
32
41
|
|
33
42
|
## 0.0.2 (2024-06-05)
|
34
43
|
|
35
|
-
- Added support for callbacks (`before`, `after`, etc.)
|
44
|
+
- Added support for callbacks (`before`, `after`, etc.) (#1)
|
36
45
|
|
37
46
|
## 0.0.1 (2024-06-04)
|
38
47
|
|
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
grape_sorbet (0.0.
|
4
|
+
grape_sorbet (0.0.12)
|
5
5
|
activesupport
|
6
6
|
grape (~> 2.0)
|
7
7
|
sorbet-runtime (~> 0.5.10741)
|
@@ -29,7 +29,7 @@ GEM
|
|
29
29
|
thor (~> 1.0)
|
30
30
|
concurrent-ruby (1.3.3)
|
31
31
|
connection_pool (2.4.1)
|
32
|
-
docile (1.4.
|
32
|
+
docile (1.4.1)
|
33
33
|
drb (2.2.1)
|
34
34
|
dry-core (1.0.1)
|
35
35
|
concurrent-ruby (~> 1.0)
|
@@ -47,7 +47,7 @@ GEM
|
|
47
47
|
dry-logic (~> 1.4)
|
48
48
|
zeitwerk (~> 2.6)
|
49
49
|
erubi (1.13.0)
|
50
|
-
grape (2.1.
|
50
|
+
grape (2.1.3)
|
51
51
|
activesupport (>= 6)
|
52
52
|
dry-types (>= 1.1)
|
53
53
|
mustermann-grape (~> 1.1.0)
|
@@ -71,24 +71,24 @@ GEM
|
|
71
71
|
minitest (>= 5.0)
|
72
72
|
ruby-progressbar
|
73
73
|
multi_json (1.15.0)
|
74
|
-
mustermann (3.0.
|
74
|
+
mustermann (3.0.1)
|
75
75
|
ruby2_keywords (~> 0.0.1)
|
76
76
|
mustermann-grape (1.1.0)
|
77
77
|
mustermann (>= 1.0.0)
|
78
78
|
mutex_m (0.2.0)
|
79
79
|
netrc (0.11.0)
|
80
|
-
parallel (1.
|
81
|
-
parser (3.3.4.
|
80
|
+
parallel (1.26.1)
|
81
|
+
parser (3.3.4.2)
|
82
82
|
ast (~> 2.4.1)
|
83
83
|
racc
|
84
84
|
prism (0.30.0)
|
85
85
|
psych (5.1.2)
|
86
86
|
stringio
|
87
|
-
racc (1.8.
|
87
|
+
racc (1.8.1)
|
88
88
|
rack (3.1.7)
|
89
89
|
rainbow (3.1.1)
|
90
90
|
rake (13.2.1)
|
91
|
-
rbi (0.1.
|
91
|
+
rbi (0.1.14)
|
92
92
|
prism (>= 0.18.0, < 1.0.0)
|
93
93
|
sorbet-runtime (>= 0.5.9204)
|
94
94
|
rdoc (6.7.0)
|
@@ -96,9 +96,9 @@ GEM
|
|
96
96
|
regexp_parser (2.9.2)
|
97
97
|
reline (0.5.9)
|
98
98
|
io-console (~> 0.5)
|
99
|
-
rexml (3.3.
|
99
|
+
rexml (3.3.4)
|
100
100
|
strscan
|
101
|
-
rubocop (1.65.
|
101
|
+
rubocop (1.65.1)
|
102
102
|
json (~> 2.3)
|
103
103
|
language_server-protocol (>= 3.17.0)
|
104
104
|
parallel (~> 1.10)
|
@@ -109,7 +109,7 @@ GEM
|
|
109
109
|
rubocop-ast (>= 1.31.1, < 2.0)
|
110
110
|
ruby-progressbar (~> 1.7)
|
111
111
|
unicode-display_width (>= 2.4.0, < 3.0)
|
112
|
-
rubocop-ast (1.
|
112
|
+
rubocop-ast (1.32.0)
|
113
113
|
parser (>= 3.3.1.0)
|
114
114
|
rubocop-minitest (0.35.1)
|
115
115
|
rubocop (>= 1.61, < 2.0)
|
@@ -121,8 +121,8 @@ GEM
|
|
121
121
|
rubocop (~> 1.0)
|
122
122
|
rubocop-shopify (2.15.1)
|
123
123
|
rubocop (~> 1.51)
|
124
|
-
rubocop-sorbet (0.8.
|
125
|
-
rubocop (>=
|
124
|
+
rubocop-sorbet (0.8.5)
|
125
|
+
rubocop (>= 1)
|
126
126
|
ruby-progressbar (1.13.0)
|
127
127
|
ruby2_keywords (0.0.5)
|
128
128
|
simplecov (0.22.0)
|
@@ -131,27 +131,27 @@ GEM
|
|
131
131
|
simplecov_json_formatter (~> 0.1)
|
132
132
|
simplecov-html (0.12.3)
|
133
133
|
simplecov_json_formatter (0.1.4)
|
134
|
-
sorbet (0.5.
|
135
|
-
sorbet-static (= 0.5.
|
136
|
-
sorbet-runtime (0.5.
|
137
|
-
sorbet-static (0.5.
|
138
|
-
sorbet-static (0.5.
|
139
|
-
sorbet-static (0.5.
|
140
|
-
sorbet-static-and-runtime (0.5.
|
141
|
-
sorbet (= 0.5.
|
142
|
-
sorbet-runtime (= 0.5.
|
143
|
-
spoom (1.
|
134
|
+
sorbet (0.5.11514)
|
135
|
+
sorbet-static (= 0.5.11514)
|
136
|
+
sorbet-runtime (0.5.11514)
|
137
|
+
sorbet-static (0.5.11514-aarch64-linux)
|
138
|
+
sorbet-static (0.5.11514-universal-darwin)
|
139
|
+
sorbet-static (0.5.11514-x86_64-linux)
|
140
|
+
sorbet-static-and-runtime (0.5.11514)
|
141
|
+
sorbet (= 0.5.11514)
|
142
|
+
sorbet-runtime (= 0.5.11514)
|
143
|
+
spoom (1.4.2)
|
144
144
|
erubi (>= 1.10.0)
|
145
145
|
prism (>= 0.28.0)
|
146
146
|
sorbet-static-and-runtime (>= 0.5.10187)
|
147
147
|
thor (>= 0.19.2)
|
148
148
|
stringio (3.1.1)
|
149
149
|
strscan (3.1.0)
|
150
|
-
tapioca (0.
|
150
|
+
tapioca (0.16.0)
|
151
151
|
bundler (>= 2.2.25)
|
152
152
|
netrc (>= 0.11.0)
|
153
153
|
parallel (>= 1.21.0)
|
154
|
-
rbi (>= 0.1.
|
154
|
+
rbi (>= 0.1.14, < 0.2)
|
155
155
|
sorbet-static-and-runtime (>= 0.5.11087)
|
156
156
|
spoom (>= 1.2.0)
|
157
157
|
thor (>= 1.2.0)
|
@@ -164,7 +164,7 @@ GEM
|
|
164
164
|
yard-sorbet (0.9.0)
|
165
165
|
sorbet-runtime
|
166
166
|
yard
|
167
|
-
zeitwerk (2.6.
|
167
|
+
zeitwerk (2.6.17)
|
168
168
|
|
169
169
|
PLATFORMS
|
170
170
|
aarch64-linux
|
@@ -187,7 +187,7 @@ DEPENDENCIES
|
|
187
187
|
rubocop-sorbet
|
188
188
|
simplecov
|
189
189
|
sorbet (~> 0.5.10736)
|
190
|
-
tapioca
|
190
|
+
tapioca (>= 0.16.0)
|
191
191
|
|
192
192
|
BUNDLED WITH
|
193
|
-
2.5.
|
193
|
+
2.5.17
|
data/lib/grape_sorbet/version.rb
CHANGED
@@ -174,31 +174,24 @@ module Tapioca
|
|
174
174
|
|
175
175
|
sig { void }
|
176
176
|
def create_request_response_methods
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
block
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
"rescue_from",
|
196
|
-
sigs: sigs,
|
197
|
-
parameters: [
|
198
|
-
RBI::RestParam.new("args"),
|
199
|
-
RBI::BlockParam.new("block"),
|
200
|
-
],
|
201
|
-
)
|
177
|
+
request_response_methods_module.create_method("rescue_from") do |method|
|
178
|
+
method.add_rest_param("args")
|
179
|
+
method.add_block_param("block")
|
180
|
+
|
181
|
+
method.add_sig do |sig|
|
182
|
+
sig.add_param("args", "Symbol")
|
183
|
+
sig.add_param("block", "T.nilable(T.proc.bind(#{EndpointClassName}).params(e: Exception).void)")
|
184
|
+
sig.return_type = "void"
|
185
|
+
end
|
186
|
+
method.add_sig(type_params: ["E"]) do |sig|
|
187
|
+
sig.add_param("args", "T::Class[T.all(::Exception, T.type_parameter(:E))]")
|
188
|
+
sig.add_param(
|
189
|
+
"block",
|
190
|
+
"T.nilable(T.proc.bind(#{EndpointClassName}).params(e: T.type_parameter(:E)).void)",
|
191
|
+
)
|
192
|
+
sig.return_type = "void"
|
193
|
+
end
|
194
|
+
end
|
202
195
|
end
|
203
196
|
|
204
197
|
sig { void }
|
data/rbi/grape.rbi
CHANGED
@@ -19,12 +19,22 @@ module Grape
|
|
19
19
|
|
20
20
|
module Helpers
|
21
21
|
module BaseHelper
|
22
|
-
sig
|
22
|
+
sig do
|
23
|
+
params(
|
24
|
+
name: Symbol,
|
25
|
+
block: T.proc.bind(Grape::Validations::ParamsScope).params(options: T::Hash[Symbol, T.untyped]).void,
|
26
|
+
).void
|
27
|
+
end
|
23
28
|
def params(name, &block); end
|
24
29
|
end
|
25
30
|
|
26
31
|
module ClassMethods
|
27
|
-
sig
|
32
|
+
sig do
|
33
|
+
params(
|
34
|
+
new_modules: T.untyped,
|
35
|
+
block: T.nilable(T.proc.bind(Grape::DSL::Helpers::BaseHelper).void),
|
36
|
+
).void
|
37
|
+
end
|
28
38
|
def helpers(*new_modules, &block); end
|
29
39
|
end
|
30
40
|
end
|
@@ -35,9 +45,13 @@ module Grape
|
|
35
45
|
message: T.any(String, T::Hash[Symbol, T.untyped]),
|
36
46
|
status: T.nilable(T.any(Integer, Symbol)),
|
37
47
|
additional_headers: T.nilable(T::Hash[String, String]),
|
48
|
+
backtrace: T.nilable(T::Array[String]),
|
49
|
+
original_exception: T.nilable(Exception),
|
38
50
|
).returns(T.noreturn)
|
39
51
|
end
|
40
|
-
def error!(message, status = nil, additional_headers = nil)
|
52
|
+
def error!(message, status = T.unsafe(nil), additional_headers = T.unsafe(nil), backtrace = T.unsafe(nil),
|
53
|
+
original_exception = T.unsafe(nil))
|
54
|
+
end
|
41
55
|
|
42
56
|
sig { params(status: T.nilable(T.any(Integer, Symbol))).returns(Integer) }
|
43
57
|
def status(status = nil); end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: grape_sorbet
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.12
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Thatch Health, Inc.
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-
|
11
|
+
date: 2024-08-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -99,7 +99,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
99
99
|
- !ruby/object:Gem::Version
|
100
100
|
version: '0'
|
101
101
|
requirements: []
|
102
|
-
rubygems_version: 3.5.
|
102
|
+
rubygems_version: 3.5.11
|
103
103
|
signing_key:
|
104
104
|
specification_version: 4
|
105
105
|
summary: Sorbet signatures and Tapioca DSL compiler for Grape.
|