rubocop-ast 1.28.1 → 1.29.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: 35637162017455f25a93b82ace91c60d10ef01db306b812a05335ca84a2446e8
4
- data.tar.gz: 7baca648669bf1f6bd5c9b6880a57cae31fd62cf0e9b0cd8e5ec2b3c5f644cd2
3
+ metadata.gz: b08ce67ff41a6d40d8385735fe36ebe6fd90513f3cbafbd21afa4f9393a66f9a
4
+ data.tar.gz: 24e6a84531e66531bcf5c358cfbed40815d1fd3f1d91e598a5b884a1971bb3c7
5
5
  SHA512:
6
- metadata.gz: a3445c27a6992b0a1a4895c233743754b47636857986917c0a3d0eafa38afb4b82260ab01f48ed24d9fe35858578a7343270893476bafe8bae182b230cd73766
7
- data.tar.gz: 55f86a1621b6e73ff97d29c8f37a0a3518560b29baf97c450254fc4b9f874e45c27e7ce83450aec72d735dfffd9455b63973ef5396c7a19d1700a130c9ecfd5d
6
+ metadata.gz: 20a8ea979cb2335691b7b39c9986962edc2fe61667e712187e3904e2a984fc3327b38034eca64028a362724964e982d053a093432d3f7994edae592cd8f6fb83
7
+ data.tar.gz: 59ab4c65c59d3407224147391e8b253c930da8add826c50553b433039057865aa1211d13e90061bb4e3a40ebb97184ea8d5698f3b4f5d0ff7c3c343d14a566bd
@@ -5,7 +5,7 @@ module RuboCop
5
5
  # Common functionality for nodes that are a kind of method dispatch:
6
6
  # `send`, `csend`, `super`, `zsuper`, `yield`, `defined?`,
7
7
  # and (modern only): `index`, `indexasgn`, `lambda`
8
- module MethodDispatchNode
8
+ module MethodDispatchNode # rubocop:disable Metrics/ModuleLength
9
9
  extend NodePattern::Macros
10
10
  include MethodIdentifierPredicates
11
11
 
@@ -28,6 +28,17 @@ module RuboCop
28
28
  node_parts[1]
29
29
  end
30
30
 
31
+ # The source range for the method name or keyword that dispatches this call.
32
+ #
33
+ # @return [Parser::Source::Range] the source range for the method name or keyword
34
+ def selector
35
+ if loc.respond_to? :keyword
36
+ loc.keyword
37
+ else
38
+ loc.selector
39
+ end
40
+ end
41
+
31
42
  # The `block` or `numblock` node associated with this method dispatch, if any.
32
43
  #
33
44
  # @return [BlockNode, nil] the `block` or `numblock` node associated with this method
@@ -147,7 +158,7 @@ module RuboCop
147
158
  #
148
159
  # @return [Boolean] whether the method is the implicit form of `#call`
149
160
  def implicit_call?
150
- method?(:call) && !loc.selector
161
+ method?(:call) && !selector
151
162
  end
152
163
 
153
164
  # Whether this method dispatch has an explicit block.
@@ -222,9 +233,9 @@ module RuboCop
222
233
  #
223
234
  # @return [Boolean] whether this method is a unary operation
224
235
  def unary_operation?
225
- return false unless loc.selector
236
+ return false unless selector
226
237
 
227
- operator_method? && loc.expression.begin_pos == loc.selector.begin_pos
238
+ operator_method? && loc.expression.begin_pos == selector.begin_pos
228
239
  end
229
240
 
230
241
  # Checks whether this is a binary operation.
@@ -235,9 +246,9 @@ module RuboCop
235
246
  #
236
247
  # @return [Boolean] whether this method is a binary operation
237
248
  def binary_operation?
238
- return false unless loc.selector
249
+ return false unless selector
239
250
 
240
- operator_method? && loc.expression.begin_pos != loc.selector.begin_pos
251
+ operator_method? && loc.expression.begin_pos != selector.begin_pos
241
252
  end
242
253
 
243
254
  private
@@ -3,7 +3,7 @@
3
3
  module RuboCop
4
4
  module AST
5
5
  module Version
6
- STRING = '1.28.1'
6
+ STRING = '1.29.0'
7
7
  end
8
8
  end
9
9
  end
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.28.1
4
+ version: 1.29.0
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: 2023-05-02 00:00:00.000000000 Z
13
+ date: 2023-06-01 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: parser
@@ -26,26 +26,6 @@ dependencies:
26
26
  - - ">="
27
27
  - !ruby/object:Gem::Version
28
28
  version: 3.2.1.0
29
- - !ruby/object:Gem::Dependency
30
- name: bundler
31
- requirement: !ruby/object:Gem::Requirement
32
- requirements:
33
- - - ">="
34
- - !ruby/object:Gem::Version
35
- version: 1.15.0
36
- - - "<"
37
- - !ruby/object:Gem::Version
38
- version: '3.0'
39
- type: :development
40
- prerelease: false
41
- version_requirements: !ruby/object:Gem::Requirement
42
- requirements:
43
- - - ">="
44
- - !ruby/object:Gem::Version
45
- version: 1.15.0
46
- - - "<"
47
- - !ruby/object:Gem::Version
48
- version: '3.0'
49
29
  description: " RuboCop's Node and NodePattern classes.\n"
50
30
  email: rubocop@googlegroups.com
51
31
  executables: []