Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Vendored Ruby tweaks #494

Merged
merged 3 commits into from
Jul 12, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions Library/Homebrew/utils/ruby.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
origin-setup-ruby-path() {
original-setup-ruby-path() {
if [[ -z "$HOMEBREW_DEVELOPER" ]]
then
unset HOMEBREW_RUBY_PATH
Expand All @@ -22,9 +22,9 @@ origin-setup-ruby-path() {
}

setup-ruby-path() {
if [[ -z "$HOMEBREW_USE_VENDOR_RUBY" ]]
if [[ -z "$HOMEBREW_USE_VENDOR_RUBY" && -z "$HOMEBREW_FORCE_VENDOR_RUBY" ]]
then
origin-setup-ruby-path
original-setup-ruby-path
return
fi

Expand Down Expand Up @@ -70,7 +70,7 @@ setup-ruby-path() {
ruby_version_major="${ruby_version_major%%.*}"
fi

if [[ "$ruby_version_major" != "2" ]]
if [[ "$ruby_version_major" != "2" || -n "$HOMEBREW_FORCE_VENDOR_RUBY" ]]
then
brew vendor-install ruby --quiet
if [[ ! -x "$vendor_ruby_path" ]]
Expand Down
10 changes: 5 additions & 5 deletions Library/brew.sh
Original file line number Diff line number Diff line change
Expand Up @@ -209,11 +209,6 @@ EOS
esac
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"
Expand Down Expand Up @@ -243,6 +238,11 @@ then
source "$HOMEBREW_BASH_COMMAND"
{ update-preinstall; "homebrew-$HOMEBREW_COMMAND" "$@"; exit $?; }
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).
[[ "$HOMEBREW_ARG_COUNT" -gt 0 ]] && set -- "$HOMEBREW_COMMAND" "$@"
{ update-preinstall; exec "$HOMEBREW_RUBY_PATH" -W0 "$HOMEBREW_LIBRARY/brew.rb" "$@"; }
Expand Down