Skip to content

Commit ed7da08

Browse files
committed
Relax gemspec to allow Rails 8.0; add Rails main branch to CI
Rails 8 does not have an alpha or beta rubygems release, but it sounds like a release is imminent (to coincide with Rails World in late September). To prepare for Rails 8, this PR relaxes the Rails requirement in the audited gemspec to allow "< 8.1" instead of "< 8.0". This will allow audited to be used with Rails 8.0 when it is released. To test that audited will work with Rails 8, I added a `rails-main` Gemfile to `Appraisals` that targets the Rails main branch, and included this in the CI matrix.
1 parent 9aad4d4 commit ed7da08

File tree

5 files changed

+39
-3
lines changed

5 files changed

+39
-3
lines changed

.github/workflows/ci.yml

+15
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ jobs:
1818
- rails70
1919
- rails71
2020
- rails72
21+
- rails_main
2122
db: [POSTGRES, MYSQL, SQLITE]
2223
exclude:
2324
# MySQL has issues on Ruby 2.3
@@ -98,6 +99,20 @@ jobs:
9899
- appraisal: rails72
99100
ruby: "3.0"
100101

102+
# Rails main supports Ruby 3.1+
103+
- appraisal: rails_main
104+
ruby: "2.3"
105+
- appraisal: rails_main
106+
ruby: "2.4"
107+
- appraisal: rails_main
108+
ruby: "2.5"
109+
- appraisal: rails_main
110+
ruby: "2.6"
111+
- appraisal: rails_main
112+
ruby: "2.7"
113+
- appraisal: rails_main
114+
ruby: "3.0"
115+
101116
services:
102117
postgres:
103118
image: postgres

Appraisals

+7
Original file line numberDiff line numberDiff line change
@@ -44,3 +44,10 @@ appraise "rails72" do
4444
gem "pg", "~> 1.1"
4545
gem "sqlite3", ">= 1.4"
4646
end
47+
48+
appraise "rails_main" do
49+
gem "rails", github: "rails/rails", branch: "main"
50+
gem "mysql2", "~> 0.5"
51+
gem "pg", "~> 1.1"
52+
gem "sqlite3", ">= 2.0"
53+
end

audited.gemspec

+3-3
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,11 @@ Gem::Specification.new do |gem|
1616

1717
gem.required_ruby_version = ">= 2.3.0"
1818

19-
gem.add_dependency "activerecord", ">= 5.2", "< 8.0"
20-
gem.add_dependency "activesupport", ">= 5.2", "< 8.0"
19+
gem.add_dependency "activerecord", ">= 5.2", "< 8.1"
20+
gem.add_dependency "activesupport", ">= 5.2", "< 8.1"
2121

2222
gem.add_development_dependency "appraisal"
23-
gem.add_development_dependency "rails", ">= 5.2", "< 8.0"
23+
gem.add_development_dependency "rails", ">= 5.2", "< 8.1"
2424
gem.add_development_dependency "rspec-rails"
2525
gem.add_development_dependency "standard"
2626
gem.add_development_dependency "single_cov"

gemfiles/rails_main.gemfile

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# This file was generated by Appraisal
2+
3+
source "https://rubygems.org"
4+
5+
gem "rails", github: "rails/rails", branch: "main"
6+
gem "mysql2", "~> 0.5"
7+
gem "pg", "~> 1.1"
8+
gem "sqlite3", ">= 2.0"
9+
10+
gemspec name: "audited", path: "../"

spec/rails_app/config/application.rb

+4
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,10 @@ class Application < Rails::Application
3333
if Rails.gem_version >= Gem::Version.new("7.1")
3434
config.active_support.cache_format_version = 7.1
3535
end
36+
37+
if Rails.gem_version >= Gem::Version.new("8.0.0.alpha")
38+
config.active_support.to_time_preserves_timezone = :zone
39+
end
3640
end
3741
end
3842

0 commit comments

Comments
 (0)