From 79fab04fe912110d04a5d0e2c891a797e1daab7b Mon Sep 17 00:00:00 2001 From: Jon Rowe Date: Wed, 6 Jan 2016 22:57:44 +1100 Subject: [PATCH] Updated travis build scripts (from rspec-dev) --- .rubocop_rspec_base.yml | 2 +- .travis.yml | 2 +- appveyor.yml | 2 +- script/clone_all_rspec_repos | 2 +- script/functions.sh | 14 ++++++++++++-- script/predicate_functions.sh | 14 +++++++++++++- script/run_build | 2 +- script/travis_functions.sh | 2 +- 8 files changed, 31 insertions(+), 9 deletions(-) diff --git a/.rubocop_rspec_base.yml b/.rubocop_rspec_base.yml index c6f89446a..53d476e33 100644 --- a/.rubocop_rspec_base.yml +++ b/.rubocop_rspec_base.yml @@ -1,4 +1,4 @@ -# This file was generated on 2016-01-04T21:06:21+09:00 from the rspec-dev repo. +# This file was generated on 2016-01-06T22:57:44+11:00 from the rspec-dev repo. # DO NOT modify it by hand as your changes will get lost the next time it is generated. # This file contains defaults for RSpec projects. Individual projects diff --git a/.travis.yml b/.travis.yml index 767c93e30..811457aef 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,4 +1,4 @@ -# This file was generated on 2016-01-04T21:06:21+09:00 from the rspec-dev repo. +# This file was generated on 2016-01-06T22:57:44+11:00 from the rspec-dev repo. # DO NOT modify it by hand as your changes will get lost the next time it is generated. language: ruby diff --git a/appveyor.yml b/appveyor.yml index 9108caca4..eaaba1c15 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -1,4 +1,4 @@ -# This file was generated on 2016-01-04T21:06:21+09:00 from the rspec-dev repo. +# This file was generated on 2016-01-06T22:57:44+11:00 from the rspec-dev repo. # DO NOT modify it by hand as your changes will get lost the next time it is generated. version: "{build}" diff --git a/script/clone_all_rspec_repos b/script/clone_all_rspec_repos index 965017c52..706eea4de 100755 --- a/script/clone_all_rspec_repos +++ b/script/clone_all_rspec_repos @@ -1,5 +1,5 @@ #!/bin/bash -# This file was generated on 2016-01-04T21:06:21+09:00 from the rspec-dev repo. +# This file was generated on 2016-01-06T22:57:44+11:00 from the rspec-dev repo. # DO NOT modify it by hand as your changes will get lost the next time it is generated. set -e diff --git a/script/functions.sh b/script/functions.sh index 79589bfe0..36f5f094c 100644 --- a/script/functions.sh +++ b/script/functions.sh @@ -1,4 +1,4 @@ -# This file was generated on 2016-01-04T21:06:21+09:00 from the rspec-dev repo. +# This file was generated on 2016-01-06T22:57:44+11:00 from the rspec-dev repo. # DO NOT modify it by hand as your changes will get lost the next time it is generated. SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" @@ -11,6 +11,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" @@ -77,7 +83,11 @@ function run_spec_suite_for { pushd ../$1 unset BUNDLE_GEMFILE bundle_install_flags=`cat .travis.yml | grep bundler_args | tr -d '"' | grep -o " .*"` - travis_retry eval "bundle install $bundle_install_flags" + if is_mri_192_plus; then + travis_retry eval "RUBYOPT=$RUBYOPT:'--enable rubygems' bundle install $bundle_install_flags" + else + travis_retry eval "bundle install $bundle_install_flags" + fi run_specs_and_record_done popd else diff --git a/script/predicate_functions.sh b/script/predicate_functions.sh index 0f756605a..e3149cd17 100644 --- a/script/predicate_functions.sh +++ b/script/predicate_functions.sh @@ -1,4 +1,4 @@ -# This file was generated on 2016-01-04T21:06:21+09:00 from the rspec-dev repo. +# This file was generated on 2016-01-06T22:57:44+11: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 { @@ -33,6 +33,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 diff --git a/script/run_build b/script/run_build index 3558d9753..f5303e14e 100755 --- a/script/run_build +++ b/script/run_build @@ -1,5 +1,5 @@ #!/bin/bash -# This file was generated on 2016-01-04T21:06:21+09:00 from the rspec-dev repo. +# This file was generated on 2016-01-06T22:57:44+11:00 from the rspec-dev repo. # DO NOT modify it by hand as your changes will get lost the next time it is generated. set -e diff --git a/script/travis_functions.sh b/script/travis_functions.sh index cdf3f433a..f1f8704a0 100644 --- a/script/travis_functions.sh +++ b/script/travis_functions.sh @@ -1,4 +1,4 @@ -# This file was generated on 2016-01-04T21:06:21+09:00 from the rspec-dev repo. +# This file was generated on 2016-01-06T22:57:44+11:00 from the rspec-dev repo. # DO NOT modify it by hand as your changes will get lost the next time it is generated. # Taken from: