matchi-fix 2.1.1 → 2.1.2

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/README.md +1 -1
  3. data/lib/matchi/fix.rb +9 -4
  4. metadata +4 -4
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 40d7531073da5b8a4303fc9c3cae6b9caae05084ab3d9522a8e1f5c5e7f1fe18
4
- data.tar.gz: 6886e9b0c8339f4270522436eab1ed9df61a8ad98eea7486733afe4c113d849e
3
+ metadata.gz: 547d326ef94fd070ce52ea17e95d5f9a1de1821ffc469370a9dce1271295da4d
4
+ data.tar.gz: 11d030cc6082d07a41e0eacc81402d657328013874b39df928634ce80f41fd9a
5
5
  SHA512:
6
- metadata.gz: 6c884e1a53abe424c671cc9a2b9f66584422a045ae92c72009431c41c15bf7e970806ea09e6cbff6e447f362fd24e830bdac58a755d30700809d701d649dfe04
7
- data.tar.gz: 6d053108ce76597356f41122a4718432cb78bd508c728ebdfa6f002382ae65f6cab6fbb6f87a8ecc783d821fdce6bc5a44e5ee2fb3a4d80c5667a47493b8b010
6
+ metadata.gz: daceccfb49e044c04361c08e13d03c5c451fcbb2f6bf9566fe14d9b9ac0cf4f12fae1af73e3563aaa8c2fc0aabd770d8665ecb8cfe1f7d29cf7cbc5771ab5c5f
7
+ data.tar.gz: 6c6a5dc3779629b8b9783b8df577d3c9a225b58dcbccdcd4efc5ca99f2e8b7248f41f2cbb7915b0b1ae7c9743f0c273a21400deed47198521c8b6d7f64ddab36
data/README.md CHANGED
@@ -6,7 +6,7 @@
6
6
  [![RuboCop](https://github.com/fixrb/matchi-fix/workflows/RuboCop/badge.svg?branch=main)](https://github.com/fixrb/matchi-fix/actions?query=workflow%3Arubocop+branch%3Amain)
7
7
  [![License](https://img.shields.io/github/license/fixrb/matchi-fix?label=License&logo=github)](https://github.com/fixrb/matchi-fix/raw/main/LICENSE.md)
8
8
 
9
- > A [Fix](https://github.com/fixrb/fix) specifications matcher compatible with [Matchi](https://github.com/fixrb/matchi).
9
+ > A [Fix](https://github.com/fixrb/fix) specing matcher compatible with [Matchi](https://github.com/fixrb/matchi).
10
10
 
11
11
  ## Installation
12
12
 
data/lib/matchi/fix.rb CHANGED
@@ -4,7 +4,7 @@ require "fix"
4
4
 
5
5
  # Namespace for the Matchi library.
6
6
  module Matchi
7
- # **Fix** matcher.
7
+ # **Fix** specing matcher.
8
8
  class Fix
9
9
  # @return [#against] A set of specifications.
10
10
  attr_reader :expected
@@ -28,14 +28,15 @@ module Matchi
28
28
  # @param name [String, Symbol] The constant name of the specifications.
29
29
  # @param block [Proc] A block of specifications.
30
30
  def initialize(name = nil, &block)
31
- @expected = if name.nil?
31
+ @name = name
32
+
33
+ @expected = if unnamed?
32
34
  raise ::ArgumentError, "Pass either an argument or a block" unless block
33
35
 
34
36
  Fix(&block)
35
37
  else
36
38
  raise ::ArgumentError, "Can't pass both an argument and a block" if block
37
39
 
38
- @name = name
39
40
  ::Fix[name]
40
41
  end
41
42
  end
@@ -83,8 +84,12 @@ module Matchi
83
84
 
84
85
  private
85
86
 
87
+ def unnamed?
88
+ @name.nil?
89
+ end
90
+
86
91
  def parameter
87
- @name.nil? ? "&specs" : ":#{@name}"
92
+ unnamed? ? "&specs" : ":#{@name}"
88
93
  end
89
94
  end
90
95
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: matchi-fix
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.1
4
+ version: 2.1.2
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-07-30 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: fix
@@ -150,7 +150,7 @@ dependencies:
150
150
  - - ">="
151
151
  - !ruby/object:Gem::Version
152
152
  version: '0'
153
- description: A Fix specifications matcher compatible with Matchi.
153
+ description: A Fix specing matcher compatible with Matchi.
154
154
  email: contact@cyril.email
155
155
  executables: []
156
156
  extensions: []
@@ -181,5 +181,5 @@ requirements: []
181
181
  rubygems_version: 3.1.6
182
182
  signing_key:
183
183
  specification_version: 4
184
- summary: Fix specifications matcher.
184
+ summary: Fix specing matcher.
185
185
  test_files: []