mangrove 0.19.2 → 0.21.0

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: b3bd32ff4e7be8135a7f44e67f7e33045455d752aa3f24a1dd8a64fd32675648
4
- data.tar.gz: 36b8d311f0ad42f732290add253ecf949525f43d22c8c50de03e9de802d4dbc8
3
+ metadata.gz: 761b124e30c530cd26a779e7e789633a3e84ed545f639e6655dcfd637b132da0
4
+ data.tar.gz: 2b65549240b5f94a9d52714620c8664d734cf2a065e5e165e666b45ed56064c6
5
5
  SHA512:
6
- metadata.gz: 7d0953e1c6138f949fadda9010007552f05e515907b7319d6bc46af65610dc2d5c7529a24e66308b9bc42b31a4135a1ca3ab1c237bf7b40560cd9dc546f5de72
7
- data.tar.gz: '09183433b5f0a35c3ee7da4942f262c3bff6e3d9d61d416a3bdd4865061e50ad727b31b7035c27d438a902f04fcbfb9f364f7dbd82119771d11e72d5bfe9a230'
6
+ metadata.gz: 4ae0b59477a9855dce2947f97556b871a111f631bc931d07cfa6f1be9630532d73c4bd3e7c4d883ac5bc75a52cfdd588eb5e83c63f8be0bbece59c1ad8c35b27
7
+ data.tar.gz: fd0ace87a61d26da101a4b1ae13521c67922e0aed43f1c658c570b991e5e5226fa4fac87f8b3d92045322bc82ceb60340013d1fd61180c796dfff7c0a8f98ba9
@@ -30,6 +30,9 @@ module Mangrove
30
30
  sig { abstract.returns(OkType) }
31
31
  def unwrap!; end
32
32
 
33
+ sig { abstract.params(block: T.proc.params(err: ErrType).returns(Exception)).returns(OkType) }
34
+ def unwrap_or_raise_with!(&block); end
35
+
33
36
  sig { abstract.params(exception: Exception).returns(OkType) }
34
37
  def unwrap_or_raise!(exception); end
35
38
 
@@ -39,7 +42,7 @@ module Mangrove
39
42
  sig { abstract.params(message: String).returns(OkType) }
40
43
  def expect!(message); end
41
44
 
42
- sig { abstract.type_parameters(:E).params(block: T.proc.returns(T.type_parameter(:E))).returns(OkType) }
45
+ sig { abstract.type_parameters(:E).params(block: T.proc.params(err: ErrType).returns(T.type_parameter(:E))).returns(OkType) }
43
46
  def expect_with!(&block); end
44
47
 
45
48
  sig { abstract.type_parameters(:NewOkType, :NewErrType).params(block: T.proc.params(this: Result[OkType, ErrType]).returns(Result[T.type_parameter(:NewOkType), T.type_parameter(:NewErrType)])).returns(Result[T.type_parameter(:NewOkType), T.type_parameter(:NewErrType)]) }
@@ -186,6 +189,11 @@ module Mangrove
186
189
  @inner
187
190
  end
188
191
 
192
+ sig { override.params(block: T.proc.params(err: ErrType).returns(Exception)).returns(OkType) }
193
+ def unwrap_or_raise_with!(&block)
194
+ @inner
195
+ end
196
+
189
197
  sig { override.returns(OkType) }
190
198
  def unwrap_or_raise_inner!
191
199
  @inner
@@ -196,7 +204,7 @@ module Mangrove
196
204
  @inner
197
205
  end
198
206
 
199
- sig { override.type_parameters(:E).params(_block: T.proc.returns(T.type_parameter(:E))).returns(OkType) }
207
+ sig { override.type_parameters(:E).params(_block: T.proc.params(err: ErrType).returns(T.type_parameter(:E))).returns(OkType) }
200
208
  def expect_with!(&_block)
201
209
  @inner
202
210
  end
@@ -350,6 +358,11 @@ module Mangrove
350
358
  raise exception
351
359
  end
352
360
 
361
+ sig { override.params(block: T.proc.params(err: ErrType).returns(Exception)).returns(OkType) }
362
+ def unwrap_or_raise_with!(&block)
363
+ raise block.call(@inner)
364
+ end
365
+
353
366
  sig { override.returns(OkType) }
354
367
  def unwrap_or_raise_inner!
355
368
  raise T.unsafe(@inner)
@@ -360,9 +373,9 @@ module Mangrove
360
373
  raise Result::ControlSignal, message
361
374
  end
362
375
 
363
- sig { override.type_parameters(:E).params(block: T.proc.returns(T.type_parameter(:E))).returns(OkType) }
376
+ sig { override.type_parameters(:E).params(block: T.proc.params(err: ErrType).returns(T.type_parameter(:E))).returns(OkType) }
364
377
  def expect_with!(&block)
365
- raise Result::ControlSignal, block.call
378
+ raise Result::ControlSignal, block.call(@inner)
366
379
  end
367
380
 
368
381
  sig { override.returns(T::Boolean) }
@@ -2,5 +2,5 @@
2
2
  # frozen_string_literal: true
3
3
 
4
4
  module Mangrove
5
- VERSION = "0.19.2"
5
+ VERSION = "0.21.0"
6
6
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mangrove
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.19.2
4
+ version: 0.21.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kazuma Murata