mangrove 0.7.2 → 0.8.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +13 -13
- data/docs/Mangrove/ControlFlow/ControlSignal.html +1 -1
- data/docs/Mangrove/ControlFlow.html +1 -1
- data/docs/Mangrove/Option/ControlSignal.html +1 -1
- data/docs/Mangrove/Option/None.html +140 -38
- data/docs/Mangrove/Option/Some.html +106 -17
- data/docs/Mangrove/Option.html +108 -19
- data/docs/Mangrove/Result/ControlSignal.html +1 -1
- data/docs/Mangrove/Result/Err.html +145 -43
- data/docs/Mangrove/Result/Ok.html +127 -38
- data/docs/Mangrove/Result.html +99 -10
- data/docs/Mangrove.html +2 -2
- data/docs/_index.html +1 -1
- data/docs/file.README.html +15 -15
- data/docs/index.html +15 -15
- data/docs/method_list.html +128 -80
- data/docs/top-level-namespace.html +1 -1
- data/lib/mangrove/option.rb +15 -2
- data/lib/mangrove/result.rb +13 -0
- data/lib/mangrove/version.rb +1 -1
- metadata +4 -3
data/lib/mangrove/option.rb
CHANGED
@@ -66,6 +66,11 @@ module Mangrove
|
|
66
66
|
@inner
|
67
67
|
end
|
68
68
|
|
69
|
+
sig { override.params(_block: T.proc.returns(T.untyped)).returns(InnerType) }
|
70
|
+
def expect_with!(&_block)
|
71
|
+
@inner
|
72
|
+
end
|
73
|
+
|
69
74
|
sig { override.returns(T::Boolean) }
|
70
75
|
def some? = true
|
71
76
|
|
@@ -123,12 +128,17 @@ module Mangrove
|
|
123
128
|
|
124
129
|
sig { override.returns(InnerType) }
|
125
130
|
def unwrap!
|
126
|
-
raise Option::ControlSignal,
|
131
|
+
raise Option::ControlSignal, "called `Option#unwrap!` on an `None` value: #{self}"
|
127
132
|
end
|
128
133
|
|
129
134
|
sig { override.params(message: String).returns(InnerType) }
|
130
135
|
def expect!(message)
|
131
|
-
raise Option::ControlSignal,
|
136
|
+
raise Option::ControlSignal, message
|
137
|
+
end
|
138
|
+
|
139
|
+
sig { override.params(block: T.proc.returns(T.untyped)).returns(InnerType) }
|
140
|
+
def expect_with!(&block)
|
141
|
+
raise Option::ControlSignal, block.call
|
132
142
|
end
|
133
143
|
|
134
144
|
sig { override.returns(T::Boolean) }
|
@@ -165,6 +175,9 @@ module Mangrove
|
|
165
175
|
sig { abstract.params(message: String).returns(InnerType) }
|
166
176
|
def expect!(message); end
|
167
177
|
|
178
|
+
sig { abstract.params(block: T.proc.returns(T.untyped)).returns(InnerType) }
|
179
|
+
def expect_with!(&block); end
|
180
|
+
|
168
181
|
sig { abstract.returns(T::Boolean) }
|
169
182
|
def some?; end
|
170
183
|
|
data/lib/mangrove/result.rb
CHANGED
@@ -33,6 +33,9 @@ module Mangrove
|
|
33
33
|
sig { abstract.params(message: String).returns(OkType) }
|
34
34
|
def expect!(message); end
|
35
35
|
|
36
|
+
sig { abstract.params(block: T.proc.returns(T.untyped)).returns(OkType) }
|
37
|
+
def expect_with!(&block); end
|
38
|
+
|
36
39
|
sig { abstract.params(block: T.proc.params(this: OkType).returns(Result[OkType, ErrType])).returns(Result[OkType, ErrType]) }
|
37
40
|
def map_ok(&block); end
|
38
41
|
|
@@ -102,6 +105,11 @@ module Mangrove
|
|
102
105
|
@inner
|
103
106
|
end
|
104
107
|
|
108
|
+
sig { override.params(_block: T.proc.returns(T.untyped)).returns(OkType) }
|
109
|
+
def expect_with!(&_block)
|
110
|
+
@inner
|
111
|
+
end
|
112
|
+
|
105
113
|
sig { override.returns(T::Boolean) }
|
106
114
|
def ok? = true
|
107
115
|
|
@@ -166,6 +174,11 @@ module Mangrove
|
|
166
174
|
raise Result::ControlSignal, message
|
167
175
|
end
|
168
176
|
|
177
|
+
sig { override.params(block: T.proc.returns(T.untyped)).returns(OkType) }
|
178
|
+
def expect_with!(&block)
|
179
|
+
raise Result::ControlSignal, block.call
|
180
|
+
end
|
181
|
+
|
169
182
|
sig { override.returns(T::Boolean) }
|
170
183
|
def ok? = false
|
171
184
|
|
data/lib/mangrove/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mangrove
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.8.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kazuma Murata
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-
|
11
|
+
date: 2023-10-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: sorbet-runtime
|
@@ -160,7 +160,8 @@ files:
|
|
160
160
|
- sorbet/tapioca/config.yml
|
161
161
|
- sorbet/tapioca/require.rb
|
162
162
|
homepage: https://github.com/kazzix14/mangrove
|
163
|
-
licenses:
|
163
|
+
licenses:
|
164
|
+
- MIT
|
164
165
|
metadata:
|
165
166
|
homepage_uri: https://github.com/kazzix14/mangrove
|
166
167
|
source_code_uri: https://github.com/kazzix14/mangrove
|