Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade compiler for Tapioca 0.16 #14

Merged
merged 1 commit into from
Aug 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ end

group :development do
gem "sorbet", "~> 0.5.10736"
gem "tapioca", require: false
gem "tapioca", ">= 0.16.0", require: false

gem "rubocop", require: false
gem "rubocop-minitest", require: false
Expand Down
28 changes: 14 additions & 14 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,8 @@ GEM
mustermann (>= 1.0.0)
mutex_m (0.2.0)
netrc (0.11.0)
parallel (1.25.1)
parser (3.3.4.0)
parallel (1.26.1)
parser (3.3.4.2)
ast (~> 2.4.1)
racc
prism (0.30.0)
Expand Down Expand Up @@ -131,27 +131,27 @@ GEM
simplecov_json_formatter (~> 0.1)
simplecov-html (0.12.3)
simplecov_json_formatter (0.1.4)
sorbet (0.5.11506)
sorbet-static (= 0.5.11506)
sorbet-runtime (0.5.11506)
sorbet-static (0.5.11506-aarch64-linux)
sorbet-static (0.5.11506-universal-darwin)
sorbet-static (0.5.11506-x86_64-linux)
sorbet-static-and-runtime (0.5.11506)
sorbet (= 0.5.11506)
sorbet-runtime (= 0.5.11506)
sorbet (0.5.11514)
sorbet-static (= 0.5.11514)
sorbet-runtime (0.5.11514)
sorbet-static (0.5.11514-aarch64-linux)
sorbet-static (0.5.11514-universal-darwin)
sorbet-static (0.5.11514-x86_64-linux)
sorbet-static-and-runtime (0.5.11514)
sorbet (= 0.5.11514)
sorbet-runtime (= 0.5.11514)
spoom (1.4.2)
erubi (>= 1.10.0)
prism (>= 0.28.0)
sorbet-static-and-runtime (>= 0.5.10187)
thor (>= 0.19.2)
stringio (3.1.1)
strscan (3.1.0)
tapioca (0.15.1)
tapioca (0.16.0)
bundler (>= 2.2.25)
netrc (>= 0.11.0)
parallel (>= 1.21.0)
rbi (>= 0.1.4, < 0.2)
rbi (>= 0.1.14, < 0.2)
sorbet-static-and-runtime (>= 0.5.11087)
spoom (>= 1.2.0)
thor (>= 1.2.0)
Expand Down Expand Up @@ -187,7 +187,7 @@ DEPENDENCIES
rubocop-sorbet
simplecov
sorbet (~> 0.5.10736)
tapioca
tapioca (>= 0.16.0)

BUNDLED WITH
2.5.17
43 changes: 18 additions & 25 deletions lib/tapioca/dsl/compilers/grape_endpoints.rb
Original file line number Diff line number Diff line change
Expand Up @@ -174,31 +174,24 @@ def create_callbacks_methods

sig { void }
def create_request_response_methods
sigs = [
request_response_methods_module.create_sig(
parameters: {
args: "Symbol",
block: "T.nilable(T.proc.bind(#{EndpointClassName}).params(e: Exception).void)",
},
return_type: "void",
),
request_response_methods_module.create_sig(
type_parameters: ["E"],
parameters: {
args: "T::Class[T.all(::Exception, T.type_parameter(:E))]",
block: "T.nilable(T.proc.bind(#{EndpointClassName}).params(e: T.type_parameter(:E)).void)",
},
return_type: "void",
),
]
request_response_methods_module.create_method_with_sigs(
"rescue_from",
sigs: sigs,
parameters: [
RBI::RestParam.new("args"),
RBI::BlockParam.new("block"),
],
)
request_response_methods_module.create_method("rescue_from") do |method|
method.add_rest_param("args")
method.add_block_param("block")

method.add_sig do |sig|
sig.add_param("args", "Symbol")
sig.add_param("block", "T.nilable(T.proc.bind(#{EndpointClassName}).params(e: Exception).void)")
sig.return_type = "void"
end
method.add_sig(type_params: ["E"]) do |sig|
sig.add_param("args", "T::Class[T.all(::Exception, T.type_parameter(:E))]")
sig.add_param(
"block",
"T.nilable(T.proc.bind(#{EndpointClassName}).params(e: T.type_parameter(:E)).void)",
)
sig.return_type = "void"
end
end
end

sig { void }
Expand Down
File renamed without changes.
File renamed without changes.
56 changes: 17 additions & 39 deletions sorbet/rbi/gems/[email protected]

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion sorbet/rbi/gems/[email protected]

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

30 changes: 15 additions & 15 deletions sorbet/rbi/gems/[email protected]

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading