deadlyzer 0.1.0 → 0.1.1

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: 44f9e798e87a8ce44f9cc08c7ebe56e3e9d9078f49cb0bcc25955f804c6961d8
4
- data.tar.gz: d99a693be1a3d66c2cd4d0b459508ad07faafec82b8ff53fba0e8f6ebafc22e4
3
+ metadata.gz: 251fc74dfdaa424427f934cf90ee3d2893af33c3844f3f1ebec38a109e145d68
4
+ data.tar.gz: 4d38ba28b5ce300b6514aa9e2f38d71c5ddf769521d281eabe5041c9c2c054ff
5
5
  SHA512:
6
- metadata.gz: 07743314cfc763ba0ab1f2125fecfc93200747863453490e6671e5882b471ab2cd111bab3fa631ce9cf5525879438513681ae3a3cb5f16398cec102636bcf1c2
7
- data.tar.gz: 1423f22fe859022afbf0a9fc9319e75ca49da0452a82d7b768f3411cffb47779f4c81782fe3d6c450b41dc187965391f11de2243183d8b513e3052d553d5e6f4
6
+ metadata.gz: 813db60466c851199829a0e9dd5cf22e8872118afb33a23dbf0dcccb2cd0be8e7d2dd7ca8c7250052c1c030f2037ebc0d7057fd368d07fb89ab696f37db7d1a4
7
+ data.tar.gz: 403530200ae21e8a593c03dd6fa30d86a92618ddaa2e86f97da65259ee6e8bfd8718c31be526169acf4b77dc9925ae901b6ab714347ade5aa56cc8df316f0687
@@ -130,11 +130,17 @@ module Deadlyzer
130
130
  tc.name if against.any? {|ac| ac.name == tc.name}
131
131
  end
132
132
 
133
- constants = (used_constants + target).group_by(&:itself).transform_values(&:count)
133
+ constants = (used_constants + target).group_by{|c| c if c.name}.transform_values(&:count)
134
134
  constants.each do |constant, count|
135
- constants_may_not_used.push constant if count < 2
135
+ constants_may_not_used.push constant if count < match_count
136
136
  end
137
137
  end
138
138
 
139
+ # @api private
140
+ # @since 0.1.1
141
+ def match_count
142
+ config.min_match_count || 2
143
+ end
144
+
139
145
  end
140
146
  end
@@ -1,5 +1,5 @@
1
1
  module Deadlyzer
2
2
  # @api private
3
3
  # @since 0.1.0
4
- VERSION = "0.1.0"
4
+ VERSION = "0.1.1"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: deadlyzer
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Farhad
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-05-13 00:00:00.000000000 Z
11
+ date: 2020-05-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake