grape_sorbet 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/Gemfile.lock +1 -1
- data/README.md +1 -0
- data/lib/grape_sorbet/version.rb +1 -1
- data/rbi/grape.rbi +102 -82
- 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: aa4f8d64cc6cbf5839f525d1c1e246386510695be350c4bf1ed1298b52b8c9a4
|
4
|
+
data.tar.gz: baeca4c981155f04394d3dab717a300c923f41aa063516c4eb0430943e0ba756
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9a7f6cb172c0c73adf41a2992b620f45962459baeeb7f19cc916036776a010018a28a5f0dac752a55a2e1c623ee4e394a6654fd3f2139750e73fdc278a5f8a6d
|
7
|
+
data.tar.gz: 59580b70030d1d8d013191c55671a82daa854e1a536ecc67acb1a1ee70e1e907086a76b9eddb5022eadb03161c0043c241c7fc5f8a831c4cdf0b1c0f12e09597
|
data/CHANGELOG.md
CHANGED
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
# grape_sorbet
|
2
2
|
|
3
3
|
[![Build Status](https://github.com/thatch-health/grape_sorbet/actions/workflows/main.yml/badge.svg?branch=main)](https://github.com/thatch-health/grape_sorbet/actions?query=branch%3Amain)
|
4
|
+
[![Gem Version ](https://img.shields.io/gem/v/grape_sorbet.svg?style=flat)](https://rubygems.org/gems/grape_sorbet)
|
4
5
|
|
5
6
|
grape_sorbet is a gem that provides hand written signatures and a Tapioca DSL compiler that makes it more pleasant to use the [Grape](https://github.com/ruby-grape/grape) API framework in Ruby projects that use the [Sorbet](https://sorbet.org/) typechecker.
|
6
7
|
|
data/lib/grape_sorbet/version.rb
CHANGED
data/rbi/grape.rbi
CHANGED
@@ -2,102 +2,122 @@
|
|
2
2
|
# frozen_string_literal: true
|
3
3
|
|
4
4
|
module Grape
|
5
|
-
module DSL
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
5
|
+
module DSL
|
6
|
+
module Desc
|
7
|
+
# grape evaluates config_block in the context of a dynamically created module that implements the DSL it exposes
|
8
|
+
# at runtime. There's no good way to represent this statically, so block is just typed as T.untyped to prevent
|
9
|
+
# Sorbet from complaining that the DSL methods don't exist.
|
10
|
+
sig do
|
11
|
+
params(
|
12
|
+
description: String,
|
13
|
+
options: T.nilable(T::Hash[Symbol, T.untyped]),
|
14
|
+
config_block: T.nilable(T.proc.bind(T.untyped).void),
|
15
|
+
).void
|
16
|
+
end
|
17
|
+
def desc(description, options = T.unsafe(nil), &config_block); end
|
15
18
|
end
|
16
|
-
def desc(description, options = T.unsafe(nil), &config_block); end
|
17
|
-
end
|
18
|
-
|
19
|
-
module DSL::RequestResponse::ClassMethods
|
20
|
-
sig { params(args: T.untyped, block: T.proc.bind(Grape::Endpoint).void).void }
|
21
|
-
def rescue_from(*args, &block); end
|
22
|
-
end
|
23
19
|
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
block: T.nilable(T.proc.bind(Grape::Endpoint).void),
|
30
|
-
).void
|
20
|
+
module Helpers
|
21
|
+
module BaseHelper
|
22
|
+
sig { params(name: Symbol, block: T.proc.bind(Grape::Validations::ParamsScope).void).void }
|
23
|
+
def params(name, &block); end
|
24
|
+
end
|
31
25
|
end
|
32
|
-
def delete(*args, &block); end
|
33
26
|
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
args
|
38
|
-
|
39
|
-
).void
|
27
|
+
module RequestResponse
|
28
|
+
module ClassMethods
|
29
|
+
sig { params(args: T.untyped, block: T.proc.bind(Grape::Endpoint).void).void }
|
30
|
+
def rescue_from(*args, &block); end
|
31
|
+
end
|
40
32
|
end
|
41
|
-
def get(*args, &block); end
|
42
33
|
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
34
|
+
module Routing
|
35
|
+
module ClassMethods
|
36
|
+
# @shim: https://github.com/ruby-grape/grape/blob/v2.0.0/lib/grape/dsl/routing.rb#L148-L154
|
37
|
+
sig do
|
38
|
+
params(
|
39
|
+
args: T.untyped,
|
40
|
+
block: T.nilable(T.proc.bind(Grape::Endpoint).void),
|
41
|
+
).void
|
42
|
+
end
|
43
|
+
def delete(*args, &block); end
|
51
44
|
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
45
|
+
# @shim: https://github.com/ruby-grape/grape/blob/v2.0.0/lib/grape/dsl/routing.rb#L148-L154
|
46
|
+
sig do
|
47
|
+
params(
|
48
|
+
args: T.untyped,
|
49
|
+
block: T.nilable(T.proc.bind(Grape::Endpoint).void),
|
50
|
+
).void
|
51
|
+
end
|
52
|
+
def get(*args, &block); end
|
60
53
|
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
54
|
+
# @shim: https://github.com/ruby-grape/grape/blob/v2.0.0/lib/grape/dsl/routing.rb#L148-L154
|
55
|
+
sig do
|
56
|
+
params(
|
57
|
+
args: T.untyped,
|
58
|
+
block: T.nilable(T.proc.bind(Grape::Endpoint).void),
|
59
|
+
).void
|
60
|
+
end
|
61
|
+
def options(*args, &block); end
|
69
62
|
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
63
|
+
# @shim: https://github.com/ruby-grape/grape/blob/v2.0.0/lib/grape/dsl/routing.rb#L148-L154
|
64
|
+
sig do
|
65
|
+
params(
|
66
|
+
args: T.untyped,
|
67
|
+
block: T.nilable(T.proc.bind(Grape::Endpoint).void),
|
68
|
+
).void
|
69
|
+
end
|
70
|
+
def patch(*args, &block); end
|
71
|
+
|
72
|
+
# @shim: https://github.com/ruby-grape/grape/blob/v2.0.0/lib/grape/dsl/routing.rb#L148-L154
|
73
|
+
sig do
|
74
|
+
params(
|
75
|
+
args: T.untyped,
|
76
|
+
block: T.nilable(T.proc.bind(Grape::Endpoint).void),
|
77
|
+
).void
|
78
|
+
end
|
79
|
+
def post(*args, &block); end
|
80
|
+
|
81
|
+
# @shim: https://github.com/ruby-grape/grape/blob/v2.0.0/lib/grape/dsl/routing.rb#L148-L154
|
82
|
+
sig do
|
83
|
+
params(
|
84
|
+
args: T.untyped,
|
85
|
+
block: T.nilable(T.proc.bind(Grape::Endpoint).void),
|
86
|
+
).void
|
87
|
+
end
|
88
|
+
def put(*args, &block); end
|
89
|
+
|
90
|
+
sig do
|
91
|
+
params(
|
92
|
+
methods: T.any(Symbol, String, T::Array[String]),
|
93
|
+
paths: T.nilable(T.any(String, T::Array[String])),
|
94
|
+
route_options: T.nilable(T::Hash[Symbol, T.untyped]),
|
95
|
+
block: T.nilable(T.proc.bind(Grape::Endpoint).void),
|
96
|
+
).void
|
97
|
+
end
|
98
|
+
def route(methods, paths = T.unsafe(nil), route_options = T.unsafe(nil), &block); end
|
78
99
|
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
100
|
+
sig do
|
101
|
+
params(
|
102
|
+
param: Symbol,
|
103
|
+
options: T.nilable(T::Hash[Symbol, T.untyped]),
|
104
|
+
block: T.nilable(T.proc.bind(T.class_of(Grape::API::Instance)).void),
|
105
|
+
).void
|
106
|
+
end
|
107
|
+
def route_param(param, options = T.unsafe(nil), &block); end
|
108
|
+
end
|
86
109
|
end
|
87
|
-
def route(methods, paths = T.unsafe(nil), route_options = T.unsafe(nil), &block); end
|
88
110
|
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
).void
|
111
|
+
module Validations
|
112
|
+
module ClassMethods
|
113
|
+
sig { params(block: T.proc.bind(Grape::Validations::ParamsScope).void).void }
|
114
|
+
def params(&block); end
|
115
|
+
end
|
95
116
|
end
|
96
|
-
def route_param(param, options = T.unsafe(nil), &block); end
|
97
117
|
end
|
98
118
|
|
99
|
-
|
100
|
-
sig {
|
101
|
-
def
|
119
|
+
class Endpoint
|
120
|
+
sig { returns(Grape::Request) }
|
121
|
+
def request; end
|
102
122
|
end
|
103
123
|
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.4
|
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-06-
|
11
|
+
date: 2024-06-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -98,7 +98,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
98
98
|
- !ruby/object:Gem::Version
|
99
99
|
version: '0'
|
100
100
|
requirements: []
|
101
|
-
rubygems_version: 3.5.
|
101
|
+
rubygems_version: 3.5.13
|
102
102
|
signing_key:
|
103
103
|
specification_version: 4
|
104
104
|
summary: Sorbet signatures and Tapioca DSL compiler for Grape.
|