rubocop-ast 1.32.1 → 1.32.2
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/mixin/collection_node.rb +1 -1
- data/lib/rubocop/ast/node_pattern/compiler.rb +1 -1
- data/lib/rubocop/ast/node_pattern/node.rb +1 -1
- data/lib/rubocop/ast/node_pattern/parser.rb +1 -1
- data/lib/rubocop/ast/node_pattern.rb +1 -1
- data/lib/rubocop/ast/utilities/simple_forwardable.rb +16 -0
- data/lib/rubocop/ast/version.rb +1 -1
- data/lib/rubocop/ast.rb +1 -0
- metadata +3 -2
    
        checksums.yaml
    CHANGED
    
    | @@ -1,7 +1,7 @@ | |
| 1 1 | 
             
            ---
         | 
| 2 2 | 
             
            SHA256:
         | 
| 3 | 
            -
              metadata.gz:  | 
| 4 | 
            -
              data.tar.gz:  | 
| 3 | 
            +
              metadata.gz: a2dd457b35c9658041396de931f65b32bb032b029e403c98c7e1da559497e217
         | 
| 4 | 
            +
              data.tar.gz: 948fddf25b05f66a0ae568a4143edc2418f99bda4875fec16be4b07a40636656
         | 
| 5 5 | 
             
            SHA512:
         | 
| 6 | 
            -
              metadata.gz:  | 
| 7 | 
            -
              data.tar.gz:  | 
| 6 | 
            +
              metadata.gz: 97e596f863ead1485b8e87835ae7443c4bbb82b9a5d03f9d04310fec54f07251407c9ce222c9fae50b022a294973017bb191f066579ccdec201b87c6f0b7169a
         | 
| 7 | 
            +
              data.tar.gz: f91ff65c507970aeb2924e648e7a82ecab3538d8c3b4c4c083d12f3343244ca62cca311762d5e272107b5608e9899d47d9846280a1a2d328f29d7a840440f2ea
         | 
| @@ -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  | 
| 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  | 
| 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  | 
| 14 | 
            +
                    extend SimpleForwardable
         | 
| 15 15 |  | 
| 16 16 | 
             
                    Builder = NodePattern::Builder
         | 
| 17 17 | 
             
                    Lexer = NodePattern::Lexer
         | 
| @@ -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
         | 
    
        data/lib/rubocop/ast/version.rb
    CHANGED
    
    
    
        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. | 
| 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- | 
| 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:
         |