rubocop-ast 1.38.0 → 1.38.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/rubocop/ast/node/masgn_node.rb +1 -1
- data/lib/rubocop/ast/node/mixin/hash_element_node.rb +2 -0
- data/lib/rubocop/ast/node/mixin/method_dispatch_node.rb +1 -1
- data/lib/rubocop/ast/node/mixin/parameterized_node.rb +1 -1
- data/lib/rubocop/ast/utilities/simple_forwardable.rb +16 -5
- data/lib/rubocop/ast/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c7fd9852873f22808386ddc6962f7373509ec03930f3e5c667475d512480b705
|
4
|
+
data.tar.gz: b6d36926cd045b8486679af378d1fdd21875b941d3f5916fbb6876f04ef75e11
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b83bb3a5b3c20a8831d6ad8e075d536b3ff8042d873ce6062161fbe1556e80da5fc4646499dc0432864ecb034ffe3ade83f7ac2f37562a9df22620b486e61e5a
|
7
|
+
data.tar.gz: d6f98f800797330d515911991c9215e8fa616cdcde7a73666aa0d25ff05b70b9274a1f0df689f8a820a6573c391bca487100a258a142c21a60f3fd8ea6e5c5e8
|
@@ -20,7 +20,7 @@ module RuboCop
|
|
20
20
|
# @return [Array<Symbol>] names of all the variables being assigned
|
21
21
|
def names
|
22
22
|
assignments.map do |assignment|
|
23
|
-
if assignment.
|
23
|
+
if assignment.type?(:send, :indexasgn)
|
24
24
|
assignment.method_name
|
25
25
|
else
|
26
26
|
assignment.name
|
@@ -99,7 +99,9 @@ module RuboCop
|
|
99
99
|
|
100
100
|
def valid_argument_types?
|
101
101
|
[first, second].all? do |argument|
|
102
|
+
# rubocop:disable InternalAffairs/NodeTypeMultiplePredicates
|
102
103
|
argument.pair_type? || argument.kwsplat_type?
|
104
|
+
# rubocop:enable InternalAffairs/NodeTypeMultiplePredicates
|
103
105
|
end
|
104
106
|
end
|
105
107
|
|
@@ -57,7 +57,7 @@ module RuboCop
|
|
57
57
|
# @return [Boolean] whether the last argument of the node is a block pass
|
58
58
|
def block_argument?
|
59
59
|
arguments? &&
|
60
|
-
|
60
|
+
last_argument.type?(:block_pass, :blockarg)
|
61
61
|
end
|
62
62
|
|
63
63
|
# A specialized `ParameterizedNode` for node that have a single child
|
@@ -5,11 +5,22 @@ module RuboCop
|
|
5
5
|
module SimpleForwardable
|
6
6
|
def def_delegators(accessor, *methods)
|
7
7
|
methods.each do |method|
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
8
|
+
if method.end_with?('=') && method.to_s != '[]='
|
9
|
+
# Defining a delegator for `foo=` can't use `foo=(...)` because it is a
|
10
|
+
# syntax error. Fall back to doing a slower `public_send` instead.
|
11
|
+
# TODO: Use foo(method, ...) when Ruby 3.1 is required.
|
12
|
+
class_eval(<<~RUBY, __FILE__, __LINE__ + 1)
|
13
|
+
def #{method}(*args, **kwargs, &blk) # def example=(*args, **kwargs, &blk)
|
14
|
+
#{accessor}.public_send(:#{method}, *args, **kwargs, &blk) # foo.public_send(:example=, *args, **kwargs, &blk)
|
15
|
+
end # end
|
16
|
+
RUBY
|
17
|
+
else
|
18
|
+
class_eval(<<~RUBY, __FILE__, __LINE__ + 1)
|
19
|
+
def #{method}(...) # def example(...)
|
20
|
+
#{accessor}.#{method}(...) # foo.example(...)
|
21
|
+
end # end
|
22
|
+
RUBY
|
23
|
+
end
|
13
24
|
end
|
14
25
|
end
|
15
26
|
end
|
data/lib/rubocop/ast/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rubocop-ast
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.38.
|
4
|
+
version: 1.38.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Bozhidar Batsov
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2025-
|
13
|
+
date: 2025-02-25 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: parser
|