Skip to content

Commit fc959be

Browse files
committed
fixup! Revert predicate_functions changes
1 parent 3e28616 commit fc959be

File tree

1 file changed

+15
-3
lines changed

1 file changed

+15
-3
lines changed

script/predicate_functions.sh

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,19 @@
22
# DO NOT modify it by hand as your changes will get lost the next time it is generated.
33

44
function is_mri {
5-
if ruby -e "exit(RUBY_ENGINE == 'ruby')"; then
5+
if ruby -e "exit(!defined?(RUBY_ENGINE) || RUBY_ENGINE == 'ruby')"; then
6+
# RUBY_ENGINE only returns 'ruby' on MRI.
7+
# MRI 1.8.7 lacks the constant but all other rubies have it (including JRuby in 1.8 mode)
68
return 0
79
else
810
return 1
911
fi;
1012
}
1113

1214
function is_jruby {
13-
if ruby -e "exit(RUBY_PLATFORM == 'java')"; then
15+
if ruby -e "exit(defined?(RUBY_PLATFORM) && RUBY_PLATFORM == 'java')"; then
16+
# RUBY_ENGINE only returns 'ruby' on MRI.
17+
# MRI 1.8.7 lacks the constant but all other rubies have it (including JRuby in 1.8 mode)
1418
return 0
1519
else
1620
return 1
@@ -69,14 +73,22 @@ function rspec_rails_compatible {
6973
fi
7074
}
7175

76+
function rspec_support_compatible {
77+
if [ "$MAINTENANCE_BRANCH" != "2-99-maintenance" ] && [ "$MAINTENANCE_BRANCH" != "2-14-maintenance" ]; then
78+
return 0
79+
else
80+
return 1
81+
fi
82+
}
83+
7284
function additional_specs_available {
7385
type run_additional_specs > /dev/null 2>&1
7486
return $?
7587
}
7688

7789
function documentation_enforced {
7890
if [ -x ./bin/yard ]; then
79-
if is_mri; then
91+
if is_mri_2plus; then
8092
return 0
8193
else
8294
return 1

0 commit comments

Comments
 (0)