sorbet-result 1.2.0 → 1.4.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.
Files changed (44) hide show
  1. checksums.yaml +4 -4
  2. data/.ruby-version +1 -1
  3. data/CHANGELOG.md +12 -0
  4. data/Gemfile.lock +74 -51
  5. data/README.md +1 -1
  6. data/lib/typed/no_payload_on_failure_error.rb +8 -3
  7. data/lib/typed/result.rb +1 -1
  8. data/sorbet/rbi/gems/{ast@2.4.2.rbi → ast@2.4.3.rbi} +3 -3
  9. data/sorbet/rbi/gems/benchmark@0.4.1.rbi +619 -0
  10. data/sorbet/rbi/gems/date@3.4.1.rbi +75 -0
  11. data/sorbet/rbi/gems/erb@5.0.1.rbi +878 -0
  12. data/sorbet/rbi/gems/{erubi@1.13.0.rbi → erubi@1.13.1.rbi} +14 -9
  13. data/sorbet/rbi/gems/{json@2.7.5.rbi → json@2.12.2.rbi} +654 -232
  14. data/sorbet/rbi/gems/{language_server-protocol@3.17.0.3.rbi → language_server-protocol@3.17.0.5.rbi} +11 -5
  15. data/sorbet/rbi/gems/logger@1.7.0.rbi +963 -0
  16. data/sorbet/rbi/gems/{minitest@5.25.1.rbi → minitest@5.25.5.rbi} +227 -220
  17. data/sorbet/rbi/gems/{parser@3.3.5.1.rbi → parser@3.3.8.0.rbi} +215 -199
  18. data/sorbet/rbi/gems/pp@0.6.2.rbi +368 -0
  19. data/sorbet/rbi/gems/prettyprint@0.2.0.rbi +477 -0
  20. data/sorbet/rbi/gems/{prism@1.2.0.rbi → prism@1.4.0.rbi} +6569 -3922
  21. data/sorbet/rbi/gems/{psych@5.1.2.rbi → psych@5.2.6.rbi} +973 -236
  22. data/sorbet/rbi/gems/{rake@13.2.1.rbi → rake@13.3.0.rbi} +15 -12
  23. data/sorbet/rbi/gems/{rbi@0.2.1.rbi → rbi@0.3.6.rbi} +3340 -982
  24. data/sorbet/rbi/gems/rbs@3.9.4.rbi +6976 -0
  25. data/sorbet/rbi/gems/{regexp_parser@2.9.2.rbi → regexp_parser@2.10.0.rbi} +193 -170
  26. data/sorbet/rbi/gems/rexml@3.4.1.rbi +5243 -0
  27. data/sorbet/rbi/gems/{rubocop-ast@1.33.1.rbi → rubocop-ast@1.45.1.rbi} +1069 -826
  28. data/sorbet/rbi/gems/{rubocop@1.66.1.rbi → rubocop@1.75.8.rbi} +7880 -4054
  29. data/sorbet/rbi/gems/{spoom@1.5.0.rbi → spoom@1.6.3.rbi} +3013 -960
  30. data/sorbet/rbi/gems/{standard@1.41.1.rbi → standard@1.50.0.rbi} +68 -59
  31. data/sorbet/rbi/gems/{tapioca@0.16.3.rbi → tapioca@0.16.11.rbi} +273 -248
  32. data/sorbet/rbi/gems/unicode-display_width@3.1.4.rbi +132 -0
  33. data/sorbet/rbi/gems/unicode-emoji@4.0.4.rbi +251 -0
  34. metadata +38 -34
  35. data/.tool-versions +0 -1
  36. data/sorbet/rbi/gems/unicode-display_width@2.6.0.rbi +0 -66
  37. /data/sorbet/rbi/gems/{io-console@0.7.2.rbi → io-console@0.8.0.rbi} +0 -0
  38. /data/sorbet/rbi/gems/{parallel@1.26.3.rbi → parallel@1.27.0.rbi} +0 -0
  39. /data/sorbet/rbi/gems/{reline@0.5.10.rbi → reline@0.6.1.rbi} +0 -0
  40. /data/sorbet/rbi/gems/{rubocop-performance@1.22.1.rbi → rubocop-performance@1.25.0.rbi} +0 -0
  41. /data/sorbet/rbi/gems/{rubocop-sorbet@0.7.8.rbi → rubocop-sorbet@0.9.0.rbi} +0 -0
  42. /data/sorbet/rbi/gems/{standard-performance@1.5.0.rbi → standard-performance@1.8.0.rbi} +0 -0
  43. /data/sorbet/rbi/gems/{standard-sorbet@0.0.2.rbi → standard-sorbet@0.0.3.rbi} +0 -0
  44. /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: 62795733b699fe9adec850e9584a6c45c47e6fa00daa93cb93221a43ca16b131
