Skip to content

Commit

Permalink
Support for Rails 8.0 (#188)
Browse files Browse the repository at this point in the history
* CI: add activerecord v8.0, which requires Ruby 3.2 at minimum

* Gemfile: allow activerecord < 8.1, which supports sqlite3 2.1 at minimum

* gemspec: activerecord/railties < 8.1

* Specify the appropriate sqlite3 version in the dev group

* Gemfile: simplify sqlite3 version selection
  • Loading branch information
chtzvt authored Jan 15, 2025
1 parent 15040bb commit 5496ce0
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 7 deletions.
8 changes: 8 additions & 0 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,25 @@ jobs:
- '2.7'
- '3.0'
- '3.1'
- '3.2'
activerecord:
- '6.0'
- '6.1'
- '7.0'
- '7.1'
- '7.2'
- '8.0'
exclude:
- activerecord: '7.2'
ruby: '2.7'
- activerecord: '7.2'
ruby: '3.0'
- activerecord: '8.0'
ruby: '2.7'
- activerecord: '8.0'
ruby: '3.0'
- activerecord: '8.0'
ruby: '3.1'

name: Ruby ${{ matrix.ruby }} / ActiveRecord ${{ matrix.activerecord }}
env:
Expand Down
18 changes: 15 additions & 3 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,12 +1,24 @@
source 'https://rubygems.org'

gem 'rake', '>= 10.0'
gem 'activerecord', ENV['AR'] ? ENV['AR'].split(",") : [">= 6.0.0", "< 8.0"]
gem 'railties', ENV['AR'] ? ENV['AR'].split(",") : [">= 6.0.0", "< 8.0"]
gem 'activerecord', ENV['AR'] ? ENV['AR'].split(",") : [">= 6.0.0", "< 8.1"]
gem 'railties', ENV['AR'] ? ENV['AR'].split(",") : [">= 6.0.0", "< 8.1"]
gem 'nokogiri', "~> 1.14"

def sqlite3_version
return "< 1.7" unless ENV["AR"]

ar_version = ENV['AR'].split(",").last.match(/\d+\.\d+/)[0]

case Gem::Version.new(ar_version)
# Active Record 8.x requires sqlite3 >= 2.1
when Gem::Version.new("8.0").. then ">= 2.1"
else "< 1.7"
end
end

group :dev do
gem 'sqlite3', '< 1.7'
gem 'sqlite3', sqlite3_version
gem 'rspec', '>= 2.99.0'
gem 'jeweler'
end
1 change: 1 addition & 0 deletions README.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -284,3 +284,4 @@ Contributors
- [Sarah Ridge](https://github.com/smridge)
- [John Bachir](https://jjb.cc)
- [Pysis](https://github.com/Pysis868)
- [Charlton Trezevant](https://github.com/chtzvt)
8 changes: 4 additions & 4 deletions standalone_migrations.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -66,13 +66,13 @@ Gem::Specification.new do |s|

if s.respond_to? :add_runtime_dependency then
s.add_runtime_dependency(%q<rake>.freeze, [">= 10.0"])
s.add_runtime_dependency(%q<activerecord>.freeze, [">= 6.0.0", "< 8.0"])
s.add_runtime_dependency(%q<railties>.freeze, [">= 6.0.0", "< 8.0"])
s.add_runtime_dependency(%q<activerecord>.freeze, [">= 6.0.0", "< 8.1"])
s.add_runtime_dependency(%q<railties>.freeze, [">= 6.0.0", "< 8.1"])
s.add_runtime_dependency(%q<nokogiri>.freeze, ["~> 1.14"])
else
s.add_dependency(%q<rake>.freeze, [">= 10.0"])
s.add_dependency(%q<activerecord>.freeze, [">= 6.0.0", "< 8.0"])
s.add_dependency(%q<railties>.freeze, [">= 6.0.0", "< 8.0"])
s.add_dependency(%q<activerecord>.freeze, [">= 6.0.0", "< 8.1"])
s.add_dependency(%q<railties>.freeze, [">= 6.0.0", "< 8.1"])
s.add_dependency(%q<nokogiri>.freeze, ["~> 1.14"])
end
end
Expand Down

0 comments on commit 5496ce0

Please sign in to comment.