-
Notifications
You must be signed in to change notification settings - Fork 3
/
Appraisals
49 lines (39 loc) · 1.35 KB
/
Appraisals
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
# frozen_string_literal: true
def appgen(gems) # rubocop:disable Metrics/CyclomaticComplexity
description = gems.map{ |name, version| "#{name} #{version}" }.join(', ')
appraise "ruby-#{RUBY_VERSION[/\d+\.\d+/]} #{description}" do
gems.each do |name, version|
gem name, version
end
if RUBY_VERSION < '2.0'
gem 'concurrent-ruby', '!= 1.1.1'
gem 'rack-cache', '< 1.7.2'
gem 'rake', '< 12.3'
end
if RUBY_VERSION < '2.1'
gem 'nokogiri', '< 1.7'
end
if RUBY_VERSION < '2.5'
gem 'loofah', '< 2.21.0'
end
gem 'tzinfo'
gem 'sprockets-rails' if gems['railties'] != '~> 3.2' && !gems['sprockets-rails']
end
end
if RUBY_VERSION < '2.4'
appgen 'railties' => '~> 3.2'
end
if RUBY_VERSION >= '1.9' && RUBY_VERSION < '2.5'
appgen 'railties' => '~> 4.0', 'sprockets-rails' => '~> 2.0'
appgen 'railties' => '~> 4.0', 'sprockets' => '~> 3.0'
end
if RUBY_VERSION >= '2.3' && RUBY_VERSION < '2.7'
appgen 'railties' => '~> 5.0', 'sprockets-rails' => '~> 2.0'
appgen 'railties' => '~> 5.0', 'sprockets' => '~> 3.0'
appgen 'railties' => '~> 5.0', 'sprockets' => '>= 4.0' if RUBY_VERSION >= '2.5'
end
if RUBY_VERSION >= '2.5'
appgen 'railties' => '~> 6.0', 'sprockets-rails' => '~> 2.0'
appgen 'railties' => '~> 6.0', 'sprockets' => '~> 3.0'
appgen 'railties' => '~> 6.0', 'sprockets' => '>= 4.0'
end