From 2cffb5c763d85dbbaabf0350b44e661d50d034b6 Mon Sep 17 00:00:00 2001 From: Ross Brandes Date: Fri, 15 Nov 2024 16:59:37 -0600 Subject: [PATCH 1/7] Bump actions/checkout version --- .github/workflows/ruby.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ruby.yml b/.github/workflows/ruby.yml index bc25b08..22128c9 100644 --- a/.github/workflows/ruby.yml +++ b/.github/workflows/ruby.yml @@ -22,7 +22,7 @@ jobs: ruby-version: ['2.7', '3.1'] steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Set up Ruby uses: ruby/setup-ruby@v1 with: From c2de75d4d542852fa00d32a3638fef2f72f1ff2e Mon Sep 17 00:00:00 2001 From: Ross Brandes Date: Fri, 15 Nov 2024 17:12:29 -0600 Subject: [PATCH 2/7] bundle install in example in CI --- .github/workflows/ruby.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/ruby.yml b/.github/workflows/ruby.yml index 22128c9..f67485c 100644 --- a/.github/workflows/ruby.yml +++ b/.github/workflows/ruby.yml @@ -28,5 +28,8 @@ jobs: with: ruby-version: ${{ matrix.ruby-version }} bundler-cache: true # runs 'bundle install' and caches installed gems automatically + - name: Bundle example + working-directory: example + run: bundle install - name: Run tests run: bundle exec rake From 2b0da319dcd73ba20d3a4c8654a3b03627781ecd Mon Sep 17 00:00:00 2001 From: Ross Brandes Date: Fri, 15 Nov 2024 17:59:45 -0600 Subject: [PATCH 3/7] Tighten up the example Gemfile So it should work on older Ruby versions. --- example/Gemfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/example/Gemfile b/example/Gemfile index d407444..4cc3371 100644 --- a/example/Gemfile +++ b/example/Gemfile @@ -4,8 +4,8 @@ gem "rails", "~> 6.1" gem "good_migrations", path: ".." -gem "sqlite3" +gem "sqlite3", "~> 1.7.3" -gem "zeitwerk", github: "fxn/zeitwerk" +gem "zeitwerk", "~> 2.6" gem "bootsnap", require: false From 27f77d955e1380aaf9062be3cff040e003315fdf Mon Sep 17 00:00:00 2001 From: Ross Brandes Date: Fri, 15 Nov 2024 18:00:18 -0600 Subject: [PATCH 4/7] Add script/test --- .github/workflows/ruby.yml | 5 +---- script/test | 13 +++++++++++++ 2 files changed, 14 insertions(+), 4 deletions(-) create mode 100755 script/test diff --git a/.github/workflows/ruby.yml b/.github/workflows/ruby.yml index f67485c..c591f4b 100644 --- a/.github/workflows/ruby.yml +++ b/.github/workflows/ruby.yml @@ -28,8 +28,5 @@ jobs: with: ruby-version: ${{ matrix.ruby-version }} bundler-cache: true # runs 'bundle install' and caches installed gems automatically - - name: Bundle example - working-directory: example - run: bundle install - name: Run tests - run: bundle exec rake + run: script/test diff --git a/script/test b/script/test new file mode 100755 index 0000000..fd801fc --- /dev/null +++ b/script/test @@ -0,0 +1,13 @@ +#!/usr/bin/env bash + +set -euo pipefail + +echo "---> Installing dependencies in example app" +cd example +bundle +cd .. + +echo "---> Running tests" +bundle exec rake + +echo "---> Job's done!" From e00281dfc0bd600d6c9fdf916ad19e7d318facd1 Mon Sep 17 00:00:00 2001 From: Ross Brandes Date: Fri, 15 Nov 2024 18:00:26 -0600 Subject: [PATCH 5/7] Drop Ruby 2.7 support, add 3.2 and 3.3 --- .github/workflows/ruby.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ruby.yml b/.github/workflows/ruby.yml index c591f4b..2e6af02 100644 --- a/.github/workflows/ruby.yml +++ b/.github/workflows/ruby.yml @@ -19,7 +19,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - ruby-version: ['2.7', '3.1'] + ruby-version: ['3.1', '3.2', '3.3'] steps: - uses: actions/checkout@v4 From 78f4ce775cb47ca95e0ea70e2708a4b2f7b61352 Mon Sep 17 00:00:00 2001 From: Ross Brandes Date: Fri, 15 Nov 2024 18:07:58 -0600 Subject: [PATCH 6/7] Upgrade standard To get Ruby 3.3 compatibility. --- Gemfile.lock | 53 ++++++++++++++++++++++++++++++++-------------------- 1 file changed, 33 insertions(+), 20 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index b67beb4..8aa0f96 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -39,6 +39,9 @@ GEM erubi (1.10.0) i18n (1.10.0) concurrent-ruby (~> 1.0) + json (2.8.2) + language_server-protocol (3.17.0.3) + lint_roller (1.1.0) loofah (2.16.0) crass (~> 1.0.2) nokogiri (>= 1.5.9) @@ -48,9 +51,10 @@ GEM nokogiri (1.13.4) mini_portile2 (~> 2.8.0) racc (~> 1.4) - parallel (1.22.1) - parser (3.1.2.0) + parallel (1.26.3) + parser (3.3.6.0) ast (~> 2.4.1) + racc pry (0.14.1) coderay (~> 1.1) method_source (~> 1.0) @@ -72,30 +76,39 @@ GEM zeitwerk (~> 2.5) rainbow (3.1.1) rake (13.0.6) - regexp_parser (2.3.0) - rexml (3.2.5) - rubocop (1.27.0) + regexp_parser (2.9.2) + rubocop (1.68.0) + json (~> 2.3) + language_server-protocol (>= 3.17.0) parallel (~> 1.10) - parser (>= 3.1.0.0) + parser (>= 3.3.0.2) rainbow (>= 2.2.2, < 4.0) - regexp_parser (>= 1.8, < 3.0) - rexml - rubocop-ast (>= 1.16.0, < 2.0) + regexp_parser (>= 2.4, < 3.0) + rubocop-ast (>= 1.32.2, < 2.0) ruby-progressbar (~> 1.7) - unicode-display_width (>= 1.4.0, < 3.0) - rubocop-ast (1.17.0) - parser (>= 3.1.1.0) - rubocop-performance (1.13.3) - rubocop (>= 1.7.0, < 2.0) - rubocop-ast (>= 0.4.0) - ruby-progressbar (1.11.0) - standard (1.10.0) - rubocop (= 1.27.0) - rubocop-performance (= 1.13.3) + unicode-display_width (>= 2.4.0, < 3.0) + rubocop-ast (1.36.1) + parser (>= 3.3.1.0) + rubocop-performance (1.22.1) + rubocop (>= 1.48.1, < 2.0) + rubocop-ast (>= 1.31.1, < 2.0) + ruby-progressbar (1.13.0) + standard (1.42.0) + language_server-protocol (~> 3.17.0.2) + lint_roller (~> 1.0) + rubocop (~> 1.68.0) + standard-custom (~> 1.0.0) + standard-performance (~> 1.5) + standard-custom (1.0.2) + lint_roller (~> 1.0) + rubocop (~> 1.50) + standard-performance (1.5.0) + lint_roller (~> 1.1) + rubocop-performance (~> 1.22.0) thor (1.2.1) tzinfo (2.0.4) concurrent-ruby (~> 1.0) - unicode-display_width (2.1.0) + unicode-display_width (2.6.0) zeitwerk (2.5.4) PLATFORMS From 3dbf75619e65ed5485add89a1a45cc0a45fa3b2f Mon Sep 17 00:00:00 2001 From: Ross Brandes Date: Fri, 15 Nov 2024 18:21:42 -0600 Subject: [PATCH 7/7] Explicitly increase minimum supported Ruby version --- CHANGELOG.md | 3 +++ good_migrations.gemspec | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4b80d4f..23c40f2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,8 @@ # CHANGELOG +## Unreleased +* Minimum supported Ruby version is now 3.1 + ## 0.2.1 * Fix Windows paths [#31](https://github.com/testdouble/good-migrations/pull/31) diff --git a/good_migrations.gemspec b/good_migrations.gemspec index 66e5abe..ed60baa 100644 --- a/good_migrations.gemspec +++ b/good_migrations.gemspec @@ -12,7 +12,7 @@ Gem::Specification.new do |spec| spec.description = "Referencing code in app/ from a database migration risks breaking the migration when your app code changes; this gem prevents that mistake" spec.homepage = "https://github.com/testdouble/good-migrations" spec.license = "MIT" - spec.required_ruby_version = ">= 2.3.0" + spec.required_ruby_version = ">= 3.1.0" spec.metadata["rubygems_mfa_required"] = "true" spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }