-
Notifications
You must be signed in to change notification settings - Fork 375
/
Appraisals
55 lines (44 loc) · 1.41 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
lib = File.expand_path('lib', __dir__)
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
require 'datadog/version'
module DisableBundleCheck
def check_command
['bundle', 'exec', 'false']
end
end
::Appraisal::Appraisal.prepend(DisableBundleCheck) if ['true', 'y', 'yes', '1'].include?(ENV['APPRAISAL_SKIP_BUNDLE_CHECK'])
alias original_appraise appraise
REMOVED_GEMS = {
:check => [
'rbs',
'steep',
],
}
def appraise(group, &block)
# Specify the environment variable APPRAISAL_GROUP to load only a specific appraisal group.
if ENV['APPRAISAL_GROUP'].nil? || ENV['APPRAISAL_GROUP'] == group
original_appraise(group) do
instance_exec(&block)
REMOVED_GEMS.each do |group_name, gems|
group(group_name) do
gems.each do |gem_name|
# appraisal 2.2 doesn't have remove_gem, which applies to ruby 2.1 and 2.2
remove_gem gem_name if respond_to?(:remove_gem)
end
end
end
end
end
end
major, minor, = if defined?(RUBY_ENGINE_VERSION)
Gem::Version.new(RUBY_ENGINE_VERSION).segments
else
# For Ruby < 2.3
Gem::Version.new(RUBY_VERSION).segments
end
ruby_runtime = "#{RUBY_ENGINE}-#{major}.#{minor}"
instance_eval IO.read("appraisal/#{ruby_runtime}.rb")
appraisals.each do |appraisal|
appraisal.name.prepend("#{ruby_runtime}-")
end
# vim: ft=ruby