rubocop-ast 1.32.0 → 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: 173a6045b809d07aa80668e58d0967307e91573aea40a8674217b128450962cc
4
- data.tar.gz: 6343ce59279962843711b4167e907193018a48333be31ae418ce10ffed450038
3
+ metadata.gz: a2dd457b35c9658041396de931f65b32bb032b029e403c98c7e1da559497e217
4
+ data.tar.gz: 948fddf25b05f66a0ae568a4143edc2418f99bda4875fec16be4b07a40636656
5
5
  SHA512:
6
- metadata.gz: 35e6bbed1b028cb4cf9c2b775fdf676b607a913d2574059422c28f7ca4b7ccfe39c70d3ff72310af612ca678503b20d62a769d638037e956e800f1aaf28c45b8
7
- data.tar.gz: 18144f00ba89f4879c95588236f3ffc5aaca1f6993dd2ba8152b34b18c0f96c3e8434ab8cc4c1392f4235af503068018608477b4772dcc6e041616357482440f
6
+ metadata.gz: 97e596f863ead1485b8e87835ae7443c4bbb82b9a5d03f9d04310fec54f07251407c9ce222c9fae50b022a294973017bb191f066579ccdec201b87c6f0b7169a
7
+ data.tar.gz: f91ff65c507970aeb2924e648e7a82ecab3538d8c3b4c4c083d12f3343244ca62cca311762d5e272107b5608e9899d47d9846280a1a2d328f29d7a840440f2ea
data/README.md CHANGED
@@ -1,7 +1,7 @@
1
1
  # RuboCop AST
2
2
 
3
3
  [![Gem Version](https://badge.fury.io/rb/rubocop-ast.svg)](https://badge.fury.io/rb/rubocop-ast)
4
- [![CI](https://github.com/rubocop/rubocop-ast/workflows/CI/badge.svg)](https://github.com/rubocop/rubocop-ast/actions?query=workflow%3ACI)
4
+ [![CI](https://github.com/rubocop/rubocop-ast/actions/workflows/rubocop.yml/badge.svg)](https://github.com/rubocop/rubocop-ast/actions/workflows/rubocop.yml)
5
5
  [![Test Coverage](https://api.codeclimate.com/v1/badges/a29666e6373bc41bc0a9/test_coverage)](https://codeclimate.com/github/rubocop/rubocop-ast/test_coverage)
6
6
  [![Maintainability](https://api.codeclimate.com/v1/badges/a29666e6373bc41bc0a9/maintainability)](https://codeclimate.com/github/rubocop/rubocop-ast/maintainability)
7
7
 
@@ -12,6 +12,14 @@ module RuboCop
12
12
  def body
13
13
  node_parts[1]
14
14
  end
15
+
16
+ # Checks whether this node body is a void context.
17
+ # Always `true` for `ensure`.
18
+ #
19
+ # @return [true] whether the `ensure` node body is a void context
20
+ def void_context?
21
+ true
22
+ end
15
23
  end
16
24
  end
17
25
  end
@@ -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.0'
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.0
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-05 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: