defi 2.0.3 → 2.0.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/LICENSE.md +1 -1
  3. data/lib/defi/challenge.rb +19 -5
  4. metadata +8 -8
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ad4d58a63b7a9509a6e1fd7338e4357707f370102faae9d2afadd764c0a2eda2
4
- data.tar.gz: f9ba83d33a13843117b7a2ecd90a118916fb428560ae458a2be4d49753cf4d24
3
+ metadata.gz: a2ca2a81be0ee760282fe5770efa1d904340038738e18fc2a40f096bd6b134f7
4
+ data.tar.gz: b05c6ff311cfefed5bf83658b6724f9e50e18540eac9f60d34d63cd6c8b5bbed
5
5
  SHA512:
6
- metadata.gz: 13b9ee894ab62139d2351f0307c832a7a9b83687d67ae735db1ff1fab9b67a600d4a6f67b29ff87afde0b075744bf9d4bffb7a1963d984fa4107cb5b4e13280c
7
- data.tar.gz: 1137cd5cc9c9eea4aa19ed7443fd321fc778ca1eb12e0061cea3db844b9a904f932ec6e6862e6f0c03b9876a90b57d2df5b22951d2d2aac83a68f1c06447250b
6
+ metadata.gz: 80ab8c348a30fea63fd20999d66f5ab7ccf5b75625c2c586362e1cd5e382c0c50078b03466043f67ba148f09e124bec27b0bce1b1809356fcac9fd02f6061dc4
7
+ data.tar.gz: 157e0feba92506feb2f005078e85179ea005a3040d1907c812972c7aec57d9c9d4f901ec2562de41346807dfe70d434063d444d311e1b83881ea7940e8375697
data/LICENSE.md CHANGED
@@ -1,6 +1,6 @@
1
1
  The MIT License (MIT)
2
2
 
3
- Copyright (c) 2015-2019 Cyril Kato
3
+ Copyright (c) 2015-2020 Cyril Kato
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
@@ -18,11 +18,25 @@ module Defi
18
18
  @block = block
19
19
  end
20
20
 
21
- # @param object [#object_id] The object to challenge.
22
- #
23
- # @return [Defi::Value] The actual value, to raise or to return.
24
- def to(object)
25
- Value.new { object.public_send(@method, *@args, **@opts, &@block) }
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.3
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: 2019-12-29 00:00:00.000000000 Z
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: 2.7.0.preview1
134
+ version: '0'
135
135
  required_rubygems_version: !ruby/object:Gem::Requirement
136
136
  requirements:
137
137
  - - ">="