aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/utils/ruby.sh
diff options
context:
space:
mode:
authorMike McQuaid2017-09-21 14:27:17 +0100
committerMike McQuaid2017-09-21 14:27:17 +0100
commitb2b413165f3553c48c8e060dd97ccde9c13cae80 (patch)
tree3b79e6c1d0fd8f8e5138b81b4d4757d79e3aeaee /Library/Homebrew/utils/ruby.sh
parent2056cd2c90109ab410118442f0aacf73f6fb198c (diff)
downloadbrew-b2b413165f3553c48c8e060dd97ccde9c13cae80.tar.bz2
Upgrade vendored Ruby to 2.3.3.
Use this version whenever 2.3.3 isn't installed. Also, remove the Linux portable Ruby for now until it's built to be the same version.
Diffstat (limited to 'Library/Homebrew/utils/ruby.sh')
-rw-r--r--Library/Homebrew/utils/ruby.sh9
1 files changed, 4 insertions, 5 deletions
diff --git a/Library/Homebrew/utils/ruby.sh b/Library/Homebrew/utils/ruby.sh
index 6945c068b..0303da600 100644
--- a/Library/Homebrew/utils/ruby.sh
+++ b/Library/Homebrew/utils/ruby.sh
@@ -2,7 +2,8 @@ setup-ruby-path() {
local vendor_dir
local vendor_ruby_current_version
local vendor_ruby_path
- local ruby_version_major
+ local ruby_old_version
+ local minimum_ruby_version="2.3.3"
vendor_dir="$HOMEBREW_LIBRARY/Homebrew/vendor"
vendor_ruby_current_version="$vendor_dir/portable-ruby/current"
@@ -36,12 +37,10 @@ setup-ruby-path() {
if [[ -n "$HOMEBREW_RUBY_PATH" ]]
then
- ruby_version_major="$("$HOMEBREW_RUBY_PATH" --version)"
- ruby_version_major="${ruby_version_major#ruby }"
- ruby_version_major="${ruby_version_major%%.*}"
+ ruby_old_version="$("$HOMEBREW_RUBY_PATH" -e "puts Gem::Version.new('$minimum_ruby_version') > Gem::Version.new(RUBY_VERSION)")"
fi
- if [[ "$ruby_version_major" != "2" || -n "$HOMEBREW_FORCE_VENDOR_RUBY" ]]
+ if [[ "$ruby_old_version" == "true" || -n "$HOMEBREW_FORCE_VENDOR_RUBY" ]]
then
brew vendor-install ruby --quiet
if [[ ! -x "$vendor_ruby_path" ]]