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.
- checksums.yaml +4 -4
- data/README.md +5 -1
- data/lib/defi/value.rb +1 -1
- metadata +4 -7
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: fb2ab31f20c7c76c7cfe4be699cfb1f8f52338818651ade18db56199e8ed71fa
|
|
4
|
+
data.tar.gz: c1b64d17e0d7c675f898610a9a4a66d013400d42ca782b2b0070808526ce05a5
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
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:
|
|
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.
|
|
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:
|
|
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-
|
|
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:
|
|
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: []
|