Merge pull request #494 from MikeMcQuaid/vendor-ruby-tweaks

Vendored Ruby tweaks
This commit is contained in:
Mike McQuaid 2016-07-12 09:13:23 +01:00 committed by GitHub
commit 873aa670d1
2 changed files with 9 additions and 9 deletions

View File

@ -1,4 +1,4 @@
origin-setup-ruby-path() { original-setup-ruby-path() {
if [[ -z "$HOMEBREW_DEVELOPER" ]] if [[ -z "$HOMEBREW_DEVELOPER" ]]
then then
unset HOMEBREW_RUBY_PATH unset HOMEBREW_RUBY_PATH
@ -22,9 +22,9 @@ origin-setup-ruby-path() {
} }
setup-ruby-path() { setup-ruby-path() {
if [[ -z "$HOMEBREW_USE_VENDOR_RUBY" ]] if [[ -z "$HOMEBREW_USE_VENDOR_RUBY" && -z "$HOMEBREW_FORCE_VENDOR_RUBY" ]]
then then
origin-setup-ruby-path original-setup-ruby-path
return return
fi fi
@ -70,7 +70,7 @@ setup-ruby-path() {
ruby_version_major="${ruby_version_major%%.*}" ruby_version_major="${ruby_version_major%%.*}"
fi fi
if [[ "$ruby_version_major" != "2" ]] if [[ "$ruby_version_major" != "2" || -n "$HOMEBREW_FORCE_VENDOR_RUBY" ]]
then then
brew vendor-install ruby --quiet brew vendor-install ruby --quiet
if [[ ! -x "$vendor_ruby_path" ]] if [[ ! -x "$vendor_ruby_path" ]]

View File

@ -209,11 +209,6 @@ EOS
esac esac
fi fi
# Hide shellcheck complaint:
# shellcheck source=/dev/null
source "$HOMEBREW_LIBRARY/Homebrew/utils/ruby.sh"
setup-ruby-path
# Hide shellcheck complaint: # Hide shellcheck complaint:
# shellcheck source=/dev/null # shellcheck source=/dev/null
source "$HOMEBREW_LIBRARY/Homebrew/utils/analytics.sh" source "$HOMEBREW_LIBRARY/Homebrew/utils/analytics.sh"
@ -243,6 +238,11 @@ then
source "$HOMEBREW_BASH_COMMAND" source "$HOMEBREW_BASH_COMMAND"
{ update-preinstall; "homebrew-$HOMEBREW_COMMAND" "$@"; exit $?; } { update-preinstall; "homebrew-$HOMEBREW_COMMAND" "$@"; exit $?; }
else else
# Hide shellcheck complaint:
# shellcheck source=/dev/null
source "$HOMEBREW_LIBRARY/Homebrew/utils/ruby.sh"
setup-ruby-path
# Unshift command back into argument list (unless argument list was empty). # Unshift command back into argument list (unless argument list was empty).
[[ "$HOMEBREW_ARG_COUNT" -gt 0 ]] && set -- "$HOMEBREW_COMMAND" "$@" [[ "$HOMEBREW_ARG_COUNT" -gt 0 ]] && set -- "$HOMEBREW_COMMAND" "$@"
{ update-preinstall; exec "$HOMEBREW_RUBY_PATH" -W0 "$HOMEBREW_LIBRARY/brew.rb" "$@"; } { update-preinstall; exec "$HOMEBREW_RUBY_PATH" -W0 "$HOMEBREW_LIBRARY/brew.rb" "$@"; }