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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5a5d9ec9fab69bff15c96a7cc69fa4803ae518de50757ec42b4e2f2189df4ae8
4
- data.tar.gz: 942186c2634f4ed5fafd96fa811444105ac6b0983627d1bb2023e004dfb403df
3
+ metadata.gz: 426454d321bdf30c4cde0dc89c4de16df76c2c12c26c67eef784df4111fe8dde
4
+ data.tar.gz: 7f3948a1116852ce7b82cdf7b456a7d3c6813e25da1c573ce520cf674440a4f2
5
5
  SHA512:
6
- metadata.gz: 780386f4f728d69dc3b904b0773fc6a01c712d9f8857102cd3e0a142a5400cff2db9f2ae2693a682bfe3c83a83ab3d1fad743d44db4495d0ed398155c081755b
7
- data.tar.gz: 2d7352dd2e198709f43de97312e904836a6fc00a234c5b31b5cb4e01dc3904f6b43ed70828578e635bb0cdd80531b20ad84eafaf5c21eae3a3881d26f5414516
6
+ metadata.gz: a7e2bd4ec5d168a91dc8e444214eba65b23e56a36f029f17adbd3aaa6ce7dad84761b26dd813ac046929efd1eb9391b2027dfa4ed1cf463be92e069474325bca
7
+ data.tar.gz: 2574a52983fee5abcac60eb98a6c0178ba49e00dfb1b21473c620fda7ba8210e15fdb4b55213e274227c0c6cd98d49eb822559913ea3b3f50ffb978ac0063029
data/README.md CHANGED
@@ -1,9 +1,10 @@
1
1
  # Defi
2
2
 
3
- [![Build Status](https://api.travis-ci.org/fixrb/defi.svg?branch=main)][travis]
4
- [![Gem Version](https://badge.fury.io/rb/defi.svg)][gem]
5
- [![Inline docs](https://inch-ci.org/github/fixrb/defi.svg?branch=main)][inchpages]
6
- [![Documentation](https://img.shields.io/:yard-docs-38c800.svg)][rubydoc]
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
- $ bundle
21
+ ```sh
22
+ bundle
23
+ ```
21
24
 
22
25
  Or install it yourself as:
23
26
 
24
- $ gem install defi
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://opensource.org/licenses/MIT).
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 The challenge
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 opts [Hash] Any keyword arguments of the method.
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, **opts, &block)
18
- Challenge.new(method, *args, **opts, &block)
17
+ def self.send(method, *args, **kwargs, &block)
18
+ Challenge.new(method, *args, **kwargs, &block)
19
19
  end
20
20
  end
21
21
 
@@ -79,11 +79,11 @@ module Defi
79
79
  inspected_block = @block.nil? ? "nil" : "<Proc>"
80
80
 
81
81
  "Defi(" \
82
- "method: #{inspected_method}, " \
83
- "args: #{inspected_args}, " \
84
- "opts: #{inspected_opts}, " \
85
- "block: #{inspected_block}" \
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
- string = raised? ? "raise" : "return"
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.5
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-05-13 00:00:00.000000000 Z
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.12
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.12
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.4
169
+ rubygems_version: 3.1.6
170
170
  signing_key:
171
171
  specification_version: 4
172
172
  summary: Challenge library.