diff options
| author | Xu Cheng | 2016-06-28 23:41:28 +0800 |
|---|---|---|
| committer | Xu Cheng | 2016-07-11 21:12:56 +0800 |
| commit | 534bf08ec33c89115d8061a9d1845e67f9a6cbb6 (patch) | |
| tree | f00491ba7c72030f29f227700615d2f25c676423 /Library/brew.sh | |
| parent | a35e3f1fc183af98451f92eda2c5e42c328e36ba (diff) | |
| download | brew-534bf08ec33c89115d8061a9d1845e67f9a6cbb6.tar.bz2 | |
brew.sh: new HOMEBREW_RUBY_PATH resolution logic
* Use vendor Ruby if it's present
* Install vendor Ruby for system without Ruby 2.x
Diffstat (limited to 'Library/brew.sh')
| -rw-r--r-- | Library/brew.sh | 25 |
1 files changed, 5 insertions, 20 deletions
diff --git a/Library/brew.sh b/Library/brew.sh index c1606a4ff..3e137323c 100644 --- a/Library/brew.sh +++ b/Library/brew.sh @@ -64,31 +64,12 @@ fi unset GEM_HOME unset GEM_PATH -if [[ -z "$HOMEBREW_DEVELOPER" ]] -then - unset HOMEBREW_RUBY_PATH -fi - HOMEBREW_SYSTEM="$(uname -s)" case "$HOMEBREW_SYSTEM" in Darwin) HOMEBREW_OSX="1";; Linux) HOMEBREW_LINUX="1";; esac -if [[ -z "$HOMEBREW_RUBY_PATH" ]] -then - if [[ -n "$HOMEBREW_OSX" ]] - then - HOMEBREW_RUBY_PATH="/System/Library/Frameworks/Ruby.framework/Versions/Current/usr/bin/ruby" - else - HOMEBREW_RUBY_PATH="$(which ruby)" - if [[ -z "$HOMEBREW_RUBY_PATH" ]] - then - odie "No Ruby found, cannot proceed." - fi - fi -fi - HOMEBREW_CURL="/usr/bin/curl" if [[ -n "$HOMEBREW_OSX" ]] then @@ -131,7 +112,6 @@ export HOMEBREW_LIBRARY export HOMEBREW_VERSION export HOMEBREW_CACHE export HOMEBREW_CELLAR -export HOMEBREW_RUBY_PATH export HOMEBREW_SYSTEM export HOMEBREW_CURL export HOMEBREW_PROCESSOR @@ -231,6 +211,11 @@ fi # Hide shellcheck complaint: # shellcheck source=/dev/null +source "$HOMEBREW_LIBRARY/Homebrew/utils/ruby.sh" +setup-ruby-path + +# Hide shellcheck complaint: +# shellcheck source=/dev/null source "$HOMEBREW_LIBRARY/Homebrew/utils/analytics.sh" setup-analytics report-analytics-screenview-command |
