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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: afca4010268efe01d37b64b7cfd4bbd7f6266779a3a135ab04fe14869ab71daf
4
- data.tar.gz: ee494b0147c0b9d32ae90a5a1fba81218687b26396131a56ff9a1bb16306d693
3
+ metadata.gz: aa4f8d64cc6cbf5839f525d1c1e246386510695be350c4bf1ed1298b52b8c9a4
4
+ data.tar.gz: baeca4c981155f04394d3dab717a300c923f41aa063516c4eb0430943e0ba756
5
5
  SHA512:
6
- metadata.gz: 122aa7dab2572d6df1cfc79a3ec7a80b652f5ad7d5d51d87b0e9077385e3fb8041fd75b190f76ce4c58b4f1aea575dd1194d505b21c5d9ff32d80b9fca1aa33a
7
- data.tar.gz: 4eb298722d0e14cb745a20917899825463fd50d6b87b0e1d9541566c9bc5961effec782c7ec767cacc9bcf37536596e0f885c3ae9eb5bdf60717f32d1833c341
6
+ metadata.gz: 9a7f6cb172c0c73adf41a2992b620f45962459baeeb7f19cc916036776a010018a28a5f0dac752a55a2e1c623ee4e394a6654fd3f2139750e73fdc278a5f8a6d
7
+ data.tar.gz: 59580b70030d1d8d013191c55671a82daa854e1a536ecc67acb1a1ee70e1e907086a76b9eddb5022eadb03161c0043c241c7fc5f8a831c4cdf0b1c0f12e09597
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ ## 0.0.4 (2024-06-24)
2
+
3
+ - Update `grape.rbi`
4
+
1
5
  ## 0.0.3 (2024-06-05)
2
6
 
3
7
  - Better support for callbacks
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- grape_sorbet (0.0.3)
4
+ grape_sorbet (0.0.4)
5
5
  activesupport
6
6
  grape (~> 2.0)
7
7
  sorbet-runtime (~> 0.5.10741)
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
 
@@ -2,5 +2,5 @@
2
2
  # frozen_string_literal: true
3
3
 
4
4
  module GrapeSorbet
5
- VERSION = "0.0.3"
5
+ VERSION = "0.0.4"
6
6
  end
data/rbi/grape.rbi CHANGED
@@ -2,102 +2,122 @@
2
2
  # frozen_string_literal: true
3
3
 
4
4
  module Grape
5
- module DSL::Desc
6
- # grape evaluates config_block in the context of a dynamically created module that implements the DSL it exposes
7
- # at runtime. There's no good way to represent this statically, so block is just typed as T.untyped to prevent
8
- # Sorbet from complaining that the DSL methods don't exist.
9
- sig do
10
- params(
11
- description: String,
12
- options: T.nilable(T::Hash[Symbol, T.untyped]),
13
- config_block: T.nilable(T.proc.bind(T.untyped).void),
14
- ).void
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
- module DSL::Routing::ClassMethods
25
- # @shim: https://github.com/ruby-grape/grape/blob/v2.0.0/lib/grape/dsl/routing.rb#L148-L154
26
- sig do
27
- params(
28
- args: T.untyped,
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
- # @shim: https://github.com/ruby-grape/grape/blob/v2.0.0/lib/grape/dsl/routing.rb#L148-L154
35
- sig do
36
- params(
37
- args: T.untyped,
38
- block: T.nilable(T.proc.bind(Grape::Endpoint).void),
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
- # @shim: https://github.com/ruby-grape/grape/blob/v2.0.0/lib/grape/dsl/routing.rb#L148-L154
44
- sig do
45
- params(
46
- args: T.untyped,
47
- block: T.nilable(T.proc.bind(Grape::Endpoint).void),
48
- ).void
49
- end
50
- def options(*args, &block); end
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
- # @shim: https://github.com/ruby-grape/grape/blob/v2.0.0/lib/grape/dsl/routing.rb#L148-L154
53
- sig do
54
- params(
55
- args: T.untyped,
56
- block: T.nilable(T.proc.bind(Grape::Endpoint).void),
57
- ).void
58
- end
59
- def patch(*args, &block); end
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
- # @shim: https://github.com/ruby-grape/grape/blob/v2.0.0/lib/grape/dsl/routing.rb#L148-L154
62
- sig do
63
- params(
64
- args: T.untyped,
65
- block: T.nilable(T.proc.bind(Grape::Endpoint).void),
66
- ).void
67
- end
68
- def post(*args, &block); end
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
- # @shim: https://github.com/ruby-grape/grape/blob/v2.0.0/lib/grape/dsl/routing.rb#L148-L154
71
- sig do
72
- params(
73
- args: T.untyped,
74
- block: T.nilable(T.proc.bind(Grape::Endpoint).void),
75
- ).void
76
- end
77
- def put(*args, &block); end
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
- sig do
80
- params(
81
- methods: T.any(Symbol, String, T::Array[String]),
82
- paths: T.nilable(T.any(String, T::Array[String])),
83
- route_options: T.nilable(T::Hash[Symbol, T.untyped]),
84
- block: T.nilable(T.proc.bind(Grape::Endpoint).void),
85
- ).void
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
- sig do
90
- params(
91
- param: Symbol,
92
- options: T.nilable(T::Hash[Symbol, T.untyped]),
93
- block: T.nilable(T.proc.bind(T.class_of(Grape::API::Instance)).void),
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
- module DSL::Validations::ClassMethods
100
- sig { params(block: T.proc.bind(Grape::Validations::ParamsScope).void).void }
101
- def params(&block); end
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.3
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-05 00:00:00.000000000 Z
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.9
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.