strict 1.3.1 → 1.4.0

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: 0af28e3c930c3859226bfad6360511e5941d63c0f14fdeb761c7db3f5ab316e8
4
- data.tar.gz: 68423c7710c7da8cf074efea03b48bc49bcd31b31e7ab66808f6fea9b7b11246
3
+ metadata.gz: b15e13a3f628809ea9410898b170658979f5e4c5a69b03a1ef4dcccad35e947f
4
+ data.tar.gz: b37173fddebaa55c744c20230548a80832a38c86e6bb4879f39d54a105fb5ddb
5
5
  SHA512:
6
- metadata.gz: eae1ecfe69816a29f9bfdec1ba1d9648f5d30f08dcfd9400a99f0c68a167404965fc976218cfa4c1b2e507477f1c08b68ae8293ec738ad3c6d3dfec2158763ea
7
- data.tar.gz: 2056d98bdcb4d26b429636ac71158113f0ad0fa57459d1d750bbe8428fa99995364d00726c5cbec77e76b492b3e405d26463e42fa2150e4f06bdc98cca09da25
6
+ metadata.gz: 25bb591ed6df44c60f6e2c01f977f4fcb881b022e62af11adbcd32e4d15dd83bfbfd34a1f20139aa64b0de0e8447e8cdc9e73d6ff5ac5331ea1ef9cab81f1f7e
7
+ data.tar.gz: 46ddcaa771d227162e762d6bb424382c0efc3451d540340ad70a888842669ad8fb5969af11302d49ff5c5f5334852d44201be20253c399156373d9fd5d4c7ae8
data/Gemfile.lock CHANGED
@@ -1,14 +1,14 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- strict (1.3.1)
4
+ strict (1.4.0)
5
5
  zeitwerk (~> 2.6)
6
6
 
7
7
  GEM
8
8
  remote: https://rubygems.org/
9
9
  specs:
10
10
  ast (2.4.2)
11
- debug (1.6.2)
11
+ debug (1.6.3)
12
12
  irb (>= 1.3.6)
13
13
  reline (>= 0.3.1)
14
14
  gem-release (2.2.2)
@@ -27,25 +27,25 @@ GEM
27
27
  reline (0.3.1)
28
28
  io-console (~> 0.5)
29
29
  rexml (3.2.5)
30
- rubocop (1.36.0)
30
+ rubocop (1.38.0)
31
31
  json (~> 2.3)
32
32
  parallel (~> 1.10)
33
33
  parser (>= 3.1.2.1)
34
34
  rainbow (>= 2.2.2, < 4.0)
35
35
  regexp_parser (>= 1.8, < 3.0)
36
36
  rexml (>= 3.2.5, < 4.0)
37
- rubocop-ast (>= 1.20.1, < 2.0)
37
+ rubocop-ast (>= 1.23.0, < 2.0)
38
38
  ruby-progressbar (~> 1.7)
39
39
  unicode-display_width (>= 1.4.0, < 3.0)
40
- rubocop-ast (1.21.0)
40
+ rubocop-ast (1.23.0)
41
41
  parser (>= 3.1.1.0)
42
- rubocop-minitest (0.22.2)
42
+ rubocop-minitest (0.23.0)
43
43
  rubocop (>= 0.90, < 2.0)
44
44
  rubocop-rake (0.6.0)
45
45
  rubocop (~> 1.0)
46
46
  ruby-progressbar (1.11.0)
47
47
  unicode-display_width (2.3.0)
48
- zeitwerk (2.6.1)
48
+ zeitwerk (2.6.4)
49
49
 
50
50
  PLATFORMS
51
51
  arm64-darwin-21
@@ -12,7 +12,7 @@ module Strict
12
12
  h[k] = { additional_parameters: [], missing_parameters: [], non_keyword_parameters: [] }
13
13
  end
14
14
 
15
- self.class.strict_instance_methods.each do |method_name, strict_method|
15
+ self.class.strict_instance_methods.each do |method_name, strict_method| # rubocop:disable Metrics/BlockLength
16
16
  unless implementation.respond_to?(method_name)
17
17
  missing_methods ||= []
18
18
  missing_methods << method_name
@@ -21,9 +21,16 @@ module Strict
21
21
 
22
22
  expected_parameters = Set.new(strict_method.parameters.map(&:name))
23
23
  defined_parameters = Set.new
24
+ has_keyword_splat = false
24
25
 
25
26
  implementation.method(method_name).parameters.each do |kind, parameter_name|
26
- next if kind == :block
27
+ case kind
28
+ when :block, :rest
29
+ next
30
+ when :keyrest
31
+ has_keyword_splat = true
32
+ next
33
+ end
27
34
 
28
35
  if expected_parameters.include?(parameter_name)
29
36
  defined_parameters.add(parameter_name)
@@ -33,6 +40,8 @@ module Strict
33
40
  end
34
41
  end
35
42
 
43
+ next if has_keyword_splat
44
+
36
45
  missing_parameters = expected_parameters - defined_parameters
37
46
  invalid_method_definitions[method_name][:missing_parameters] = missing_parameters if missing_parameters.any?
38
47
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Strict
4
- VERSION = "1.3.1"
4
+ VERSION = "1.4.0"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: strict
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.1
4
+ version: 1.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kyle Thompson
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-10-20 00:00:00.000000000 Z
11
+ date: 2022-11-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: zeitwerk