forked from splitwise/super_diff
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Appraisals
69 lines (58 loc) · 1.61 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
rails_dependencies =
proc do
gem "activerecord-jdbcsqlite3-adapter", platform: :jruby
gem "jdbc-sqlite3", platform: :jruby
gem "net-ftp"
gem "combustion"
end
appraisals = {
rails_6_0:
proc do
instance_eval(&rails_dependencies)
gem "rails", "~> 6.0.0"
gem "sqlite3", "~> 1.4.0", platform: %i[ruby mswin mingw]
end,
rails_6_1:
proc do
instance_eval(&rails_dependencies)
gem "rails", "~> 6.1.0"
gem "sqlite3", "~> 1.4.0", platform: %i[ruby mswin mingw]
end,
rails_7_0:
proc do
instance_eval(&rails_dependencies)
gem "rails", "~> 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", "3.12.0"
gem "rspec-core", "3.12.0"
gem "rspec-expectations", "3.12.3"
gem "rspec-mocks", "3.12.0"
gem "rspec-support", "3.12.0"
gem "rspec-rails" if with_rails
end
}
rails_appraisals = %i[no_rails rails_6_0 rails_6_1 rails_7_0]
rspec_appraisals = %i[rspec_lt_3_10 rspec_gte_3_10]
rails_appraisals.each do |rails_appraisal|
rspec_appraisals.each do |rspec_appraisal|
appraise "#{rails_appraisal}_#{rspec_appraisal}" do
instance_eval(&appraisals.fetch(rails_appraisal))
instance_exec(
rails_appraisal != :no_rails,
&appraisals.fetch(rspec_appraisal)
)
end
end
end