Skip to content

Commit

Permalink
Drop Ruby 2.6 runtime support
Browse files Browse the repository at this point in the history
Follow up #277 (comment).

This PR drops Ruby 2.6 runtime support to prepare to support Prism.
  • Loading branch information
koic authored and bbatsov committed Feb 24, 2024
1 parent 38e4648 commit 6ed1356
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 6 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,13 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu]
ruby: [2.6, 2.7, "3.0", 3.1, 3.2, 3.3, head]
ruby: [2.7, "3.0", 3.1, 3.2, 3.3, head]
coverage: [null]
modern: [null]
title: [null]
include:
- { os: windows, ruby: mingw }
- { ruby: 2.6, os: ubuntu, coverage: true, title: "Coverage" }
- { ruby: 2.7, os: ubuntu, coverage: true, title: "Coverage" }
- { ruby: "3.0", os: ubuntu, modern: true, title: 'Specs "modern"' }
- { ruby: jruby, os: ubuntu }
# jruby disabled because of: https://github.com/jruby/jruby/issues/6416
Expand Down
2 changes: 1 addition & 1 deletion .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ AllCops:
- 'lib/rubocop/ast/node_pattern/lexer.rex.rb'
- 'spec/rubocop/ast/node_pattern/parse_helper.rb'
- 'spec/rubocop/ast/fixtures/*'
TargetRubyVersion: 2.6
TargetRubyVersion: 2.7
SuggestExtensions: false

# It cannot be replaced with suggested methods defined by RuboCop AST itself.
Expand Down
1 change: 1 addition & 0 deletions changelog/change_drop_ruby_26_runtime_support.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* [#279](https://github.com/rubocop/rubocop-ast/pull/279): **(Compatibility)** Drop Ruby 2.6 runtime support. ([@koic][])
4 changes: 2 additions & 2 deletions lib/rubocop/ast/node.rb
Original file line number Diff line number Diff line change
Expand Up @@ -326,13 +326,13 @@ def parent_module_name
# what class or module is this method/constant/etc definition in?
# returns nil if answer cannot be determined
ancestors = each_ancestor(:class, :module, :sclass, :casgn, :block)
result = ancestors.map do |ancestor|
result = ancestors.filter_map do |ancestor|
parent_module_name_part(ancestor) do |full_name|
return nil unless full_name

full_name
end
end.compact.reverse.join('::')
end.reverse.join('::')
result.empty? ? 'Object' : result
end

Expand Down
2 changes: 1 addition & 1 deletion rubocop-ast.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Gem::Specification.new do |s|
s.name = 'rubocop-ast'
s.version = RuboCop::AST::Version::STRING
s.platform = Gem::Platform::RUBY
s.required_ruby_version = '>= 2.6.0'
s.required_ruby_version = '>= 2.7.0'
s.authors = ['Bozhidar Batsov', 'Jonas Arvidsson', 'Yuji Nakayama']
s.description = <<-DESCRIPTION
RuboCop's Node and NodePattern classes.
Expand Down

0 comments on commit 6ed1356

Please sign in to comment.