@@ -11,13 +11,15 @@ def add_net_gems_dependency
11
11
end
12
12
end
13
13
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 `
16
16
if RUBY_VERSION.to_f < 3
17
17
# sqlite3 1.7.x doesn't work on all platforms for Ruby 2.x
18
18
gem 'sqlite3', '~> 1.4', '< 1.7', platforms: [:ruby]
19
- else
19
+ elsif rails_version.to_f >= 8
20
20
gem 'sqlite3', '~> 2.0', platforms: [:ruby]
21
+ else
22
+ gem 'sqlite3', '~> 1.7', platforms: [:ruby]
21
23
end
22
24
end
23
25
@@ -29,21 +31,12 @@ when /main/
29
31
gem 'activerecord-jdbcsqlite3-adapter', git: 'https://github.com/jruby/activerecord-jdbc-adapter', platforms: [:jruby]
30
32
gem 'selenium-webdriver', require: false
31
33
32
- # Rails 8 requires 2.0.0
33
34
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
42
35
when nil, false, ""
43
- gem "rails", "~> 7 .0.0"
36
+ gem "rails", "~> 8 .0.0"
44
37
gem 'activerecord-jdbcsqlite3-adapter', platforms: [:jruby]
45
38
gem 'selenium-webdriver', require: false
46
- add_sqlite3_gem_dependency
39
+ gem 'sqlite3', '~> 2.0', platforms: [:ruby]
47
40
else
48
41
version_number = version.split(' ').last
49
42
add_net_gems_dependency if version_number < '7.0'
58
51
else
59
52
gem 'selenium-webdriver', require: false
60
53
end
61
- add_sqlite3_gem_dependency
54
+ add_sqlite3_gem_dependency(version_number)
62
55
end
0 commit comments