4
- data.tar.gz: 3b0f4ef2e5fc20e61e88724dc6e6637f254f41ec6394b802896f30861c9a40cb
3
+ metadata.gz: 21c7af9a93f6edb6eead4f80d1b52812c3cd6f60783dda278bd628a006670613
4
+ data.tar.gz: 61741a3c3bb2faa001402056d4e8e9ac2bf911ddd6a5d8e4d5d62f05e8153799
5
5
  SHA512:
6
- metadata.gz: 59395f384a03d978f128695fc2cf9c1b79a34b91e0c0aeae0e995b9a3ecc440901ff599112d14d06cab99a92cd0dd82ff8831d7d852255ae9ed5f872a14cc17f
7
- data.tar.gz: d536a970dc7c60490c6a106178c1e32ef61cfb816d46405fb389dd62d43e0f5d8ac1e7b6a7097aa73b225d4752ab702bc75bafe25b3f365ba08f7d67c1137e75
6
+ metadata.gz: fb10df27c3b01b8172c84f6ba9d894d15876a46a2c6bd40cac69de522f079a50ae8397ba5d6752f69d47c4b79ab6717d83d64252e84c47c2455ed37ccfdddbc9
7
+ data.tar.gz: 003dbda92982ffea053ff46edeacea02d675a4ddf4852fbb714b8246dc5452049fc69e0b61293411796a13016145973e44afc4e9a6bd82c99e536459c6144d28
data/.ruby-version CHANGED
@@ -1 +1 @@
1
- 3.3.5
1
+ 3.2.8
data/CHANGELOG.md CHANGED
@@ -6,6 +6,18 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
6
6
 
7
7
  ## [Unreleased]
8
8
 
9
+ ## [1.4.0] - 2025-06-29
10
+
11
+ ### Removed
12
+
13
+ - **POTENTIALLY BREAKING** Remove support for Ruby < 3.2.
14
+
15
+ ## [1.3.0] - 2025-06-29
16
+
17
+ ### Added
18
+
19
+ - Added error details to `Typed::NoPayloadOnFailureError` error message
20
+
9
21
  ## [1.2.0] - 2024-11-03
10
22
 
11
23
  ### Added
data/Gemfile.lock CHANGED
@@ -1,92 +1,112 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- sorbet-result (1.2.0)
4
+ sorbet-result (1.4.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.2)
11
- debug (1.9.2)
10
+ ast (2.4.3)
11
+ benchmark (0.4.1)
12
+ date (3.4.1)
13
+ debug (1.11.0)
12
14
  irb (~> 1.10)
13
15
  reline (>= 0.3.8)
14
- erubi (1.13.0)
15
- io-console (0.7.2)
16
- irb (1.14.1)
16
+ erb (5.0.1)
17
+ erubi (1.13.1)
18
+ io-console (0.8.0)
19
+ irb (1.15.2)
20
+ pp (>= 0.6.0)
17
21
  rdoc (>= 4.0.0)
18
22
  reline (>= 0.4.2)
19
- json (2.7.5)
20
- language_server-protocol (3.17.0.3)
23
+ json (2.12.2)
24
+ language_server-protocol (3.17.0.5)
21
25
  lint_roller (1.1.0)
22
- minitest (5.25.1)
26
+ logger (1.7.0)
27
+ minitest (5.25.5)
23
28
  netrc (0.11.0)
24
- parallel (1.26.3)
25
- parser (3.3.5.1)
29
+ parallel (1.27.0)
30
+ parser (3.3.8.0)
26
31
  ast (~> 2.4.1)
27
32
  racc
28
- prism (1.2.0)
29
- psych (5.1.2)
33
+ pp (0.6.2)
34
+ prettyprint
35
+ prettyprint (0.2.0)
36
+ prism (1.4.0)
37
+ psych (5.2.6)
38
+ date
30
39
  stringio
31
40
  racc (1.8.1)
32
41
  rainbow (3.1.1)
33
- rake (13.2.1)
34
- rbi (0.2.1)
42
+ rake (13.3.0)
43
+ rbi (0.3.6)
35
44
  prism (~> 1.0)
36
- sorbet-runtime (>= 0.5.9204)
37
- rdoc (6.7.0)
45
+ rbs (>= 3.4.4)
46
+ rbs (3.9.4)
47
+ logger
48
+ rdoc (6.14.1)
49
+ erb
38
50
  psych (>= 4.0.0)
39
- regexp_parser (2.9.2)
40
- reline (0.5.10)
51
+ regexp_parser (2.10.0)
52
+ reline (0.6.1)
41
53
  io-console (~> 0.5)
42
- rubocop (1.66.1)
54
+ rexml (3.4.1)
55
+ rubocop (1.75.8)
43
56
  json (~> 2.3)
44
- language_server-protocol (>= 3.17.0)
57
+ language_server-protocol (~> 3.17.0.2)
58
+ lint_roller (~> 1.1.0)
45
59
  parallel (~> 1.10)
