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 97829e3 commit f571a96
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 17 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 @@ -13,7 +13,7 @@ AllCops:
- 'vendor/**/*'
- 'spec/fixtures/**/*'
- 'tmp/**/*'
TargetRubyVersion: 2.4
TargetRubyVersion: 2.5
SuggestExtensions: false

InternalAffairs/NodeMatcherDirective:
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Expand Up @@ -23,6 +23,7 @@
* [#381](https://github.com/rubocop/rubocop-rails/pull/381): Update `IgnoredMethods` list for `Lint/NumberConversion` to allow Rails' duration methods. ([@dvandersluis][])
* [#444](https://github.com/rubocop/rubocop-rails/issues/444): Mark `Rails/Blank` as unsafe auto-correction. ([@koic][])
* [#451](https://github.com/rubocop/rubocop-rails/issues/451): Make `Rails/RelativeDateConstant` aware of `yesterday` and `tomorrow` methods. ([@koic][])
* [#456](https://github.com/rubocop/rubocop-rails/pull/456): Drop Ruby 2.4 support. ([@koic][])

## 2.9.1 (2020-12-16)

Expand Down
2 changes: 1 addition & 1 deletion lib/rubocop/cop/rails/attribute_default_block_value.rb
Expand Up @@ -75,7 +75,7 @@ class AttributeDefaultBlockValue < Base
def on_send(node)
default_attribute(node) do |attribute|
value = attribute.children.last
return unless TYPE_OFFENDERS.any? { |type| value.type == type }
return unless TYPE_OFFENDERS.any?(value.type)

add_offense(value) do |corrector|
expression = default_attribute(node).children.last
Expand Down
2 changes: 1 addition & 1 deletion rubocop-rails.gemspec
Expand Up @@ -8,7 +8,7 @@ Gem::Specification.new do |s|
s.name = 'rubocop-rails'
s.version = RuboCop::Rails::Version::STRING
s.platform = Gem::Platform::RUBY
s.required_ruby_version = '>= 2.4.0'
s.required_ruby_version = '>= 2.5.0'
s.authors = ['Bozhidar Batsov', 'Jonas Arvidsson', 'Yuji Nakayama']
s.description = <<~DESCRIPTION
Automatic Rails code style checking tool.
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

0 comments on commit f571a96

Please sign in to comment.