Skip to content

Commit

Permalink
Use the cached gem directory if available
Browse files Browse the repository at this point in the history
This avoids an HTTP request to RubyGems.org.
  • Loading branch information
stanhu authored and mudge committed Sep 7, 2023
1 parent 3edf17b commit 876ce12
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions scripts/test-gem-install
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,15 @@ if [ -n "${BUNDLE_APP_CONFIG:-}" ] ; then
export BUNDLE_CACHE_PATH="${BUNDLE_APP_CONFIG}/cache"
fi

cd $(dirname `gem which re2`)
cd ..
bundle install --local || bundle install

# Use the cached vendored gems directory if available.
# This is easier than trying to retrieve the value of `bundle config get path`.
cached_gems="$(pwd)/vendor/bundle"
if [ -d "$cached_gems" ]; then
export BUNDLE_PATH=$cached_gems
fi

cd "$(dirname "$(gem which re2)")"
cd ..
bundle exec rake spec

0 comments on commit 876ce12

Please sign in to comment.