Skip to content

Commit

Permalink
Drop Ruby 2.4 support
Browse files Browse the repository at this point in the history
  • Loading branch information
koic committed Apr 6, 2021
1 parent aaba1f7 commit 144f282
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 18 deletions.
3 changes: 0 additions & 3 deletions .circleci/config.yml
Expand Up @@ -38,9 +38,6 @@ workflows:
build:
jobs:
- documentation-checks
- rake_default:
name: Ruby 2.4
image: circleci/ruby:2.4
- rake_default:
name: Ruby 2.5
image: circleci/ruby:2.5
Expand Down
2 changes: 1 addition & 1 deletion .rubocop.yml
Expand Up @@ -9,7 +9,7 @@ require:

AllCops:
NewCops: enable
TargetRubyVersion: 2.4
TargetRubyVersion: 2.5
SuggestExtensions: false

InternalAffairs/NodeMatcherDirective:
Expand Down
4 changes: 4 additions & 0 deletions CHANGELOG.md
Expand Up @@ -2,6 +2,10 @@

## master (unreleased)

### Changes

* [#129](https://github.com/rubocop/rubocop-minitest/pull/129): Drop Ruby 2.4 support. ([@koic][])

## 0.11.1 (2021-03-31)

### Changes
Expand Down
2 changes: 1 addition & 1 deletion rubocop-minitest.gemspec
Expand Up @@ -16,7 +16,7 @@ Gem::Specification.new do |spec|
DESCRIPTION
spec.license = 'MIT'

spec.required_ruby_version = '>= 2.4.0'
spec.required_ruby_version = '>= 2.5.0'
spec.metadata = {
'homepage_uri' => 'https://docs.rubocop.org/rubocop-minitest/',
'changelog_uri' => 'https://github.com/rubocop/rubocop-minitest/blob/master/CHANGELOG.md',
Expand Down
20 changes: 9 additions & 11 deletions tasks/cops_documentation.rake
Expand Up @@ -46,17 +46,15 @@ task documentation_syntax_check: :yard_for_generate_documentation do
end

examples.to_a.each do |example|
begin
buffer = Parser::Source::Buffer.new('<code>', 1)
buffer.source = example.text
parser = Parser::Ruby25.new(RuboCop::AST::Builder.new)
parser.diagnostics.all_errors_are_fatal = true
parser.parse(buffer)
rescue Parser::SyntaxError => e
path = example.object.file
puts "#{path}: Syntax Error in an example. #{e}"
ok = false
end
buffer = Parser::Source::Buffer.new('<code>', 1)
buffer.source = example.text
parser = Parser::Ruby25.new(RuboCop::AST::Builder.new)
parser.diagnostics.all_errors_are_fatal = true
parser.parse(buffer)
rescue Parser::SyntaxError => e
path = example.object.file
puts "#{path}: Syntax Error in an example. #{e}"
ok = false
end
end
abort unless ok
Expand Down
4 changes: 2 additions & 2 deletions test/assertion_helper.rb
Expand Up @@ -8,7 +8,7 @@ module AssertionHelper
private

def setup
cop_name = self.class.to_s.sub(/Test\z/, '')
cop_name = self.class.to_s.delete_suffix('Test')

@cop = RuboCop::Cop::Minitest.const_get(cop_name).new
end
Expand Down Expand Up @@ -88,6 +88,6 @@ def parse_source!(source, file = nil)
end

def ruby_version
2.4
2.5
end
end

0 comments on commit 144f282

Please sign in to comment.