Skip to content

Commit

Permalink
feat: Add Rails 7.1 - 8 support (#141)
Browse files Browse the repository at this point in the history
* bundle update --bundler

* drop rails 6.1 support

* drop pre ruby 3.2 support

- remove it from the ci matrix
- bump required_ruby_version in the gemspec
- remove call to `ruby` in Gemfile, regen appraisals
- bump TargetRubyVersion in rubocop.yml
  - and rubocop -a, since all of these are HashSyntax changes

* swap rubocop deps for betterlint

* add Rails 7.1 appraisal

- We also rm secrets.yml from the dummy app to deal with a deprecation
warning
- And updated the dummy application.rb to `config.load_defaults` for
Rails 7 and 7.1 (whilst dropping previous versions)

* add Rails 7.2 appraisal

and update `her` code to address a deprecation warning;

https://github.com/rails/rails/blob/v7.2.2.1/activesupport/lib/active_support/proxy_object.rb

* add Rails 8 appraisal

and update the dummy app config, as well as the ci matrix

* have the Rails version range be closed

* bundle update

* bump version.rb

* don't pin concurrent-ruby for 7.1

* re-intro support for ruby 3.1

* exclude ruby 3.1 + Rails 8 combo

Rails 8 requires 3.2

* add missed constraints on railties

* constrain zeitwerk

`railties`'s constraint on zeitwerk is '~> 2.6' (or 2.5 for older
Rails), which means that bundle updating can put us on 2.7, which
requires Ruby 3.2. This will break CI tests for Ruby 3.1.

When we drop support for 3.1, we can unpin this dep (i.e. not even list
it at all, as before).

* make zeitwerk a dev dependency

* use Rails::VERSION::STRING.to_f as arg to config.load_defaults

instead of `rails_version_between`
  • Loading branch information
argvniyx-enroute authored Jan 24, 2025
1 parent c7d2a00 commit 109bcb0
Show file tree
Hide file tree
Showing 45 changed files with 1,335 additions and 564 deletions.
9 changes: 7 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,15 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
ruby: [3.0, 3.1, 3.2]
ruby: ["3.1", "3.2"]
gemfile:
- gemfiles/rails_6_1.gemfile
- gemfiles/rails_7_0.gemfile
- gemfiles/rails_7_1.gemfile
- gemfiles/rails_7_2.gemfile
- gemfiles/rails_8_0.gemfile
exclude:
- ruby: "3.1"
gemfile: gemfiles/rails_8_0.gemfile
name: Ruby ${{ matrix.ruby }}, ${{ matrix.gemfile }}
steps:
- uses: technote-space/auto-cancel-redundant-job@v1
Expand Down
3 changes: 2 additions & 1 deletion .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,10 @@ AllCops:
- 'vendor/**/*'
- 'spec/dummy/**/*'
- 'Gemfile'
- 'gemfiles/*.gemfile'
DisplayStyleGuide: true
DisplayCopNames: true
TargetRubyVersion: 3.0
TargetRubyVersion: 3.1

Layout/ParameterAlignment:
Enabled: false
Expand Down
17 changes: 13 additions & 4 deletions Appraisals
Original file line number Diff line number Diff line change
@@ -1,7 +1,16 @@
appraise 'rails-6-1' do
gem 'railties', '~> 6.1.0'
end

appraise 'rails-7-0' do
gem 'concurrent-ruby', '1.3.4'
gem 'railties', '~> 7.0.0'
end

appraise 'rails-7-1' do
gem 'railties', '~> 7.1.0'
end

appraise 'rails-7-2' do
gem 'railties', '~> 7.2.0'
end

appraise 'rails-8-0' do
gem 'railties', '~> 8.0.0'
end
1 change: 0 additions & 1 deletion Gemfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
source "https://rubygems.org"
ruby '>= 2.7.0'

# Required for, e.g., show.json.jbuilder to work
# see: https://github.com/rails/jbuilder/issues/346
Expand Down
Loading

0 comments on commit 109bcb0

Please sign in to comment.