Skip to content

Ensure bundler is pinned to version less than 2.0.0 on older rubies #213

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 1 commit into from
Jan 4, 2019
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
4 changes: 1 addition & 3 deletions travis/.travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,7 @@ cache:
directories:
- ../bundle
before_install:
# We need to ensure the latest version of Rubygems, unless we're on an old Ruby.
- gem update --system $(ruby -e "puts '2.7.8' if ENV['RUBY_VERSION'] >= '2.3.0'")
- gem install bundler
- "script/update_rubygems_and_install_bundler"
- unset _JAVA_OPTIONS
- "script/clone_all_rspec_repos"
bundler_args: "--binstubs --standalone --without documentation --path ../bundle"
Expand Down
8 changes: 8 additions & 0 deletions travis/script/predicate_functions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,14 @@ function is_mri_2plus {
fi
}

function is_ruby_23_plus {
if ruby -e "exit(RUBY_VERSION.to_f >= 2.3)"; then
return 0
else
return 1
fi
}

function rspec_support_compatible {
if [ "$MAINTENANCE_BRANCH" != "2-99-maintenance" ] && [ "$MAINTENANCE_BRANCH" != "2-14-maintenance" ]; then
return 0
Expand Down
12 changes: 12 additions & 0 deletions travis/script/update_rubygems_and_install_bundler
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/bin/bash
set -e
source script/functions.sh

if is_ruby_23_plus; then
gem update --system
gem install bundler
else
echo "Warning installing older versions of Rubygems / Bundler"
gem update --system '2.7.8'
gem install bundler -v '1.17.3'
fi