defi 2.0.5 → 2.0.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +12 -12
- data/lib/defi.rb +4 -4
- data/lib/defi/challenge.rb +5 -5
- data/lib/defi/value.rb +8 -2
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 426454d321bdf30c4cde0dc89c4de16df76c2c12c26c67eef784df4111fe8dde
|
4
|
+
data.tar.gz: 7f3948a1116852ce7b82cdf7b456a7d3c6813e25da1c573ce520cf674440a4f2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a7e2bd4ec5d168a91dc8e444214eba65b23e56a36f029f17adbd3aaa6ce7dad84761b26dd813ac046929efd1eb9391b2027dfa4ed1cf463be92e069474325bca
|
7
|
+
data.tar.gz: 2574a52983fee5abcac60eb98a6c0178ba49e00dfb1b21473c620fda7ba8210e15fdb4b55213e274227c0c6cd98d49eb822559913ea3b3f50ffb978ac0063029
|
data/README.md
CHANGED
@@ -1,9 +1,10 @@
|
|
1
1
|
# Defi
|
2
2
|
|
3
|
-
[![
|
4
|
-
[![
|
5
|
-
[![
|
6
|
-
[![
|
3
|
+
[![Version](https://img.shields.io/github/v/tag/fixrb/defi?label=Version&logo=github)](https://github.com/fixrb/defi/releases)
|
4
|
+
[![Yard documentation](https://img.shields.io/badge/Yard-documentation-blue.svg?logo=github)](https://rubydoc.info/github/fixrb/defi/main)
|
5
|
+
[![CI](https://github.com/fixrb/defi/workflows/CI/badge.svg?branch=main)](https://github.com/fixrb/defi/actions?query=workflow%3Aci+branch%3Amain)
|
6
|
+
[![RuboCop](https://github.com/fixrb/defi/workflows/RuboCop/badge.svg?branch=main)](https://github.com/fixrb/defi/actions?query=workflow%3Arubocop+branch%3Amain)
|
7
|
+
[![License](https://img.shields.io/github/license/fixrb/defi?label=License&logo=github)](https://github.com/fixrb/defi/raw/main/LICENSE.md)
|
7
8
|
|
8
9
|
> Challenge library.
|
9
10
|
|
@@ -17,11 +18,15 @@ gem "defi"
|
|
17
18
|
|
18
19
|
And then execute:
|
19
20
|
|
20
|
-
|
21
|
+
```sh
|
22
|
+
bundle
|
23
|
+
```
|
21
24
|
|
22
25
|
Or install it yourself as:
|
23
26
|
|
24
|
-
|
27
|
+
```sh
|
28
|
+
gem install defi
|
29
|
+
```
|
25
30
|
|
26
31
|
## Usage
|
27
32
|
|
@@ -55,7 +60,7 @@ __Defi__ follows [Semantic Versioning 2.0](https://semver.org/).
|
|
55
60
|
|
56
61
|
## License
|
57
62
|
|
58
|
-
The gem is available as open source under the terms of the [MIT License](https://
|
63
|
+
The [gem](https://rubygems.org/gems/defi) is available as open source under the terms of the [MIT License](https://github.com/fixrb/defi/raw/main/LICENSE.md).
|
59
64
|
|
60
65
|
***
|
61
66
|
|
@@ -65,8 +70,3 @@ The gem is available as open source under the terms of the [MIT License](https:/
|
|
65
70
|
src="https://github.com/fixrb/defi/raw/main/img/sashite.png"
|
66
71
|
alt="Sashite" /></a>
|
67
72
|
</p>
|
68
|
-
|
69
|
-
[gem]: https://rubygems.org/gems/defi
|
70
|
-
[travis]: https://travis-ci.org/fixrb/defi
|
71
|
-
[inchpages]: https://inch-ci.org/github/fixrb/defi
|
72
|
-
[rubydoc]: https://rubydoc.info/gems/defi/frames
|
data/lib/defi.rb
CHANGED
@@ -5,17 +5,17 @@
|
|
5
5
|
module Defi
|
6
6
|
# Expectations are built with this method.
|
7
7
|
#
|
8
|
-
# @example
|
8
|
+
# @example A :foo challenge
|
9
9
|
# send(:foo) # => #<Defi::Challenge:0x007f96a40925f8 @method=:foo, @args=[]>
|
10
10
|
#
|
11
11
|
# @param method [#to_sym] The method to send to an object.
|
12
12
|
# @param args [Array] Any arguments of the method.
|
13
|
-
# @param
|
13
|
+
# @param kwargs [Hash] Any keyword arguments of the method.
|
14
14
|
# @param block [Proc] Any block argument of the method.
|
15
15
|
#
|
16
16
|
# @return [Challenge] The challenge instance.
|
17
|
-
def self.send(method, *args, **
|
18
|
-
Challenge.new(method, *args, **
|
17
|
+
def self.send(method, *args, **kwargs, &block)
|
18
|
+
Challenge.new(method, *args, **kwargs, &block)
|
19
19
|
end
|
20
20
|
end
|
21
21
|
|
data/lib/defi/challenge.rb
CHANGED
@@ -79,11 +79,11 @@ module Defi
|
|
79
79
|
inspected_block = @block.nil? ? "nil" : "<Proc>"
|
80
80
|
|
81
81
|
"Defi(" \
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
82
|
+
"method: #{inspected_method}, " \
|
83
|
+
"args: #{inspected_args}, " \
|
84
|
+
"opts: #{inspected_opts}, " \
|
85
|
+
"block: #{inspected_block}" \
|
86
|
+
")"
|
87
87
|
end
|
88
88
|
end
|
89
89
|
end
|
data/lib/defi/value.rb
CHANGED
@@ -48,8 +48,7 @@ module Defi
|
|
48
48
|
#
|
49
49
|
# @return [String] The string representation of the value.
|
50
50
|
def to_s
|
51
|
-
|
52
|
-
"#{string} #{object}"
|
51
|
+
"#{raise_or_return} #{object}"
|
53
52
|
end
|
54
53
|
|
55
54
|
# A string containing a human-readable representation of the value.
|
@@ -58,5 +57,12 @@ module Defi
|
|
58
57
|
def inspect
|
59
58
|
"Value(object: #{object}, raised: #{raised?})"
|
60
59
|
end
|
60
|
+
|
61
|
+
private
|
62
|
+
|
63
|
+
# @return [String] A "raise" or "return" string.
|
64
|
+
def raise_or_return
|
65
|
+
raised? ? "raise" : "return"
|
66
|
+
end
|
61
67
|
end
|
62
68
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: defi
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.
|
4
|
+
version: 2.0.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Cyril Kato
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-07-31 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: aw
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 0.1.
|
19
|
+
version: 0.1.13
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 0.1.
|
26
|
+
version: 0.1.13
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: bundler
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -166,7 +166,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
166
166
|
- !ruby/object:Gem::Version
|
167
167
|
version: '0'
|
168
168
|
requirements: []
|
169
|
-
rubygems_version: 3.1.
|
169
|
+
rubygems_version: 3.1.6
|
170
170
|
signing_key:
|
171
171
|
specification_version: 4
|
172
172
|
summary: Challenge library.
|