Skip to content

Disable rubygems on travis. #116

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Aug 22, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion travis/script/functions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,12 @@ export JRUBY_OPTS=${JRUBY_OPTS:-"--server -Xcompile.invokedynamic=false"}
SPECS_HAVE_RUN_FILE=specs.out
MAINTENANCE_BRANCH=`cat maintenance-branch`

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

function clone_repo {
if [ ! -d $1 ]; then # don't clone if the dir is already there
travis_retry eval "git clone git://github.com/rspec/$1 --depth 1 --branch $MAINTENANCE_BRANCH"
Expand Down Expand Up @@ -43,10 +49,15 @@ function run_cukes {
# the bin/cucumber approach below. That approach is faster
# (as it avoids the bundler tax), so we use it on rubies where we can.
bundle exec cucumber --strict
elif is_jruby; then
# For some reason JRuby doesn't like our improved bundler setup
RUBYOPT="-I${PWD}/../bundle -rbundler/setup" \
PATH="${PWD}/bin:$PATH" \
bin/cucumber --strict
else
# Prepare RUBYOPT for scenarios that are shelling out to ruby,
# and PATH for those that are using `rspec` or `rake`.
RUBYOPT="-I${PWD}/../bundle -rbundler/setup" \
RUBYOPT="${RUBYOPT} -I${PWD}/../bundle -rbundler/setup" \
PATH="${PWD}/bin:$PATH" \
bin/cucumber --strict
fi
Expand Down
22 changes: 22 additions & 0 deletions travis/script/predicate_functions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,16 @@ function is_mri {
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
Expand All @@ -20,6 +30,18 @@ function is_mri_192 {
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
Expand Down