Skip to content

Commit ac11259

Browse files
authored
Merge pull request #213 from rspec/pin_bundler_older_ruby
Ensure bundler is pinned to version less than 2.0.0 on older rubies
2 parents ef97cc5 + cccb7e3 commit ac11259

File tree

3 files changed

+21
-3
lines changed

3 files changed

+21
-3
lines changed

travis/.travis.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,7 @@ cache:
55
directories:
66
- ../bundle
77
before_install:
8-
# We need to ensure the latest version of Rubygems, unless we're on an old Ruby.
9-
- gem update --system $(ruby -e "puts '2.7.8' if ENV['RUBY_VERSION'] >= '2.3.0'")
10-
- gem install bundler
8+
- "script/update_rubygems_and_install_bundler"
119
- unset _JAVA_OPTIONS
1210
- "script/clone_all_rspec_repos"
1311
bundler_args: "--binstubs --standalone --without documentation --path ../bundle"

travis/script/predicate_functions.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,14 @@ function is_mri_2plus {
5454
fi
5555
}
5656

57+
function is_ruby_23_plus {
58+
if ruby -e "exit(RUBY_VERSION.to_f >= 2.3)"; then
59+
return 0
60+
else
61+
return 1
62+
fi
63+
}
64+
5765
function rspec_support_compatible {
5866
if [ "$MAINTENANCE_BRANCH" != "2-99-maintenance" ] && [ "$MAINTENANCE_BRANCH" != "2-14-maintenance" ]; then
5967
return 0
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#!/bin/bash
2+
set -e
3+
source script/functions.sh
4+
5+
if is_ruby_23_plus; then
6+
gem update --system
7+
gem install bundler
8+
else
9+
echo "Warning installing older versions of Rubygems / Bundler"
10+
gem update --system '2.7.8'
11+
gem install bundler -v '1.17.3'
12+
fi

0 commit comments

Comments
 (0)