defi 4.0.0 → 4.0.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.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +5 -1
  3. data/lib/defi/value.rb +1 -1
  4. metadata +4 -7
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 147abcfe45309cf8e5e5df3cf02dbcaeaccd2c421841ab017844206dd1218ed1
4
- data.tar.gz: 8d82cceb4e3e68f29ee6ae8632369cf9c4d2bdfdc3d3ba1a1cd3de5659cad8bc
3
+ metadata.gz: fb2ab31f20c7c76c7cfe4be699cfb1f8f52338818651ade18db56199e8ed71fa
4
+ data.tar.gz: c1b64d17e0d7c675f898610a9a4a66d013400d42ca782b2b0070808526ce05a5
5
5
  SHA512:
6
- metadata.gz: 9c0076455aa06379af57797aff1c160fce9bd1d930f45702a95eea4836b0c77270f9bcdac8cb4f00b4c5fe364766cb0a8a07b3f4c0800606366df9408debe882
7
- data.tar.gz: '0379b004d430b65a97b2f56d2a968457ec37a41510a08f253899060e7645937b7c29e234e2d6a9bbca75b991edde71485ade15d64cb0f61a7b348fd750d2e092'
6
+ metadata.gz: 4f38fe14b80b0e55d5b6abb727a6a122defb1781949d8e1e3a94c3d72aea42dae35c60a28f762bce8d6e7675beaf2940f048a72799c1d4aab646e38454eba43f
7
+ data.tar.gz: f306d5523983def7dc0ff6510b1e7f4f69be7a265d354256d467557df7a45f9ab7ad5fb42c092cd79c3e45a35424fd836b351fde2a43f0311dc6db11947088fa
data/README.md CHANGED
@@ -51,12 +51,16 @@ Defi::Challenge.new(:map) { |n| n * 2 }.to([1, 2]).object # => [2, 4]
51
51
 
52
52
  The message is sent with `public_send`: a private method, or a `BasicObject`, which has no `public_send`, gives a `NoMethodError`. `public_send` protects the named method only: a challenge of `send` or `instance_eval`, which are public, reaches what they reach.
53
53
 
54
- A challenge keeps as its value the exceptions a method raises on its own: a `StandardError`, a `ScriptError` (such as `NotImplementedError`), a `SystemStackError`, or the `SystemExit` of an `exit` or an `abort`. What is not the method's doing goes through: an `Interrupt`, a `SignalException`, a `NoMemoryError`, the exception a `Timeout` uses to end its block (a `Timeout` given a class to raise, such as `RuntimeError`, is kept like any `StandardError`), and any other subclass of `Exception`. `Defi::Value::RAISED` lists the classes kept. `call` raises the exception again, the same object, with its own cause.
54
+ A challenge keeps as its value the exceptions a method raises on its own: a `StandardError`, a `ScriptError` (such as `NotImplementedError`), a `SystemStackError`, or the `SystemExit` of an `exit` or an `abort`. What is not the method's doing goes through: an `Interrupt`, a `SignalException`, a `NoMemoryError`, the exception a `Timeout` uses to end its block (a `Timeout` given a class to raise, such as `RuntimeError`, is kept like any `StandardError`), and any other subclass of `Exception`. `Defi::Value::RAISED` lists the classes kept. `call` raises the exception again, the same object, with its own cause, read as `Exception` does whatever the exception says of it.
55
55
 
56
56
  `to_s` writes the call as `.name(1, key: 2, &block)`: the arguments and the keys by their `inspect`, which runs their code and can change from one Ruby to the next (a Hash in 3.4, a Set in 4.0), the block as `&block`.
57
57
 
58
58
  A challenge and a value are frozen. Their arguments are the objects given, not copies: a mutable argument stays shared with the caller.
59
59
 
60
+ ## Changes in 4.0.1
61
+
62
+ - `call` reads the cause of the exception it raises again as `Exception` does, where 4.0.0 asked the exception, which could answer something that is not an exception and turn the call into a `TypeError`.
63
+
60
64
  ## Changes in 4.0
61
65
 
62
66
  Compared with 3.0.1:
data/lib/defi/value.rb CHANGED
@@ -29,7 +29,7 @@ module Defi
29
29
  # @return [Object] the object returned
30
30
  # @raise [Exception] the exception raised, again, with its own cause
31
31
  def call
32
- raise object, cause: object.cause if raised?
32
+ raise object, cause: ::Exception.instance_method(:cause).bind_call(object) if raised?
33
33
 
34
34
  object
35
35
  end
metadata CHANGED
@@ -1,14 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: defi
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.0.0
4
+ version: 4.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Cyril Kato
8
- autorequire:
9
8
  bindir: bin
10
9
  cert_chain: []
11
- date: 2026-10-24 00:00:00.000000000 Z
10
+ date: 1980-01-02 00:00:00.000000000 Z
12
11
  dependencies: []
13
12
  description: 'Prepares a method call, a name with its arguments, and sends it to any
14
13
  object, keeping what came back: the value returned, or the exception raised.'
@@ -27,11 +26,10 @@ licenses:
27
26
  - MIT
28
27
  metadata:
29
28
  bug_tracker_uri: https://github.com/fixrb/defi/issues
30
- changelog_uri: https://github.com/fixrb/defi#changes-in-40
29
+ changelog_uri: https://github.com/fixrb/defi#changes-in-401
31
30
  documentation_uri: https://rubydoc.info/gems/defi
32
31
  rubygems_mfa_required: 'true'
33
32
  source_code_uri: https://github.com/fixrb/defi
34
- post_install_message:
35
33
  rdoc_options: []
36
34
  require_paths:
37
35
  - lib
@@ -46,8 +44,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
46
44
  - !ruby/object:Gem::Version
47
45
  version: '0'
48
46
  requirements: []
49
- rubygems_version: 3.5.22
50
- signing_key:
47
+ rubygems_version: 4.0.23
51
48
  specification_version: 4
52
49
  summary: A method call prepared in advance, to send to any object
53
50
  test_files: []