Skip to content

Commit 67dcec9

Browse files
committed
limit disabling ruby gems to MRI > 1.9wq
1 parent c095911 commit 67dcec9

File tree

2 files changed

+15
-3
lines changed

2 files changed

+15
-3
lines changed

travis/script/functions.sh

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,11 @@ export JRUBY_OPTS=${JRUBY_OPTS:-"--server -Xcompile.invokedynamic=false"}
88
SPECS_HAVE_RUN_FILE=specs.out
99
MAINTENANCE_BRANCH=`cat maintenance-branch`
1010

11-
# Don't allow rubygems to pollute what's loaded. Also, things boot
12-
# faster without the extra load time of rubygems.
13-
export RUBYOPT="--disable=gem"
11+
# Don't allow rubygems to pollute what's loaded. Also, things boot faster
12+
# without the extra load time of rubygems. Only works on MRI Ruby 1.9+
13+
if is_mri_192_plus; then
14+
export RUBYOPT="--disable=gem"
15+
fi
1416

1517
function clone_repo {
1618
if [ ! -d $1 ]; then # don't clone if the dir is already there

travis/script/predicate_functions.sh

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,16 @@ function is_mri_192 {
2020
fi
2121
}
2222

23+
function is_mri_192_plus {
24+
if is_mri; then
25+
if ruby -e "exit(RUBY_VERSION.to_f > 1.9)"; then
26+
return 0
27+
else
28+
return 1
29+
fi
30+
fi
31+
}
32+
2333
function is_mri_2plus {
2434
if is_mri; then
2535
if ruby -e "exit(RUBY_VERSION.to_f > 2.0)"; then

0 commit comments

Comments
 (0)