forked from cbeer/is_it_working
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Appraisals
39 lines (34 loc) · 1.23 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
# Install gems for all appraisal definitions:
#
# $ appraisal install
#
# To run tests on different versions:
#
# $ appraisal activerecord_x.x rspec spec
# We need to build up the correct versions based on the Ruby version being run.
# Since not all rails versions are compatible with all ruby versions
require "bundler"
ruby_version = ::Gem::Version.new(RUBY_VERSION)
rails_versions = []
if(ruby_version < ::Gem::Version.new("2.3.0"))
rails_versions = [
['3.2', '~> 3.2.0'],
['4.0', '~> 4.0.0'],
['4.1', '~> 4.1.0'],
['4.2', '~> 4.2.0'],
]
elsif(ruby_version >= ::Gem::Version.new("2.3.0") && ruby_version < ::Gem::Version.new("2.5.0"))
rails_versions = [[ '5.0', '~> 5.0.0' ]]
elsif(ruby_version >= ::Gem::Version.new("2.5.0") && ruby_version < ::Gem::Version.new("2.6.0"))
rails_versions = [['5.1', '~> 5.1.0'],['5.2', '~> 5.2.0']]
elsif(ruby_version >= ::Gem::Version.new("2.6.0") && ruby_version < ::Gem::Version.new("3.0.0"))
rails_versions = [[ '6.0', '~> 6.0.0' ]]
else
rails_versions = [['6.1', '~> 6.1.0'], ['7.0', '~> 7.0.0']]
end
rails_versions.each do |ver_name, ver_req|
appraise "rails_#{ver_name}" do
gem 'actionmailer', ver_req
gem 'activerecord', ver_req
end
end