@@ -11,13 +11,15 @@ def add_net_gems_dependency
1111 end
1212end
1313
14- def add_sqlite3_gem_dependency
15- # sqlite3 is an optional, unspecified, dependency and Rails 6 .0 only supports `~> 1.4 `
14+ def add_sqlite3_gem_dependency(rails_version)
15+ # sqlite3 is an optional, unspecified, dependency and Rails 8 .0 only supports `~> 2.0 `
1616 if RUBY_VERSION.to_f < 3
1717 # sqlite3 1.7.x doesn't work on all platforms for Ruby 2.x
1818 gem 'sqlite3', '~> 1.4', '< 1.7', platforms: [:ruby]
19- else
19+ elsif rails_version.to_f >= 8
2020 gem 'sqlite3', '~> 2.0', platforms: [:ruby]
21+ else
22+ gem 'sqlite3', '~> 1.7', platforms: [:ruby]
2123 end
2224end
2325
@@ -29,21 +31,12 @@ when /main/
2931 gem 'activerecord-jdbcsqlite3-adapter', git: 'https://github.com/jruby/activerecord-jdbc-adapter', platforms: [:jruby]
3032 gem 'selenium-webdriver', require: false
3133
32- # Rails 8 requires 2.0.0
3334 gem 'sqlite3', '~> 2.0', platforms: [:ruby]
34- when /stable$/
35- gem_list = %w[rails railties actionmailer actionpack activerecord activesupport activejob actionview]
36- gem 'activerecord-jdbcsqlite3-adapter', git: 'https://github.com/jruby/activerecord-jdbc-adapter', platforms: [:jruby]
37-
38- gem_list.each do |rails_gem|
39- gem rails_gem, :git => "https://github.com/rails/rails.git", :branch => version
40- end
41- add_sqlite3_gem_dependency
4235when nil, false, ""
43- gem "rails", "~> 7 .0.0"
36+ gem "rails", "~> 8 .0.0"
4437 gem 'activerecord-jdbcsqlite3-adapter', platforms: [:jruby]
4538 gem 'selenium-webdriver', require: false
46- add_sqlite3_gem_dependency
39+ gem 'sqlite3', '~> 2.0', platforms: [:ruby]
4740else
4841 version_number = version.split(' ').last
4942 add_net_gems_dependency if version_number < '7.0'
5851 else
5952 gem 'selenium-webdriver', require: false
6053 end
61- add_sqlite3_gem_dependency
54+ add_sqlite3_gem_dependency(version_number)
6255end
0 commit comments