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 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162
|
# This file was generated on 2023-12-25T16:07:49+00:00 from the rspec-dev repo.
# DO NOT modify it by hand as your changes will get lost the next time it is generated.
function is_mri {
if ruby -e "exit(!defined?(RUBY_ENGINE) || RUBY_ENGINE == 'ruby')"; then
# RUBY_ENGINE only returns 'ruby' on MRI.
# MRI 1.8.7 lacks the constant but all other rubies have it (including JRuby in 1.8 mode)
return 0
else
return 1
fi;
}
function is_ruby_head {
# This checks for the presence of our CI's ruby-head env variable
if [ -z ${RUBY_HEAD+x} ]; then
return 1
else
return 0
fi;
}
function supports_cross_build_checks {
if is_mri; then
# We don't run cross build checks on ruby-head
if is_ruby_head; then
return 1
else
return 0
fi
else
return 1
fi
}
function is_jruby {
if ruby -e "exit(defined?(RUBY_PLATFORM) && RUBY_PLATFORM == 'java')"; then
# RUBY_ENGINE only returns 'ruby' on MRI.
# MRI 1.8.7 lacks the constant but all other rubies have it (including JRuby in 1.8 mode)
return 0
else
return 1
fi;
}
function is_mri_192 {
if is_mri; then
if ruby -e "exit(RUBY_VERSION == '1.9.2')"; then
return 0
else
return 1
fi
else
return 1
fi
}
function is_mri_192_plus {
if is_mri; then
if ruby -e "exit(RUBY_VERSION.to_f > 1.8)"; then
return 0
else
return 1
fi
else
return 1
fi
}
function is_mri_2plus {
if is_mri; then
if ruby -e "exit(RUBY_VERSION.to_f > 2.0)"; then
return 0
else
return 1
fi
else
return 1
fi
}
function is_ruby_23_plus {
if ruby -e "exit(RUBY_VERSION.to_f >= 2.3)"; then
return 0
else
return 1
fi
}
function is_ruby_25_plus {
if ruby -e "exit(RUBY_VERSION.to_f >= 2.5)"; then
return 0
else
return 1
fi
}
function is_ruby_27_plus {
if ruby -e "exit(RUBY_VERSION.to_f >= 2.7)"; then
return 0
else
return 1
fi
}
function is_ruby_31_plus {
if ruby -e "exit(RUBY_VERSION.to_f >= 3.1)"; then
return 0
else
return 1
fi
}
function rspec_rails_compatible {
if is_ruby_25_plus; then
# TODO remove when RSpec-Rails build is 3.1 safe by default
if is_ruby_31_plus; then
return 1
else
return 0
fi
else
return 1
fi
}
function rspec_support_compatible {
if [ "$MAINTENANCE_BRANCH" != "2-99-maintenance" ] && [ "$MAINTENANCE_BRANCH" != "2-14-maintenance" ]; then
return 0
else
return 1
fi
}
function additional_specs_available {
type run_additional_specs > /dev/null 2>&1
return $?
}
function documentation_enforced {
if [ -x ./bin/yard ]; then
if is_mri_2plus; then
return 0
else
return 1
fi
else
return 1
fi
}
function style_and_lint_enforced {
if is_ruby_head; then
return 1
else
if [ -x ./bin/rubocop ]; then
return 0
else
return 1
fi
fi
}
|