@@ -11,6 +11,15 @@ def add_net_gems_dependency
11
11
end
12
12
end
13
13
14
+ # This is only required for 5.2.x and 5-2-stable since some versions of
15
+ # activesupport were released using unsupported operators for their
16
+ # supported Ruby matrix, specifically the &. operator on Ruby 2.2
17
+ def block_broken_activesupport
18
+ return unless RUBY_VERSION < '2.3'
19
+
20
+ gem "activesupport", "~> 5.2", "!= 5.2.6.1", "!= 5.2.6.2"
21
+ end
22
+
14
23
case version = ENV['RAILS_VERSION'] || (File.exist?(version_file) && File.read(version_file).chomp) || ''
15
24
when /main/
16
25
gem "rails", :git => "https://github.com/rails/rails.git"
@@ -23,17 +32,32 @@ when /stable$/
23
32
gem 'activerecord-jdbcsqlite3-adapter', git: 'https://github.com/jruby/activerecord-jdbc-adapter', platforms: [:jruby]
24
33
25
34
gem_list.each do |rails_gem|
26
- gem rails_gem, :git => "https://github.com/rails/rails.git", :branch => version
35
+ if version == '5-2-stable' && RUBY_VERSION < '2.3'
36
+ # Until 5-2-stable is fixed on Ruby 2.2, pin to last working version
37
+ gem rails_gem, :git => "https://github.com/rails/rails.git", :branch => "v5.2.0"
38
+ else
39
+ gem rails_gem, :git => "https://github.com/rails/rails.git", :branch => version
40
+ end
27
41
end
42
+
43
+ block_broken_activesupport if version == '5-2-stable'
28
44
when nil, false, ""
29
45
add_net_gems_dependency # TODO: remove when we use switch to "~> 7.0.0" that declares dependency on those gems on itself
30
46
gem "rails", "~> 6.0.0"
31
47
gem "puma"
32
48
gem 'activerecord-jdbcsqlite3-adapter', platforms: [:jruby]
33
49
gem 'selenium-webdriver', require: false
34
50
else
35
- add_net_gems_dependency if version.split(' ').last < '7.0'
51
+ rails_version = version.split(' ').last
52
+
53
+ add_net_gems_dependency if rails_version < '7.0'
54
+
36
55
gem "rails", version
56
+
57
+ if rails_version < '6.0' && RUBY_VERSION < '2.3'
58
+ gem "activesupport", "~> 5.2", "!= 5.2.6.1", "!= 5.2.6.2"
59
+ end
60
+
37
61
gem "sprockets", '~> 3.0' if RUBY_VERSION < '2.5'
38
62
gem "puma"
39
63
gem 'activerecord-jdbcsqlite3-adapter', platforms: [:jruby]
0 commit comments