Script 'mail_helper' called by obssrc
Hello community,
here is the log from the commit of package rubygem-rubocop-ast for
openSUSE:Factory checked in at 2021-06-01 10:39:59
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/rubygem-rubocop-ast (Old)
and /work/SRC/openSUSE:Factory/.rubygem-rubocop-ast.new.1898 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "rubygem-rubocop-ast"
Tue Jun 1 10:39:59 2021 rev:10 rq:896522 version:1.7.0
Changes:
--------
--- /work/SRC/openSUSE:Factory/rubygem-rubocop-ast/rubygem-rubocop-ast.changes
2021-05-16 23:40:59.937858348 +0200
+++
/work/SRC/openSUSE:Factory/.rubygem-rubocop-ast.new.1898/rubygem-rubocop-ast.changes
2021-06-01 10:41:35.649235177 +0200
@@ -1,0 +2,18 @@
+Tue Jun 1 03:42:13 UTC 2021 - Manuel Schnitzer <[email protected]>
+
+- updated to version 1.7.0
+
+ ## 1.7.0 (2021-05-28)
+
+ ### New features
+
+ * [#171](https://github.com/rubocop-hq/rubocop-ast/pull/171): Add
`SendNode#def_modifier` that returns the `def` node it modifies, or `nil`.
([@marcandre][])
+ * [#186](https://github.com/rubocop-hq/rubocop-ast/pull/186): Add `pattern`
method for `AST::InPatternNode` node. ([@koic][])
+
+ ## 1.6.0 (2021-05-26)
+
+ ### New features
+
+ * [#183](https://github.com/rubocop-hq/rubocop-ast/pull/183): Add
`AST::InPatternNode` node. ([@koic][])
+
+-------------------------------------------------------------------
Old:
----
rubocop-ast-1.5.0.gem
New:
----
rubocop-ast-1.7.0.gem
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ rubygem-rubocop-ast.spec ++++++
--- /var/tmp/diff_new_pack.eGkiuk/_old 2021-06-01 10:41:36.237236178 +0200
+++ /var/tmp/diff_new_pack.eGkiuk/_new 2021-06-01 10:41:36.245236191 +0200
@@ -16,29 +16,31 @@
#
-%define mod_name rubocop-ast
-%define mod_full_name %{mod_name}-%{version}
#
# This file was generated with a gem2rpm.yml and not just plain gem2rpm.
# All sections marked as MANUAL, license headers, summaries and descriptions
# can be maintained in that file. Please consult this file before editing any
# of those fields
#
+
Name: rubygem-rubocop-ast
-Version: 1.5.0
+Version: 1.7.0
Release: 0
-Summary: RuboCop tools to deal with Ruby code AST
-License: MIT
-Group: Development/Languages/Ruby
-URL: https://github.com/rubocop-hq/rubocop-ast
-Source: https://rubygems.org/gems/%{mod_full_name}.gem
-Source1: gem2rpm.yml
-BuildRequires: %{ruby >= 2.5.0}
-BuildRequires: %{rubygem gem2rpm}
-BuildRequires: ruby-macros >= 5
+%define mod_name rubocop-ast
+%define mod_full_name %{mod_name}-%{version}
# MANUAL
BuildRequires: fdupes
# /MANUAL
+BuildRoot: %{_tmppath}/%{name}-%{version}-build
+BuildRequires: %{ruby >= 2.5.0}
+BuildRequires: %{rubygem gem2rpm}
+BuildRequires: ruby-macros >= 5
+URL: https://github.com/rubocop-hq/rubocop-ast
+Source: https://rubygems.org/gems/%{mod_full_name}.gem
+Source1: gem2rpm.yml
+Summary: RuboCop tools to deal with Ruby code AST
+License: MIT
+Group: Development/Languages/Ruby
%description
RuboCop's Node and NodePattern classes.
++++++ rubocop-ast-1.5.0.gem -> rubocop-ast-1.7.0.gem ++++++
Binary files old/checksums.yaml.gz and new/checksums.yaml.gz differ
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/lib/rubocop/ast/builder.rb
new/lib/rubocop/ast/builder.rb
--- old/lib/rubocop/ast/builder.rb 2021-05-02 12:42:39.000000000 +0200
+++ new/lib/rubocop/ast/builder.rb 2021-05-28 18:57:48.000000000 +0200
@@ -49,6 +49,7 @@
float: FloatNode,
hash: HashNode,
if: IfNode,
+ in_pattern: InPatternNode,
int: IntNode,
index: IndexNode,
indexasgn: IndexasgnNode,
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/lib/rubocop/ast/node/case_match_node.rb
new/lib/rubocop/ast/node/case_match_node.rb
--- old/lib/rubocop/ast/node/case_match_node.rb 2021-05-02 12:42:39.000000000
+0200
+++ new/lib/rubocop/ast/node/case_match_node.rb 2021-05-28 18:57:48.000000000
+0200
@@ -24,9 +24,9 @@
self
end
- # Returns an array of all the when branches in the `case` statement.
+ # Returns an array of all the `in` pattern branches in the `case`
statement.
#
- # @return [Array<Node>] an array of `in_pattern` nodes
+ # @return [Array<InPatternNode>] an array of `in_pattern` nodes
def in_pattern_branches
node_parts[1...-1]
end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/lib/rubocop/ast/node/in_pattern_node.rb
new/lib/rubocop/ast/node/in_pattern_node.rb
--- old/lib/rubocop/ast/node/in_pattern_node.rb 1970-01-01 01:00:00.000000000
+0100
+++ new/lib/rubocop/ast/node/in_pattern_node.rb 2021-05-28 18:57:48.000000000
+0200
@@ -0,0 +1,38 @@
+# frozen_string_literal: true
+
+module RuboCop
+ module AST
+ # A node extension for `in` nodes. This will be used in place of a plain
+ # node when the builder constructs the AST, making its methods available
+ # to all `in` nodes within RuboCop.
+ class InPatternNode < Node
+ # Returns a node of the pattern in the `in` branch.
+ #
+ # @return [Node] a pattern node
+ def pattern
+ node_parts.first
+ end
+
+ # Returns the index of the `in` branch within the `case` statement.
+ #
+ # @return [Integer] the index of the `in` branch
+ def branch_index
+ parent.in_pattern_branches.index(self)
+ end
+
+ # Checks whether the `in` node has a `then` keyword.
+ #
+ # @return [Boolean] whether the `in` node has a `then` keyword
+ def then?
+ loc.begin&.is?('then')
+ end
+
+ # Returns the body of the `in` node.
+ #
+ # @return [Node, nil] the body of the `in` node
+ def body
+ node_parts[-1]
+ end
+ end
+ end
+end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/lib/rubocop/ast/node/mixin/method_dispatch_node.rb
new/lib/rubocop/ast/node/mixin/method_dispatch_node.rb
--- old/lib/rubocop/ast/node/mixin/method_dispatch_node.rb 2021-05-02
12:42:39.000000000 +0200
+++ new/lib/rubocop/ast/node/mixin/method_dispatch_node.rb 2021-05-28
18:57:48.000000000 +0200
@@ -165,16 +165,34 @@
ARITHMETIC_OPERATORS.include?(method_name)
end
- # Checks if this node is part of a chain of `def` modifiers.
+ # Checks if this node is part of a chain of `def` or `defs` modifiers.
#
# @example
#
# private def foo; end
#
- # @return [Boolean] whether the dispatched method is a `def` modifier
- def def_modifier?
- send_type? &&
- adjacent_def_modifier? ||
each_child_node(:send).any?(&:def_modifier?)
+ # @return wether the `def|defs` node is a modifier or not.
+ # See also `def_modifier` that returns the node or `nil`
+ def def_modifier?(node = self)
+ !!def_modifier(node)
+ end
+
+ # Checks if this node is part of a chain of `def` or `defs` modifiers.
+ #
+ # @example
+ #
+ # private def foo; end
+ #
+ # @return [Node | nil] returns the `def|defs` node this is a modifier
for,
+ # or `nil` if it isn't a def modifier
+ def def_modifier(node = self)
+ arg = node.children[2]
+
+ return unless node.send_type? && node.receiver.nil? &&
arg.is_a?(::AST::Node)
+
+ return arg if arg.def_type? || arg.defs_type?
+
+ def_modifier(arg)
end
# Checks whether this is a lambda. Some versions of parser parses
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/lib/rubocop/ast/version.rb
new/lib/rubocop/ast/version.rb
--- old/lib/rubocop/ast/version.rb 2021-05-02 12:42:39.000000000 +0200
+++ new/lib/rubocop/ast/version.rb 2021-05-28 18:57:48.000000000 +0200
@@ -3,7 +3,7 @@
module RuboCop
module AST
module Version
- STRING = '1.5.0'
+ STRING = '1.7.0'
end
end
end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/lib/rubocop/ast.rb new/lib/rubocop/ast.rb
--- old/lib/rubocop/ast.rb 2021-05-02 12:42:39.000000000 +0200
+++ new/lib/rubocop/ast.rb 2021-05-28 18:57:48.000000000 +0200
@@ -53,6 +53,7 @@
require_relative 'ast/node/float_node'
require_relative 'ast/node/hash_node'
require_relative 'ast/node/if_node'
+require_relative 'ast/node/in_pattern_node'
require_relative 'ast/node/index_node'
require_relative 'ast/node/indexasgn_node'
require_relative 'ast/node/int_node'
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/metadata new/metadata
--- old/metadata 2021-05-02 12:42:39.000000000 +0200
+++ new/metadata 2021-05-28 18:57:48.000000000 +0200
@@ -1,7 +1,7 @@
--- !ruby/object:Gem::Specification
name: rubocop-ast
version: !ruby/object:Gem::Version
- version: 1.5.0
+ version: 1.7.0
platform: ruby
authors:
- Bozhidar Batsov
@@ -10,7 +10,7 @@
autorequire:
bindir: bin
cert_chain: []
-date: 2021-05-02 00:00:00.000000000 Z
+date: 2021-05-28 00:00:00.000000000 Z
dependencies:
- !ruby/object:Gem::Dependency
name: parser
@@ -82,6 +82,7 @@
- lib/rubocop/ast/node/forward_args_node.rb
- lib/rubocop/ast/node/hash_node.rb
- lib/rubocop/ast/node/if_node.rb
+- lib/rubocop/ast/node/in_pattern_node.rb
- lib/rubocop/ast/node/index_node.rb
- lib/rubocop/ast/node/indexasgn_node.rb
- lib/rubocop/ast/node/int_node.rb