rubocop-ast 1.32.1 → 1.32.2

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: e27c2b81b954a689111e1b592d34e91d6561e4b69bbdd098464671fde8488cf2
4
- data.tar.gz: 67222d8e415d13972cc0817cd2a5468c04125600162cd0f4b3e441574deea4c3
3
+ metadata.gz: a2dd457b35c9658041396de931f65b32bb032b029e403c98c7e1da559497e217
4
+ data.tar.gz: 948fddf25b05f66a0ae568a4143edc2418f99bda4875fec16be4b07a40636656
5
5
  SHA512:
6
- metadata.gz: ac990087ef866dd14b059caa230aca760bba08db4394d65557df0aeba20d696ef9c25ccb89662428e26288b5cd8ea35d22a50884c2810bc01087188362a084f5
7
- data.tar.gz: fb46af6a67f31258c33228fa5a748a7b110be68552a47a43b5487a49521b2b2c603215802a5d1a722b185388f6af97378492bfa7fbd00f563f0738c04e2afaf9
6
+ metadata.gz: 97e596f863ead1485b8e87835ae7443c4bbb82b9a5d03f9d04310fec54f07251407c9ce222c9fae50b022a294973017bb191f066579ccdec201b87c6f0b7169a
7
+ data.tar.gz: f91ff65c507970aeb2924e648e7a82ecab3538d8c3b4c4c083d12f3343244ca62cca311762d5e272107b5608e9899d47d9846280a1a2d328f29d7a840440f2ea
@@ -4,7 +4,7 @@ module RuboCop
4
4
  module AST
5
5
  # A mixin that helps give collection nodes array polymorphism.
6
6
  module CollectionNode
7
- extend Forwardable
7
+ extend SimpleForwardable
8
8
 
9
9
  ARRAY_METHODS =
10
10
  (Array.instance_methods - Object.instance_methods - [:to_a]).freeze
@@ -9,7 +9,7 @@ module RuboCop
9
9
  # Doc on how this fits in the compiling process:
10
10
  # /docs/modules/ROOT/pages/node_pattern.adoc
11
11
  class Compiler
12
- extend Forwardable
12
+ extend SimpleForwardable
13
13
  attr_reader :captures, :named_parameters, :positional_parameters, :binding
14
14
 
15
15
  def initialize
@@ -5,7 +5,7 @@ module RuboCop
5
5
  class NodePattern
6
6
  # Base class for AST Nodes of a `NodePattern`
7
7
  class Node < ::Parser::AST::Node
8
- extend Forwardable
8
+ extend SimpleForwardable
9
9
  include ::RuboCop::AST::Descendence
10
10
 
11
11
  MATCHES_WITHIN_SET = %i[symbol number string].to_set.freeze
@@ -11,7 +11,7 @@ module RuboCop
11
11
  # Doc on how this fits in the compiling process:
12
12
  # /docs/modules/ROOT/pages/node_pattern.adoc
13
13
  class Parser < Racc::Parser
14
- extend Forwardable
14
+ extend SimpleForwardable
15
15
 
16
16
  Builder = NodePattern::Builder
17
17
  Lexer = NodePattern::Lexer
@@ -48,7 +48,7 @@ module RuboCop
48
48
  end
49
49
  end
50
50
 
51
- extend Forwardable
51
+ extend SimpleForwardable
52
52
  include MethodDefiner
53
53
  Invalid = Class.new(StandardError)
54
54
 
@@ -0,0 +1,16 @@
1
+ # frozen_string_literal: true
2
+
3
+ module RuboCop
4
+ # Similar to `Forwardable#def_delegators`, but simpler & faster
5
+ module SimpleForwardable
6
+ def def_delegators(accessor, *methods)
7
+ methods.each do |method|
8
+ class_eval(<<~RUBY, __FILE__, __LINE__ + 1)
9
+ def #{method}(...) # def example(...)
10
+ #{accessor}.#{method}(...) # foo.example(...)
11
+ end # end
12
+ RUBY
13
+ end
14
+ end
15
+ end
16
+ end
@@ -3,7 +3,7 @@
3
3
  module RuboCop
4
4
  module AST
5
5
  module Version
6
- STRING = '1.32.1'
6
+ STRING = '1.32.2'
7
7
  end
8
8
  end
9
9
  end
data/lib/rubocop/ast.rb CHANGED
@@ -5,6 +5,7 @@ require 'forwardable'
5
5
  require 'set'
6
6
 
7
7
  require_relative 'ast/ext/range'
8
+ require_relative 'ast/utilities/simple_forwardable'
8
9
  require_relative 'ast/node_pattern/method_definer'
9
10
  require_relative 'ast/node_pattern'
10
11
  require_relative 'ast/node/mixin/descendence'
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.32.1
4
+ version: 1.32.2
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: 2024-08-17 00:00:00.000000000 Z
13
+ date: 2024-09-03 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: parser
@@ -130,6 +130,7 @@ files:
130
130
  - lib/rubocop/ast/sexp.rb
131
131
  - lib/rubocop/ast/token.rb
132
132
  - lib/rubocop/ast/traversal.rb
133
+ - lib/rubocop/ast/utilities/simple_forwardable.rb
133
134
  - lib/rubocop/ast/version.rb
134
135
  homepage: https://github.com/rubocop/rubocop-ast
135
136
  licenses: