From 0636a420f029fbff08f52aae2799ef0e0e061969 Mon Sep 17 00:00:00 2001 From: Kenichi Kamiya Date: Mon, 17 Jul 2023 04:19:27 +0900 Subject: [PATCH 1/2] Drop to support old rubies 2.7, 3.0 --- .github/workflows/spec.yml | 2 +- .rubocop.yml | 2 +- README.md | 2 +- rspec-matchers-power_assert_matchers.gemspec | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/spec.yml b/.github/workflows/spec.yml index 5f96788..212c1a1 100644 --- a/.github/workflows/spec.yml +++ b/.github/workflows/spec.yml @@ -25,7 +25,7 @@ jobs: fail-fast: false matrix: os: [ubuntu-latest] - ruby: ['head', '3.2', '3.1', '3.0', '2.7'] + ruby: ['head', '3.2', '3.1'] gemfile: ['Gemfile', 'gemfiles/oldest.gemfile'] runs-on: ${{ matrix.os }} env: # $BUNDLE_GEMFILE must be set at the job level, so it is set for all steps diff --git a/.rubocop.yml b/.rubocop.yml index ea40ab0..37bab7f 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -2,7 +2,7 @@ require: - rubocop-rake AllCops: - TargetRubyVersion: 2.7 + TargetRubyVersion: 3.1 DisplayCopNames: true Exclude: - '**/vendor/**/*' diff --git a/README.md b/README.md index 298be81..4538519 100644 --- a/README.md +++ b/README.md @@ -18,7 +18,7 @@ I hope this might be a choice to integrate `PowerAssert` in RSpec. Require following dependencies -- Ruby 2.7 or later +- Ruby 3.1 or higher # Tested only in the head and last 2 rubies - [rspec](https://rubygems.org/gems/rspec/) - [power_assert](https://rubygems.org/gems/power_assert) - [irb](https://rubygems.org/gems/irb) # To colorize diff --git a/rspec-matchers-power_assert_matchers.gemspec b/rspec-matchers-power_assert_matchers.gemspec index 02890bf..90d48e1 100644 --- a/rspec-matchers-power_assert_matchers.gemspec +++ b/rspec-matchers-power_assert_matchers.gemspec @@ -25,7 +25,7 @@ Gem::Specification.new do |gem| gem.add_runtime_dependency('power_assert', '>= 2.0.3', '< 3.0') gem.add_runtime_dependency('irb', '>= 1.4.0', '< 2.0') # To colorize - gem.required_ruby_version = '>= 2.7.2' + gem.required_ruby_version = '>= 3.1' # common From ffd3e77d99b677578ec3d139caf44fa8bc543dd6 Mon Sep 17 00:00:00 2001 From: Kenichi Kamiya Date: Mon, 17 Jul 2023 04:19:59 +0900 Subject: [PATCH 2/2] `bundle exec rubocop --autocorrect` Style/NestedFileDirname: Use dirname(caller_locations(1, 1).first.path, 3) instead. --- lib/rspec/matchers/power_assert_matchers.rb | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/lib/rspec/matchers/power_assert_matchers.rb b/lib/rspec/matchers/power_assert_matchers.rb index 8f4188d..4228323 100644 --- a/lib/rspec/matchers/power_assert_matchers.rb +++ b/lib/rspec/matchers/power_assert_matchers.rb @@ -54,11 +54,5 @@ module PowerAssertMatchers require_relative 'power_assert_matchers/version' module PowerAssert - INTERNAL_LIB_DIRS[RSpec::Matchers::PowerAssertMatchers] = File.dirname( - File.dirname( - File.dirname( - caller_locations(1, 1).first.path - ) - ) - ) + INTERNAL_LIB_DIRS[RSpec::Matchers::PowerAssertMatchers] = File.dirname(caller_locations(1, 1).first.path, 3) end