1
1
version_file = File.expand_path("../.rails-version", __FILE__)
2
2
3
+ # This is required for Ruby 3.1, because in Ruby 3.1 these gems were moved to
4
+ # bundled gems from default gems. This issue was fixed in Rails Rails 7.0.1.
5
+ # Discussion can be found here - https://github.com/mikel/mail/pull/1439
6
+ def add_net_gems_dependency
7
+ if RUBY_VERSION >= '3.1'
8
+ gem 'net-smtp', require: false
9
+ gem 'net-imap', require: false
10
+ gem 'net-pop', require: false
11
+ end
12
+ end
13
+
3
14
case version = ENV['RAILS_VERSION'] || (File.exist?(version_file) && File.read(version_file).chomp) || ''
4
15
when /main/
5
16
gem "rails", :git => "https://github.com/rails/rails.git"
@@ -15,25 +26,16 @@ when /stable$/
15
26
gem rails_gem, :git => "https://github.com/rails/rails.git", :branch => version
16
27
end
17
28
when nil, false, ""
29
+ add_net_gems_dependency # TODO: remove when we use switch to "~> 7.0.0" that declares dependency on those gems on itself
18
30
gem "rails", "~> 6.0.0"
19
31
gem "puma"
20
32
gem 'activerecord-jdbcsqlite3-adapter', platforms: [:jruby]
21
33
gem 'selenium-webdriver', require: false
22
34
else
35
+ add_net_gems_dependency if version.split(' ').last < '7.0'
23
36
gem "rails", version
24
37
gem "sprockets", '~> 3.0' if RUBY_VERSION < '2.5'
25
38
gem "puma"
26
39
gem 'activerecord-jdbcsqlite3-adapter', platforms: [:jruby]
27
40
gem 'selenium-webdriver', require: false
28
41
end
29
-
30
- # This is required for Ruby 3.1 and Rails 6.1.x as of time
31
- # of writing, because in Ruby 3.1 these gems are no longer
32
- # automatically included. This issue was fixed on the Rails
33
- # side in Rails 7.0.1, but is not yet fixed in the Rails 6.1.x
34
- # branch. Discussion can be found here - https://github.com/mikel/mail/pull/1439
35
- if RUBY_VERSION >= '3.1' && version.split(' ').last < '7.0'
36
- gem 'net-smtp', require: false
37
- gem 'net-imap', require: false
38
- gem 'net-pop', require: false
39
- end
0 commit comments