sorbet-result 1.2.0 → 1.3.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/.ruby-version +1 -1
- data/CHANGELOG.md +6 -0
- data/Gemfile.lock +73 -51
- data/README.md +1 -1
- data/lib/typed/no_payload_on_failure_error.rb +8 -3
- data/lib/typed/result.rb +1 -1
- data/sorbet/rbi/gems/{ast@2.4.2.rbi → ast@2.4.3.rbi} +3 -3
- data/sorbet/rbi/gems/benchmark@0.4.1.rbi +619 -0
- data/sorbet/rbi/gems/cgi@0.5.0.rbi +2961 -0
- data/sorbet/rbi/gems/date@3.4.1.rbi +75 -0
- data/sorbet/rbi/gems/erb@4.0.4.rbi +910 -0
- data/sorbet/rbi/gems/{erubi@1.13.0.rbi → erubi@1.13.1.rbi} +14 -9
- data/sorbet/rbi/gems/{json@2.7.5.rbi → json@2.12.2.rbi} +654 -232
- data/sorbet/rbi/gems/{language_server-protocol@3.17.0.3.rbi → language_server-protocol@3.17.0.5.rbi} +11 -5
- data/sorbet/rbi/gems/logger@1.7.0.rbi +963 -0
- data/sorbet/rbi/gems/{minitest@5.25.1.rbi → minitest@5.25.5.rbi} +227 -220
- data/sorbet/rbi/gems/{parser@3.3.5.1.rbi → parser@3.3.8.0.rbi} +215 -199
- data/sorbet/rbi/gems/pp@0.6.2.rbi +368 -0
- data/sorbet/rbi/gems/prettyprint@0.2.0.rbi +477 -0
- data/sorbet/rbi/gems/{prism@1.2.0.rbi → prism@1.4.0.rbi} +6569 -3922
- data/sorbet/rbi/gems/{psych@5.1.2.rbi → psych@5.2.6.rbi} +973 -236
- data/sorbet/rbi/gems/{rake@13.2.1.rbi → rake@13.3.0.rbi} +15 -12
- data/sorbet/rbi/gems/{rbi@0.2.1.rbi → rbi@0.3.6.rbi} +3340 -982
- data/sorbet/rbi/gems/rbs@3.9.4.rbi +6976 -0
- data/sorbet/rbi/gems/{regexp_parser@2.9.2.rbi → regexp_parser@2.10.0.rbi} +193 -170
- data/sorbet/rbi/gems/{rubocop-ast@1.33.1.rbi → rubocop-ast@1.45.1.rbi} +1069 -826
- data/sorbet/rbi/gems/{rubocop@1.66.1.rbi → rubocop@1.75.8.rbi} +7880 -4054
- data/sorbet/rbi/gems/{spoom@1.5.0.rbi → spoom@1.6.1.rbi} +3315 -973
- data/sorbet/rbi/gems/{standard@1.41.1.rbi → standard@1.50.0.rbi} +68 -59
- data/sorbet/rbi/gems/{tapioca@0.16.3.rbi → tapioca@0.16.11.rbi} +273 -248
- data/sorbet/rbi/gems/unicode-display_width@3.1.4.rbi +132 -0
- data/sorbet/rbi/gems/unicode-emoji@4.0.4.rbi +251 -0
- metadata +41 -33
- data/.tool-versions +0 -1
- data/sorbet/rbi/gems/unicode-display_width@2.6.0.rbi +0 -66
- /data/sorbet/rbi/gems/{io-console@0.7.2.rbi → io-console@0.8.0.rbi} +0 -0
- /data/sorbet/rbi/gems/{parallel@1.26.3.rbi → parallel@1.27.0.rbi} +0 -0
- /data/sorbet/rbi/gems/{reline@0.5.10.rbi → reline@0.6.1.rbi} +0 -0
- /data/sorbet/rbi/gems/{rubocop-performance@1.22.1.rbi → rubocop-performance@1.25.0.rbi} +0 -0
- /data/sorbet/rbi/gems/{rubocop-sorbet@0.7.8.rbi → rubocop-sorbet@0.9.0.rbi} +0 -0
- /data/sorbet/rbi/gems/{standard-performance@1.5.0.rbi → standard-performance@1.8.0.rbi} +0 -0
- /data/sorbet/rbi/gems/{standard-sorbet@0.0.2.rbi → standard-sorbet@0.0.3.rbi} +0 -0
- /data/sorbet/rbi/gems/{stringio@3.1.1.rbi → stringio@3.1.7.rbi} +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9283d02fabd31c86d614eae2c2cb72aa87f38a4769acff196ac0021460282307
|
4
|
+
data.tar.gz: 74b5fba1a9296cfad0fadae13a7df80e23f45e4ef766a172abdde9ff97e4932f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4c59bda910e9a16117f9573426d9fd4a6edd0fc75f03918d3540445d035e9ef6e240a08acfba34c9ba9c25565f9f1287d959af22977b8c8f665cc938b06e116e
|
7
|
+
data.tar.gz: 67ffd89d399ef5b79b2b1752de24fc92d03aaa47f7a455fc40945e11e2f34def317197241f95d1828723059226c7ff630d8a7b69d52b4eb7d0882c06b8f476d1
|
data/.ruby-version
CHANGED
@@ -1 +1 @@
|
|
1
|
-
3.
|
1
|
+
3.1.4
|
data/CHANGELOG.md
CHANGED
@@ -6,6 +6,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
6
6
|
|
7
7
|
## [Unreleased]
|
8
8
|
|
9
|
+
## [1.3.0] - 2025-06-29
|
10
|
+
|
11
|
+
### Added
|
12
|
+
|
13
|
+
- Added error details to `Typed::NoPayloadOnFailureError` error message
|
14
|
+
|
9
15
|
## [1.2.0] - 2024-11-03
|
10
16
|
|
11
17
|
### Added
|
data/Gemfile.lock
CHANGED
@@ -1,92 +1,112 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
sorbet-result (1.
|
4
|
+
sorbet-result (1.3.0)
|
5
5
|
sorbet-runtime (~> 0.5)
|
6
6
|
|
7
7
|
GEM
|
8
8
|
remote: https://rubygems.org/
|
9
9
|
specs:
|
10
|
-
ast (2.4.
|
11
|
-
|
10
|
+
ast (2.4.3)
|
11
|
+
benchmark (0.4.1)
|
12
|
+
cgi (0.5.0)
|
13
|
+
date (3.4.1)
|
14
|
+
debug (1.11.0)
|
12
15
|
irb (~> 1.10)
|
13
16
|
reline (>= 0.3.8)
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
+
erb (4.0.4)
|
18
|
+
cgi (>= 0.3.3)
|
19
|
+
erubi (1.13.1)
|
20
|
+
io-console (0.8.0)
|
21
|
+
irb (1.15.2)
|
22
|
+
pp (>= 0.6.0)
|
17
23
|
rdoc (>= 4.0.0)
|
18
24
|
reline (>= 0.4.2)
|
19
|
-
json (2.
|
20
|
-
language_server-protocol (3.17.0.
|
25
|
+
json (2.12.2)
|
26
|
+
language_server-protocol (3.17.0.5)
|
21
27
|
lint_roller (1.1.0)
|
22
|
-
|
28
|
+
logger (1.7.0)
|
29
|
+
minitest (5.25.5)
|
23
30
|
netrc (0.11.0)
|
24
|
-
parallel (1.
|
25
|
-
parser (3.3.
|
31
|
+
parallel (1.27.0)
|
32
|
+
parser (3.3.8.0)
|
26
33
|
ast (~> 2.4.1)
|
27
34
|
racc
|
28
|
-
|
29
|
-
|
35
|
+
pp (0.6.2)
|
36
|
+
prettyprint
|
37
|
+
prettyprint (0.2.0)
|
38
|
+
prism (1.4.0)
|
39
|
+
psych (5.2.6)
|
40
|
+
date
|
30
41
|
stringio
|
31
42
|
racc (1.8.1)
|
32
43
|
rainbow (3.1.1)
|
33
|
-
rake (13.
|
34
|
-
rbi (0.
|
44
|
+
rake (13.3.0)
|
45
|
+
rbi (0.3.6)
|
35
46
|
prism (~> 1.0)
|
36
|
-
|
37
|
-
|
47
|
+
rbs (>= 3.4.4)
|
48
|
+
rbs (3.9.4)
|
49
|
+
logger
|
50
|
+
rdoc (6.14.1)
|
51
|
+
erb
|
38
52
|
psych (>= 4.0.0)
|
39
|
-
regexp_parser (2.
|
40
|
-
reline (0.
|
53
|
+
regexp_parser (2.10.0)
|
54
|
+
reline (0.6.1)
|
41
55
|
io-console (~> 0.5)
|
42
|
-
rubocop (1.
|
56
|
+
rubocop (1.75.8)
|
43
57
|
json (~> 2.3)
|
44
|
-
language_server-protocol (
|
58
|
+
language_server-protocol (~> 3.17.0.2)
|
59
|
+
lint_roller (~> 1.1.0)
|
45
60
|
parallel (~> 1.10)
|
46
61
|
parser (>= 3.3.0.2)
|
47
62
|
rainbow (>= 2.2.2, < 4.0)
|
48
|
-
regexp_parser (>= 2.
|
49
|
-
rubocop-ast (>= 1.
|
63
|
+
regexp_parser (>= 2.9.3, < 3.0)
|
64
|
+
rubocop-ast (>= 1.44.0, < 2.0)
|
50
65
|
ruby-progressbar (~> 1.7)
|
51
|
-
unicode-display_width (>= 2.4.0, <
|
52
|
-
rubocop-ast (1.
|
53
|
-
parser (>= 3.3.
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
rubocop (>=
|
66
|
+
unicode-display_width (>= 2.4.0, < 4.0)
|
67
|
+
rubocop-ast (1.45.1)
|
68
|
+
parser (>= 3.3.7.2)
|
69
|
+
prism (~> 1.4)
|
70
|
+
rubocop-performance (1.25.0)
|
71
|
+
lint_roller (~> 1.1)
|
72
|
+
rubocop (>= 1.75.0, < 2.0)
|
73
|
+
rubocop-ast (>= 1.38.0, < 2.0)
|
74
|
+
rubocop-sorbet (0.9.0)
|
75
|
+
lint_roller (~> 1.1)
|
76
|
+
rubocop (>= 1)
|
59
77
|
ruby-progressbar (1.13.0)
|
60
|
-
sorbet (0.5.
|
61
|
-
sorbet-static (= 0.5.
|
62
|
-
sorbet-runtime (0.5.
|
63
|
-
sorbet-static (0.5.
|
64
|
-
sorbet-static (0.5.
|
65
|
-
sorbet-static-and-runtime (0.5.
|
66
|
-
sorbet (= 0.5.
|
67
|
-
sorbet-runtime (= 0.5.
|
68
|
-
spoom (1.
|
78
|
+
sorbet (0.5.12210)
|
79
|
+
sorbet-static (= 0.5.12210)
|
80
|
+
sorbet-runtime (0.5.12210)
|
81
|
+
sorbet-static (0.5.12210-universal-darwin)
|
82
|
+
sorbet-static (0.5.12210-x86_64-linux)
|
83
|
+
sorbet-static-and-runtime (0.5.12210)
|
84
|
+
sorbet (= 0.5.12210)
|
85
|
+
sorbet-runtime (= 0.5.12210)
|
86
|
+
spoom (1.6.1)
|
69
87
|
erubi (>= 1.10.0)
|
70
88
|
prism (>= 0.28.0)
|
89
|
+
rbi (>= 0.2.3)
|
71
90
|
sorbet-static-and-runtime (>= 0.5.10187)
|
72
91
|
thor (>= 0.19.2)
|
73
|
-
standard (1.
|
92
|
+
standard (1.50.0)
|
74
93
|
language_server-protocol (~> 3.17.0.2)
|
75
94
|
lint_roller (~> 1.0)
|
76
|
-
rubocop (~> 1.
|
95
|
+
rubocop (~> 1.75.5)
|
77
96
|
standard-custom (~> 1.0.0)
|
78
|
-
standard-performance (~> 1.
|
97
|
+
standard-performance (~> 1.8)
|
79
98
|
standard-custom (1.0.2)
|
80
99
|
lint_roller (~> 1.0)
|
81
100
|
rubocop (~> 1.50)
|
82
|
-
standard-performance (1.
|
101
|
+
standard-performance (1.8.0)
|
83
102
|
lint_roller (~> 1.1)
|
84
|
-
rubocop-performance (~> 1.
|
85
|
-
standard-sorbet (0.0.
|
103
|
+
rubocop-performance (~> 1.25.0)
|
104
|
+
standard-sorbet (0.0.3)
|
86
105
|
lint_roller (~> 1.1)
|
87
|
-
rubocop-sorbet (~> 0.
|
88
|
-
stringio (3.1.
|
89
|
-
tapioca (0.16.
|
106
|
+
rubocop-sorbet (~> 0.9.0)
|
107
|
+
stringio (3.1.7)
|
108
|
+
tapioca (0.16.11)
|
109
|
+
benchmark
|
90
110
|
bundler (>= 2.2.25)
|
91
111
|
netrc (>= 0.11.0)
|
92
112
|
parallel (>= 1.21.0)
|
@@ -96,7 +116,9 @@ GEM
|
|
96
116
|
thor (>= 1.2.0)
|
97
117
|
yard-sorbet
|
98
118
|
thor (1.3.2)
|
99
|
-
unicode-display_width (
|
119
|
+
unicode-display_width (3.1.4)
|
120
|
+
unicode-emoji (~> 4.0, >= 4.0.4)
|
121
|
+
unicode-emoji (4.0.4)
|
100
122
|
yard (0.9.37)
|
101
123
|
yard-sorbet (0.9.0)
|
102
124
|
sorbet-runtime
|
@@ -120,4 +142,4 @@ DEPENDENCIES
|
|
120
142
|
tapioca
|
121
143
|
|
122
144
|
BUNDLED WITH
|
123
|
-
2.
|
145
|
+
2.4.22
|
data/README.md
CHANGED
@@ -98,7 +98,7 @@ To do so, use the `#and_then` method to transform the payload of a `Typed::Succe
|
|
98
98
|
|
99
99
|
```ruby
|
100
100
|
# In this example, retrieve_user and send_notification both return a Typed::Result
|
101
|
-
# retrieve_user: Typed::Result[User, RetrieveUserError
|
101
|
+
# retrieve_user: Typed::Result[User, RetrieveUserError]
|
102
102
|
# send_notification: Typed::Result[T::Boolean, SendNotificationError]
|
103
103
|
res = retrieve_user(user_id)
|
104
104
|
.and_then { |user| send_notification(user.email) } # this block will only run if retrieve_user returns a Typed::Success
|
@@ -6,9 +6,14 @@ module Typed
|
|
6
6
|
class NoPayloadOnFailureError < StandardError
|
7
7
|
extend T::Sig
|
8
8
|
|
9
|
-
sig { void }
|
10
|
-
def initialize
|
11
|
-
super(
|
9
|
+
sig { params(failure: Failure[T.untyped]).void }
|
10
|
+
def initialize(failure)
|
11
|
+
super(
|
12
|
+
"Attempted to access `payload` from a Failure Result. " \
|
13
|
+
"You were probably expecting a Success Result. " \
|
14
|
+
"Check the result with `#success?` or `#failure?` before attempting to access `payload`. " \
|
15
|
+
"Error encountered: #{failure.error.inspect}"
|
16
|
+
)
|
12
17
|
end
|
13
18
|
end
|
14
19
|
end
|
data/lib/typed/result.rb
CHANGED
@@ -160,7 +160,7 @@ class AST::Node
|
|
160
160
|
|
161
161
|
# Returns the precomputed hash value for this node
|
162
162
|
#
|
163
|
-
# @return [
|
163
|
+
# @return [Integer]
|
164
164
|
#
|
165
165
|
# source://ast//lib/ast/node.rb#61
|
166
166
|
def hash; end
|
@@ -557,8 +557,8 @@ end
|
|
557
557
|
# to define deeply nested ASTs from Ruby code, for example, in
|
558
558
|
# tests. It should be used like this:
|
559
559
|
#
|
560
|
-
# describe YourLanguage
|
561
|
-
# include Sexp
|
560
|
+
# describe YourLanguage do
|
561
|
+
# include ::AST::Sexp
|
562
562
|
#
|
563
563
|
# it "should correctly parse expressions" do
|
564
564
|
# YourLanguage.parse("1 + 2 * 3").should ==
|