From 308c4e28bfbae05100f662f71748dfeb8cc881f6 Mon Sep 17 00:00:00 2001 From: Ian Yamey Date: Mon, 8 Jun 2026 17:39:21 -0400 Subject: [PATCH] Support Rails 8 / activesupport 8 and stop committing Gemfile.lock Relax the gemspec so the gem resolves in apps on Rails 8 (e.g. retirable/app, which runs activesupport 8.1): - activesupport: `~> 7` -> `>= 7.0, < 9` - dev dotenv: `~> 2` -> `~> 3` Stop tracking Gemfile.lock. A library gem's dependency contract is the gemspec; the consuming app resolves against its own lockfile. Committing the lock meant CI only ever tested one frozen resolution, which is how the stale activesupport `~> 7` pin went unnoticed. CI now resolves fresh each run. CI: - add Ruby 4.0 to the matrix; set fail-fast: false - pin actions/checkout (v6.0.3) and ruby/setup-ruby (v1.312.0) to commit SHAs instead of moving tags Also bump version to 1.1.0 and rename the deprecated rubocop `IgnoredPatterns` config key to `AllowedPatterns`. Co-Authored-By: Claude Opus 4.8 --- .github/workflows/ci.yml | 7 +-- .gitignore | 4 ++ .rubocop.yml | 2 +- Gemfile.lock | 95 ---------------------------------------- lib/unit-ruby/version.rb | 2 +- spec/version_spec.rb | 2 +- unit-ruby.gemspec | 4 +- 7 files changed, 13 insertions(+), 103 deletions(-) delete mode 100644 Gemfile.lock diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index abb7313..09a4f27 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -23,13 +23,14 @@ jobs: test: runs-on: ubuntu-latest strategy: + fail-fast: false matrix: - ruby-version: ["3.3", "3.4"] + ruby-version: ["3.4", "4.0"] steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 - name: Set up Ruby - uses: ruby/setup-ruby@v1 + uses: ruby/setup-ruby@12fd324f1d0b43274fdc8130f6980590a667c455 # v1.312.0 with: ruby-version: ${{ matrix.ruby-version }} bundler-cache: true # runs 'bundle install' and caches installed gems automatically diff --git a/.gitignore b/.gitignore index eaccd6a..c739b55 100644 --- a/.gitignore +++ b/.gitignore @@ -11,3 +11,7 @@ # rspec failure tracking .rspec_status .env + +# Library gem: dependencies are resolved by the consuming app against the +# gemspec, so the lockfile is not committed. CI resolves fresh on each run. +Gemfile.lock diff --git a/.rubocop.yml b/.rubocop.yml index 66ff42a..aa28d64 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -9,7 +9,7 @@ Style/MutableConstant: Layout/LineLength: Max: 100 - IgnoredPatterns: ['(\A|\s)#'] + AllowedPatterns: ['(\A|\s)#'] Style/Documentation: Enabled: false \ No newline at end of file diff --git a/Gemfile.lock b/Gemfile.lock deleted file mode 100644 index 8bb7ed7..0000000 --- a/Gemfile.lock +++ /dev/null @@ -1,95 +0,0 @@ -PATH - remote: . - specs: - unit-ruby (1.0.1) - activesupport (~> 7) - faraday (~> 2) - faraday-retry (~> 2) - -GEM - remote: https://rubygems.org/ - specs: - activesupport (7.0.8.7) - concurrent-ruby (~> 1.0, >= 1.0.2) - i18n (>= 1.6, < 2) - minitest (>= 5.1) - tzinfo (~> 2.0) - ast (2.4.2) - coderay (1.1.3) - concurrent-ruby (1.3.4) - diff-lcs (1.5.1) - dotenv (2.7.6) - faraday (2.12.2) - faraday-net_http (>= 2.0, < 3.5) - json - logger - faraday-net_http (3.4.0) - net-http (>= 0.5.0) - faraday-retry (2.2.1) - faraday (~> 2.0) - i18n (1.14.6) - concurrent-ruby (~> 1.0) - json (2.9.1) - logger (1.6.4) - method_source (1.1.0) - minitest (5.25.4) - net-http (0.6.0) - uri - parallel (1.26.3) - parser (3.3.6.0) - ast (~> 2.4.1) - racc - pry (0.15.2) - coderay (~> 1.1) - method_source (~> 1.0) - racc (1.8.1) - rainbow (3.1.1) - rake (13.2.1) - regexp_parser (2.10.0) - rexml (3.4.2) - rspec (3.13.0) - rspec-core (~> 3.13.0) - rspec-expectations (~> 3.13.0) - rspec-mocks (~> 3.13.0) - rspec-core (3.13.2) - rspec-support (~> 3.13.0) - rspec-expectations (3.13.3) - diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.13.0) - rspec-file_fixtures (0.1.9) - rspec (~> 3.12) - rspec-mocks (3.13.2) - diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.13.0) - rspec-support (3.13.2) - rubocop (1.24.1) - parallel (~> 1.10) - parser (>= 3.0.0.0) - rainbow (>= 2.2.2, < 4.0) - regexp_parser (>= 1.8, < 3.0) - rexml - rubocop-ast (>= 1.15.1, < 2.0) - ruby-progressbar (~> 1.7) - unicode-display_width (>= 1.4.0, < 3.0) - rubocop-ast (1.37.0) - parser (>= 3.3.1.0) - ruby-progressbar (1.13.0) - tzinfo (2.0.6) - concurrent-ruby (~> 1.0) - unicode-display_width (2.6.0) - uri (1.0.4) - -PLATFORMS - ruby - -DEPENDENCIES - dotenv (~> 2) - pry (~> 0.15) - rake (~> 13) - rspec (~> 3) - rspec-file_fixtures (~> 0.1.9) - rubocop (~> 1) - unit-ruby! - -BUNDLED WITH - 2.4.19 diff --git a/lib/unit-ruby/version.rb b/lib/unit-ruby/version.rb index 363ff31..f831f26 100644 --- a/lib/unit-ruby/version.rb +++ b/lib/unit-ruby/version.rb @@ -1,3 +1,3 @@ module Unit - VERSION = '1.0.1' + VERSION = '1.1.0' end diff --git a/spec/version_spec.rb b/spec/version_spec.rb index b51ac5f..7f4e29c 100644 --- a/spec/version_spec.rb +++ b/spec/version_spec.rb @@ -2,7 +2,7 @@ RSpec.describe Unit do it 'returns the correct version' do - expect(Unit::VERSION).to eq '1.0.1' + expect(Unit::VERSION).to eq '1.1.0' end end diff --git a/unit-ruby.gemspec b/unit-ruby.gemspec index 20bc68e..b10363a 100644 --- a/unit-ruby.gemspec +++ b/unit-ruby.gemspec @@ -29,11 +29,11 @@ Gem::Specification.new do |spec| spec.required_ruby_version = '>= 3.3' - spec.add_dependency 'activesupport', '~> 7' + spec.add_dependency 'activesupport', '>= 7.0', '< 9' spec.add_dependency 'faraday', '~> 2' spec.add_dependency 'faraday-retry', '~> 2' - spec.add_development_dependency 'dotenv', '~> 2' + spec.add_development_dependency 'dotenv', '~> 3' spec.add_development_dependency 'pry', '~> 0.15' spec.add_development_dependency 'rake', '~> 13' spec.add_development_dependency 'rspec', '~> 3'