diff options
| author | Gautham Goli | 2017-10-12 00:29:19 +0530 |
|---|---|---|
| committer | Gautham Goli | 2017-10-13 19:50:46 +0530 |
| commit | 7fa51f71f1a8a21b905bafc1fb4106f0222d654f (patch) | |
| tree | 098d2477a8262a5770310fed4693da31c4392e1c /Library/Homebrew/utils/ruby.sh | |
| parent | afdd0e2437426ec85ff86e5b7562d3a6a69ba3e5 (diff) | |
| parent | 56458f03fcc68ef6d8ee3ee4a7c1d16021aa5800 (diff) | |
| download | brew-7fa51f71f1a8a21b905bafc1fb4106f0222d654f.tar.bz2 | |
Merge branch 'master' into audit_line_rubocop_part_4_rebase_attempt_1
Diffstat (limited to 'Library/Homebrew/utils/ruby.sh')
| -rw-r--r-- | Library/Homebrew/utils/ruby.sh | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/Library/Homebrew/utils/ruby.sh b/Library/Homebrew/utils/ruby.sh index 6945c068b..9a3ab2e81 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" @@ -21,7 +22,7 @@ setup-ruby-path() { if [[ $(readlink "$vendor_ruby_current_version") != "$(<"$vendor_dir/portable-ruby-version")" ]] then - if ! brew vendor-install ruby --quiet + if ! brew vendor-install ruby then onoe "Failed to upgrade vendor Ruby." fi @@ -36,14 +37,12 @@ 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" -rrubygems -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 + brew vendor-install ruby if [[ ! -x "$vendor_ruby_path" ]] then odie "Failed to install vendor Ruby." |
