This repository has been archived by the owner on Jul 14, 2023. It is now read-only.
forked from splitwise/super_diff
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Appraisals
118 lines (101 loc) · 3.01 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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
rails_dependencies =
proc do
gem "activerecord-jdbcsqlite3-adapter", platform: :jruby
gem "jdbc-sqlite3", platform: :jruby
install_if '-> { Gem::Requirement.new(">= 2.6.0").satisfied_by?(Gem::Version.new(RUBY_VERSION)) }' do
gem "net-ftp"
end
end
appraisals = {
rails_5_0:
proc do
instance_eval(&rails_dependencies)
gem "activerecord", "~> 5.0.0"
gem "railties", "~> 5.0.0"
gem "sqlite3", "~> 1.3.6", platform: %i[ruby mswin mingw]
end,
rails_5_1:
proc do
instance_eval(&rails_dependencies)
gem "activerecord", "~> 5.1.0"
gem "railties", "~> 5.1.0"
gem "sqlite3", "~> 1.3.6", platform: %i[ruby mswin mingw]
end,
rails_5_2:
proc do
instance_eval(&rails_dependencies)
gem "activerecord", "~> 5.2.0"
gem "railties", "~> 5.2.0"
gem "sqlite3", "~> 1.3.6", platform: %i[ruby mswin mingw]
end,
rails_6_0:
proc do
instance_eval(&rails_dependencies)
gem "activerecord", "~> 6.0.0"
gem "railties", "~> 6.0.0"
gem "sqlite3", "~> 1.4.0", platform: %i[ruby mswin mingw]
end,
rails_6_1:
proc do
instance_eval(&rails_dependencies)
gem "activerecord", "~> 6.1.0"
gem "railties", "~> 6.1.0"
gem "sqlite3", "~> 1.4.0", platform: %i[ruby mswin mingw]
end,
rails_7_0:
proc do
instance_eval(&rails_dependencies)
gem "activerecord", "~> 7.0.0"
gem "railties", "~> 7.0.0"
gem "sqlite3", "~> 1.4.0", platform: %i[ruby mswin mingw]
end,
no_rails: proc {},
rspec_lt_3_10:
proc do |with_rails|
version = "~> 3.9.0"
gem "rspec", version
gem "rspec-rails" if with_rails
end,
rspec_gte_3_10:
proc do |with_rails|
version = [">= 3.10", "< 4"]
gem "rspec", *version
gem "rspec-rails" if with_rails
end
}
rails_appraisals = [:no_rails]
if Gem::Requirement.new("< 3").satisfied_by?(Gem::Version.new(RUBY_VERSION))
rails_appraisals << :rails_5_0
rails_appraisals << :rails_5_1
rails_appraisals << :rails_5_2
end
if Gem::Requirement.new(">= 2.5.0").satisfied_by?(
Gem::Version.new(RUBY_VERSION)
)
rails_appraisals << :rails_6_0
rails_appraisals << :rails_6_1
end
if Gem::Requirement.new(">= 2.7.0").satisfied_by?(
Gem::Version.new(RUBY_VERSION)
)
rails_appraisals << :rails_7_0
end
rspec_appraisals = %i[rspec_lt_3_10 rspec_gte_3_10]
rails_appraisals.each do |rails_appraisal|
rspec_appraisals.each do |rspec_appraisal|
if rails_appraisal == :no_rails
appraise "#{rails_appraisal}_#{rspec_appraisal}" do
instance_eval(&appraisals.fetch(rails_appraisal))
instance_exec(false, &appraisals.fetch(rspec_appraisal))
end
elsif %i[rails_6_1 rails_7_0].include?(rails_appraisal) &&
rspec_appraisal == :rspec_lt_3_10
next
else
appraise "#{rails_appraisal}_#{rspec_appraisal}" do
instance_eval(&appraisals.fetch(rails_appraisal))
instance_exec(true, &appraisals.fetch(rspec_appraisal))
end
end
end
end