sorbet-result 0.1.0 → 0.1.1
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/CHANGELOG.md +9 -1
- data/Gemfile.lock +2 -2
- data/lib/t/failure.rb +2 -3
- data/lib/t/result.rb +2 -2
- data/lib/t/success.rb +2 -3
- data/sorbet/rbi/gems/{regexp_parser@2.7.0.rbi → regexp_parser@2.8.0.rbi} +617 -449
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cff6b167022f8dd885a13ad6340e5c406790578043fb6ba236c26d9bec5497ec
|
4
|
+
data.tar.gz: 6233fa6e5ab9b956c7bc2f57ccc11bed9c594eb01fb69dba9ce6816906968efe
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 105c454951452c5102a768d26a99b0b004aa5004d071eb377be2f28117cdf9ad39d6596e2fc98596e936a33d3f180f2753a7734c9e25dde3e5e184aa963f6e3d
|
7
|
+
data.tar.gz: 68146f7dbe9d72b97702d779825750a1e76d23b76ebd30cba6c1f9902fb9efdaab44f86847c126f4f5c54c9eebf1cab21a910f26361981ce3827054da3c56e32
|
data/CHANGELOG.md
CHANGED
@@ -4,7 +4,15 @@ All notable changes to this project will be documented in this file.
|
|
4
4
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
5
5
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
6
6
|
|
7
|
-
## [
|
7
|
+
## [0.1.1] - 2023-04-17
|
8
|
+
|
9
|
+
### Changed
|
10
|
+
|
11
|
+
- Updated `T::Result` to be an abstract class, instead of an interface module.
|
12
|
+
|
13
|
+
### Fixed
|
14
|
+
|
15
|
+
- `bin/console` now requires the correct file.
|
8
16
|
|
9
17
|
## [0.1.0] - 2023-04-17
|
10
18
|
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
sorbet-result (0.1.
|
4
|
+
sorbet-result (0.1.1)
|
5
5
|
sorbet-runtime
|
6
6
|
|
7
7
|
GEM
|
@@ -28,7 +28,7 @@ GEM
|
|
28
28
|
parser (>= 2.6.4.0)
|
29
29
|
sorbet-runtime (>= 0.5.9204)
|
30
30
|
unparser
|
31
|
-
regexp_parser (2.
|
31
|
+
regexp_parser (2.8.0)
|
32
32
|
reline (0.3.3)
|
33
33
|
io-console (~> 0.5)
|
34
34
|
rexml (3.2.5)
|
data/lib/t/failure.rb
CHANGED
@@ -3,12 +3,10 @@
|
|
3
3
|
|
4
4
|
module T
|
5
5
|
# Represents a failed result. Contains error information but no payload.
|
6
|
-
class Failure
|
6
|
+
class Failure < Result
|
7
7
|
extend Sig
|
8
8
|
extend Generic
|
9
9
|
|
10
|
-
include Result
|
11
|
-
|
12
10
|
Payload = type_member
|
13
11
|
Error = type_member
|
14
12
|
|
@@ -18,6 +16,7 @@ module T
|
|
18
16
|
sig { params(error: T.nilable(Error)).void }
|
19
17
|
def initialize(error: nil)
|
20
18
|
@error = error
|
19
|
+
super()
|
21
20
|
end
|
22
21
|
|
23
22
|
sig { override.returns(Boolean) }
|
data/lib/t/result.rb
CHANGED
@@ -3,12 +3,12 @@
|
|
3
3
|
|
4
4
|
module T
|
5
5
|
# A monad representing either a success or a failure. Contains payload and error information as well.
|
6
|
-
|
6
|
+
class Result
|
7
7
|
extend Sig
|
8
8
|
extend Helpers
|
9
9
|
extend Generic
|
10
10
|
|
11
|
-
|
11
|
+
abstract!
|
12
12
|
|
13
13
|
Payload = type_member
|
14
14
|
Error = type_member
|
data/lib/t/success.rb
CHANGED
@@ -3,12 +3,10 @@
|
|
3
3
|
|
4
4
|
module T
|
5
5
|
# Represents a successful result. Contains a payload and no error information.
|
6
|
-
class Success
|
6
|
+
class Success < Result
|
7
7
|
extend Sig
|
8
8
|
extend Generic
|
9
9
|
|
10
|
-
include Result
|
11
|
-
|
12
10
|
Payload = type_member
|
13
11
|
Error = type_member
|
14
12
|
|
@@ -18,6 +16,7 @@ module T
|
|
18
16
|
sig { params(payload: T.nilable(Payload)).void }
|
19
17
|
def initialize(payload: nil)
|
20
18
|
@payload = payload
|
19
|
+
super()
|
21
20
|
end
|
22
21
|
|
23
22
|
sig { override.returns(Boolean) }
|