defi 2.0.3 → 2.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/LICENSE.md +1 -1
- data/lib/defi/challenge.rb +19 -5
- metadata +8 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a2ca2a81be0ee760282fe5770efa1d904340038738e18fc2a40f096bd6b134f7
|
4
|
+
data.tar.gz: b05c6ff311cfefed5bf83658b6724f9e50e18540eac9f60d34d63cd6c8b5bbed
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 80ab8c348a30fea63fd20999d66f5ab7ccf5b75625c2c586362e1cd5e382c0c50078b03466043f67ba148f09e124bec27b0bce1b1809356fcac9fd02f6061dc4
|
7
|
+
data.tar.gz: 157e0feba92506feb2f005078e85179ea005a3040d1907c812972c7aec57d9c9d4f901ec2562de41346807dfe70d434063d444d311e1b83881ea7940e8375697
|
data/LICENSE.md
CHANGED
data/lib/defi/challenge.rb
CHANGED
@@ -18,11 +18,25 @@ module Defi
|
|
18
18
|
@block = block
|
19
19
|
end
|
20
20
|
|
21
|
-
# @
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
Value
|
21
|
+
# @see https://twitter.com/kamipo/status/1213030647591137280
|
22
|
+
if ::RUBY_VERSION > '2.7'
|
23
|
+
# @param object [#object_id] The object to challenge.
|
24
|
+
#
|
25
|
+
# @return [Defi::Value] The actual value, to raise or to return.
|
26
|
+
def to(object)
|
27
|
+
Value.new { object.public_send(@method, *@args, **@opts, &@block) }
|
28
|
+
end
|
29
|
+
else
|
30
|
+
# @param object [#object_id] The object to challenge.
|
31
|
+
#
|
32
|
+
# @return [Defi::Value] The actual value, to raise or to return.
|
33
|
+
def to(object)
|
34
|
+
if @opts.empty?
|
35
|
+
Value.new { object.public_send(@method, *@args, &@block) }
|
36
|
+
else
|
37
|
+
Value.new { object.public_send(@method, *@args, **@opts, &@block) }
|
38
|
+
end
|
39
|
+
end
|
26
40
|
end
|
27
41
|
|
28
42
|
# @param object [#object_id] The object to challenge in code isolation.
|
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.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Cyril Kato
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2020-01-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: aw
|
@@ -56,16 +56,16 @@ dependencies:
|
|
56
56
|
name: rubocop
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
|
-
- - "
|
59
|
+
- - "~>"
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version: '0'
|
61
|
+
version: '0.79'
|
62
62
|
type: :development
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
|
-
- - "
|
66
|
+
- - "~>"
|
67
67
|
- !ruby/object:Gem::Version
|
68
|
-
version: '0'
|
68
|
+
version: '0.79'
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: rubocop-performance
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
@@ -129,9 +129,9 @@ require_paths:
|
|
129
129
|
- lib
|
130
130
|
required_ruby_version: !ruby/object:Gem::Requirement
|
131
131
|
requirements:
|
132
|
-
- - "
|
132
|
+
- - ">="
|
133
133
|
- !ruby/object:Gem::Version
|
134
|
-
version:
|
134
|
+
version: '0'
|
135
135
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
136
136
|
requirements:
|
137
137
|
- - ">="
|