mirror of
https://github.com/github/rails.git
synced 2026-01-10 23:28:10 -05:00
41 lines
750 B
Bash
Executable File
41 lines
750 B
Bash
Executable File
#!/bin/bash
|
|
|
|
set -x
|
|
set -e
|
|
|
|
RUBY_VERSION="$1"
|
|
|
|
# Use the right Ruby /without/ rbenv
|
|
ruby_dir=$(dirname "$(RBENV_VERSION=$RUBY_VERSION rbenv which ruby)")
|
|
export PATH=$ruby_dir:$PATH
|
|
|
|
# Announce who we are
|
|
ruby -v
|
|
|
|
# Because Rails 2.3 doesn't use Bundler for its own tests,
|
|
# we need to setup an isolated gem environment.
|
|
|
|
gem_environment_version="$(md5sum Gemfile.sh | cut -d' ' -f1)-$(ruby -e 'print RUBY_VERSION')"
|
|
|
|
gem_dir=`pwd`/.gem
|
|
gem_pristine_dir=${gem_dir}-${gem_environment_version}
|
|
|
|
export GEM_HOME=$gem_dir
|
|
export GEM_PATH=$gem_dir:$GEM_PATH
|
|
export GEM_ROOT=$gem_dir
|
|
|
|
rm -rf $gem_dir
|
|
|
|
if [ ! -d $gem_pristine_dir ]; then
|
|
mkdir $gem_dir
|
|
|
|
. Gemfile.sh
|
|
|
|
mv $gem_dir $gem_pristine_dir
|
|
fi
|
|
|
|
cp -r $gem_pristine_dir $gem_dir
|
|
|
|
# Go ham
|
|
rake
|