-
-
Notifications
You must be signed in to change notification settings - Fork 1k
/
Gemfile-rails-dependencies
64 lines (56 loc) · 2.18 KB
/
Gemfile-rails-dependencies
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
version_file = File.expand_path("../.rails-version", __FILE__)
# This is required for Ruby 3.1, because in Ruby 3.1 these gems were moved to
# bundled gems from default gems. This issue was fixed in Rails Rails 7.0.1.
# Discussion can be found here - https://github.com/mikel/mail/pull/1439
def add_net_gems_dependency
if RUBY_VERSION >= '3.1'
gem 'net-smtp', require: false
gem 'net-imap', require: false
gem 'net-pop', require: false
end
end
def add_sqlite3_gem_dependency(rails_version)
# sqlite3 is an optional, unspecified, dependency and Rails 8.0 only supports `~> 2.0`
if RUBY_VERSION.to_f < 3
# sqlite3 1.7.x doesn't work on all platforms for Ruby 2.x
gem 'sqlite3', '~> 1.4', '< 1.7', platforms: [:ruby]
elsif rails_version.to_f >= 8
gem 'sqlite3', '~> 2.0', platforms: [:ruby]
else
gem 'sqlite3', '~> 1.7', platforms: [:ruby]
end
end
gem 'puma'
case version = ENV['RAILS_VERSION'] || (File.exist?(version_file) && File.read(version_file).chomp) || ''
when /main/
gem "rails", :git => "https://github.com/rails/rails.git"
gem 'activerecord-jdbcsqlite3-adapter', git: 'https://github.com/jruby/activerecord-jdbc-adapter', platforms: [:jruby]
gem 'selenium-webdriver', require: false
gem 'sqlite3', '~> 2.0', platforms: [:ruby]
when nil, false, ""
if RUBY_VERSION.to_f > 3.1
gem "rails", "~> 8.0.0"
gem 'sqlite3', '~> 2.0', platforms: [:ruby]
elsif RUBY_VERSION.to_f > 3.0
gem "rails", "~> 7.2.0"
gem 'sqlite3', '~> 1.7', platforms: [:ruby]
else
gem "rails", "~> 7.1.0"
gem 'sqlite3', '~> 1.7', platforms: [:ruby]
end
gem 'activerecord-jdbcsqlite3-adapter', platforms: [:jruby]
gem 'selenium-webdriver', require: false
else
version_number = version.split(' ').last
add_net_gems_dependency if version_number < '7.0'
gem "rails", version
gem 'activerecord-jdbcsqlite3-adapter', platforms: [:jruby]
# This version number reflects our build version not our actual version,
# this will be fixed in 7.1.4 and should be removed then.
if version_number == '7.1.0'
gem 'selenium-webdriver', '< 4.20.0', require: false
else
gem 'selenium-webdriver', require: false
end
add_sqlite3_gem_dependency(version_number)
end