From 0b476dcd953442510e1b0fdf046d92ef572b9aa7 Mon Sep 17 00:00:00 2001 From: alpaca-tc Date: Wed, 25 Dec 2024 17:01:40 +0900 Subject: [PATCH] Drop support older ruby versions --- .circleci/config.yml | 76 +++++++++--------------------------------- .rubocop.yml | 2 +- CHANGELOG.md | 2 ++ lib/textlint.rb | 4 +-- lib/textlint/parser.rb | 2 +- textlint.gemspec | 2 +- 6 files changed, 22 insertions(+), 66 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 9dbed4d..661bfee 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,22 +1,6 @@ version: 2.1 executors: - ruby_2_5: - docker: - - image: ruby:2.5 - - ruby_2_6: - docker: - - image: ruby:2.6 - - ruby_2_7: - docker: - - image: ruby:2.7 - - ruby_3_0: - docker: - - image: ruby:3.0 - ruby_3_1: docker: - image: ruby:3.1 @@ -29,8 +13,13 @@ executors: docker: - image: ruby:3.3 -commands: +jobs: run_test: + parameters: + executor: + type: string + executor: << parameters.executor >> + resource_class: small steps: - checkout - run: command -v bundle &> /dev/null || gem install bundler @@ -38,52 +27,17 @@ commands: - run: bundle exec rspec - run: bundle exec rubocop -jobs: - ruby_2_5: - executor: ruby_2_5 - steps: - - run: gem install bundler -v 2.3.26 - - run_test - - ruby_2_6: - executor: ruby_2_6 - steps: - - run_test - - ruby_2_7: - executor: ruby_2_7 - steps: - - run_test - - ruby_3_0: - executor: ruby_3_0 - steps: - - run_test - - ruby_3_1: - executor: ruby_3_1 - steps: - - run_test - - ruby_3_2: - executor: ruby_3_2 - steps: - - run_test - - ruby_3_3: - executor: ruby_3_3 - steps: - - run_test - workflows: version: 2 test: jobs: - - ruby_2_5 - - ruby_2_6 - - ruby_2_7 - - ruby_3_0 - - ruby_3_1 - - ruby_3_2 - - ruby_3_3 + - run_test: + name: Ruby 3.1 + executor: ruby_3_1 + - run_test: + name: Ruby 3.2 + executor: ruby_3_2 + - run_test: + name: Ruby 3.3 + executor: ruby_3_3 diff --git a/.rubocop.yml b/.rubocop.yml index 80cf365..5c84f53 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -4,7 +4,7 @@ AllCops: - 'gemfiles/**/*' - 'spec/samples/**/*' - Gemfile - TargetRubyVersion: 2.5 + TargetRubyVersion: 3.1 DisplayCopNames: true NewCops: disable diff --git a/CHANGELOG.md b/CHANGELOG.md index 72006d1..41ad6ba 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,7 @@ ## [Unreleased] +- Drop support older ruby versions #10 + ## [2.0.2] - Support heredoc #4 diff --git a/lib/textlint.rb b/lib/textlint.rb index 489596f..4a31469 100644 --- a/lib/textlint.rb +++ b/lib/textlint.rb @@ -8,8 +8,8 @@ require 'textlint/server' module Textlint - BREAK_RE = /\r?\n/.freeze - LAST_LINE_RE = /(?!\r?\n).*\z/.freeze + BREAK_RE = /\r?\n/ + LAST_LINE_RE = /(?!\r?\n).*\z/ class Error < StandardError; end class SyntaxError < Error; end diff --git a/lib/textlint/parser.rb b/lib/textlint/parser.rb index 8f38e8f..f3a89d8 100644 --- a/lib/textlint/parser.rb +++ b/lib/textlint/parser.rb @@ -5,7 +5,7 @@ module Textlint class Parser class RubyToTextlintAST < ::Ripper::Filter - EVENT_RE = /\Aon_(?\w*)_(?:beg|end)\z/.freeze + EVENT_RE = /\Aon_(?\w*)_(?:beg|end)\z/ TSTRING_BEG_EVENTS = %w[tstring qwords heredoc].freeze # @param src [String] diff --git a/textlint.gemspec b/textlint.gemspec index b40ee53..2bb8372 100644 --- a/textlint.gemspec +++ b/textlint.gemspec @@ -12,7 +12,7 @@ Gem::Specification.new do |spec| spec.description = '' spec.homepage = 'https://github.com/kufu/textlint-ruby' spec.license = 'MIT' - spec.required_ruby_version = '>= 2.5.0' + spec.required_ruby_version = '>= 3.1.0' spec.metadata['homepage_uri'] = spec.homepage spec.metadata['source_code_uri'] = 'https://github.com/kufu/textlint-ruby'