rubocop-ast 1.29.0 → 1.30.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: b08ce67ff41a6d40d8385735fe36ebe6fd90513f3cbafbd21afa4f9393a66f9a
4
- data.tar.gz: 24e6a84531e66531bcf5c358cfbed40815d1fd3f1d91e598a5b884a1971bb3c7
3
+ metadata.gz: 84c917625cddd9b79c0979e269fdd324f8119b9d2b3c6081fae0ef449669bea5
4
+ data.tar.gz: 8d053cac9c670216326df54b5b7b6a8961bf89614defa16e93ad1c557a8b25a5
5
5
  SHA512:
6
- metadata.gz: 20a8ea979cb2335691b7b39c9986962edc2fe61667e712187e3904e2a984fc3327b38034eca64028a362724964e982d053a093432d3f7994edae592cd8f6fb83
7
- data.tar.gz: 59ab4c65c59d3407224147391e8b253c930da8add826c50553b433039057865aa1211d13e90061bb4e3a40ebb97184ea8d5698f3b4f5d0ff7c3c343d14a566bd
6
+ metadata.gz: c95bd42a576592153d70f61367aafacd9677021515534a487706b736cc02cfcf717fc6db39e3df7212088301383cb7d60af9b929b4ca65b7baa5a66f5eca059e
7
+ data.tar.gz: f0d99d3695e651ec10709dd729696a2b137c3b11603598164b433f61583218b16807c44ea1637ebe1922b496b8472795e4d54a4dc1312908f049e6f43b242ff8
@@ -21,6 +21,24 @@ module RuboCop
21
21
  node_parts[0]
22
22
  end
23
23
 
24
+ # A shorthand for getting the first argument of this block.
25
+ # Equivalent to `arguments.first`.
26
+ #
27
+ # @return [Node, nil] the first argument of this block,
28
+ # or `nil` if there are no arguments
29
+ def first_argument
30
+ arguments[0]
31
+ end
32
+
33
+ # A shorthand for getting the last argument of this block.
34
+ # Equivalent to `arguments.last`.
35
+ #
36
+ # @return [Node, nil] the last argument of this block,
37
+ # or `nil` if there are no arguments
38
+ def last_argument
39
+ arguments[-1]
40
+ end
41
+
24
42
  # The arguments of this block.
25
43
  # Note that if the block has destructured arguments, `arguments` will
26
44
  # return a `mlhs` node, whereas `argument_list` will return only
@@ -81,7 +81,7 @@ module RuboCop
81
81
  (if? || unless?) && super
82
82
  end
83
83
 
84
- # Chacks whether the `if` node has nested `if` nodes in any of its
84
+ # Checks whether the `if` node has nested `if` nodes in any of its
85
85
  # branches.
86
86
  #
87
87
  # @note This performs a shallow search.
@@ -2,7 +2,7 @@
2
2
  # encoding: UTF-8
3
3
  #--
4
4
  # This file is automatically generated. Do not modify it.
5
- # Generated by: oedipus_lex version 2.6.0.
5
+ # Generated by: oedipus_lex version 2.6.1.
6
6
  # Source: lib/rubocop/ast/node_pattern/lexer.rex
7
7
  #++
8
8
 
@@ -207,7 +207,7 @@ module RuboCop
207
207
  include ForbidInSeqHead
208
208
 
209
209
  def arity
210
- min, max = children.map(&:arity_range).map(&:minmax).transpose.map(&:sum)
210
+ min, max = children.map { |child| child.arity_range.minmax }.transpose.map(&:sum)
211
211
  min == max ? min || 0 : min..max # NOTE: || 0 for empty case, where min == max == nil.
212
212
  end
213
213
 
@@ -223,7 +223,7 @@ module RuboCop
223
223
  # Node class for `{ ... }`
224
224
  class Union < Node
225
225
  def arity
226
- minima, maxima = children.map(&:arity_range).map(&:minmax).transpose
226
+ minima, maxima = children.map { |child| child.arity_range.minmax }.transpose
227
227
  min = minima.min
228
228
  max = maxima.max
229
229
  min == max ? min : min..max
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
  #
3
3
  # DO NOT MODIFY!!!!
4
- # This file is automatically generated by Racc 1.6.2
4
+ # This file is automatically generated by Racc 1.7.1
5
5
  # from Racc grammar file "".
6
6
  #
7
7
 
@@ -239,6 +239,7 @@ Racc_arg = [
239
239
  racc_shift_n,
240
240
  racc_reduce_n,
241
241
  racc_use_result_var ]
242
+ Ractor.make_shareable(Racc_arg) if defined?(Ractor)
242
243
 
243
244
  Racc_token_to_s_table = [
244
245
  "$end",
@@ -289,6 +290,7 @@ Racc_token_to_s_table = [
289
290
  "opt_rest",
290
291
  "rest",
291
292
  "arg_list" ]
293
+ Ractor.make_shareable(Racc_token_to_s_table) if defined?(Ractor)
292
294
 
293
295
  Racc_debug_parser = false
294
296
 
@@ -3,7 +3,7 @@
3
3
  module RuboCop
4
4
  module AST
5
5
  module Version
6
- STRING = '1.29.0'
6
+ STRING = '1.30.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.29.0
4
+ version: 1.30.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-06-01 00:00:00.000000000 Z
13
+ date: 2023-10-26 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: parser
@@ -156,7 +156,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
156
156
  - !ruby/object:Gem::Version
157
157
  version: '0'
158
158
  requirements: []
159
- rubygems_version: 3.4.1
159
+ rubygems_version: 3.4.10
160
160
  signing_key:
161
161
  specification_version: 4
162
162
  summary: RuboCop tools to deal with Ruby code AST.