46
60
  parser (>= 3.3.0.2)
47
61
  rainbow (>= 2.2.2, < 4.0)
48
- regexp_parser (>= 2.4, < 3.0)
49
- rubocop-ast (>= 1.32.2, < 2.0)
62
+ regexp_parser (>= 2.9.3, < 3.0)
63
+ rubocop-ast (>= 1.44.0, < 2.0)
50
64
  ruby-progressbar (~> 1.7)
51
- unicode-display_width (>= 2.4.0, < 3.0)
52
- rubocop-ast (1.33.1)
53
- parser (>= 3.3.1.0)
54
- rubocop-performance (1.22.1)
55
- rubocop (>= 1.48.1, < 2.0)
56
- rubocop-ast (>= 1.31.1, < 2.0)
57
- rubocop-sorbet (0.7.8)
58
- rubocop (>= 0.90.0)
65
+ unicode-display_width (>= 2.4.0, < 4.0)
66
+ rubocop-ast (1.45.1)
67
+ parser (>= 3.3.7.2)
68
+ prism (~> 1.4)
69
+ rubocop-performance (1.25.0)
70
+ lint_roller (~> 1.1)
71
+ rubocop (>= 1.75.0, < 2.0)
72
+ rubocop-ast (>= 1.38.0, < 2.0)
73
+ rubocop-sorbet (0.9.0)
74
+ lint_roller (~> 1.1)
75
+ rubocop (>= 1)
59
76
  ruby-progressbar (1.13.0)
60
- sorbet (0.5.11633)
61
- sorbet-static (= 0.5.11633)
62
- sorbet-runtime (0.5.11633)
63
- sorbet-static (0.5.11633-universal-darwin)
64
- sorbet-static (0.5.11633-x86_64-linux)
65
- sorbet-static-and-runtime (0.5.11633)
66
- sorbet (= 0.5.11633)
67
- sorbet-runtime (= 0.5.11633)
68
- spoom (1.5.0)
77
+ sorbet (0.5.12210)
78
+ sorbet-static (= 0.5.12210)
79
+ sorbet-runtime (0.5.12210)
80
+ sorbet-static (0.5.12210-universal-darwin)
81
+ sorbet-static (0.5.12210-x86_64-linux)
82
+ sorbet-static-and-runtime (0.5.12210)
83
+ sorbet (= 0.5.12210)
84
+ sorbet-runtime (= 0.5.12210)
85
+ spoom (1.6.3)
69
86
  erubi (>= 1.10.0)
70
87
  prism (>= 0.28.0)
88
+ rbi (>= 0.3.3)
89
+ rexml (>= 3.2.6)
71
90
  sorbet-static-and-runtime (>= 0.5.10187)
72
91
  thor (>= 0.19.2)
73
- standard (1.41.1)
92
+ standard (1.50.0)
74
93
  language_server-protocol (~> 3.17.0.2)
75
94
  lint_roller (~> 1.0)
76
- rubocop (~> 1.66.0)
95
+ rubocop (~> 1.75.5)
77
96
  standard-custom (~> 1.0.0)
78
- standard-performance (~> 1.5)
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.5.0)
101
+ standard-performance (1.8.0)
83
102
  lint_roller (~> 1.1)
84
- rubocop-performance (~> 1.22.0)
85
- standard-sorbet (0.0.2)
103
+ rubocop-performance (~> 1.25.0)
104
+ standard-sorbet (0.0.3)
86
105
  lint_roller (~> 1.1)
87
- rubocop-sorbet (~> 0.7.0)
88
- stringio (3.1.1)
89
- tapioca (0.16.3)
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 (2.6.0)
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
@@ -105,6 +127,7 @@ GEM
105
127
  PLATFORMS
106
128
  arm64-darwin-22
107
129
  arm64-darwin-23
130
+ arm64-darwin-24
108
131
  x86_64-linux
109
132
 
110
133
  DEPENDENCIES
@@ -120,4 +143,4 @@ DEPENDENCIES
120
143
  tapioca
121
144
 
122
145
  BUNDLED WITH
123
- 2.5.18
146
+ 2.6.9
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("Attempted to access `payload` from a Failure Result. You were probably expecting a Success Result. Check the result with `#success?` or `#failure?` before attempting to access `payload`.") # rubocop:disable Layout/LineLength
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
@@ -202,7 +202,7 @@ module Typed
202
202
 
203
203
  sig { override.returns(T.noreturn) }
204
204
  def payload
205
- raise NoPayloadOnFailureError
205
+ raise NoPayloadOnFailureError.new(self)
206
206
  end
207
207
 
208
208
  sig do
@@ -160,7 +160,7 @@ class AST::Node
160
160
 
161
161
  # Returns the precomputed hash value for this node
162
162
  #
163
- # @return [Fixnum]
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::AST do
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 ==