Merge pull request #513 from MikeMcQuaid/enable-vendor-ruby

Enable vendored Ruby 2.0.
This commit is contained in:
Mike McQuaid 2016-08-16 10:16:49 +01:00 committed by GitHub
commit 8a24d5f942
6 changed files with 16 additions and 31 deletions

View File

@ -8,6 +8,7 @@ source "$HOMEBREW_LIBRARY/Homebrew/utils/lock.sh"
VENDOR_DIR="$HOMEBREW_LIBRARY/Homebrew/vendor" VENDOR_DIR="$HOMEBREW_LIBRARY/Homebrew/vendor"
# Built from https://github.com/Homebrew/homebrew-portable.
if [[ -n "$HOMEBREW_OSX" ]] if [[ -n "$HOMEBREW_OSX" ]]
then then
if [[ "$HOMEBREW_PROCESSOR" = "Intel" ]] if [[ "$HOMEBREW_PROCESSOR" = "Intel" ]]
@ -185,7 +186,10 @@ homebrew-vendor-install() {
if [[ -z "$VENDOR_URL" || -z "$VENDOR_SHA" ]] if [[ -z "$VENDOR_URL" || -z "$VENDOR_SHA" ]]
then then
odie "Cannot find a vendored version of $VENDOR_NAME." odie <<-EOS
Cannot find a vendored version of $VENDOR_NAME for your $HOMEBREW_PROCESSOR
processor on $HOMEBREW_PRODUCT!
EOS
fi fi
VENDOR_VERSION="$(<"$VENDOR_DIR/portable-$VENDOR_NAME-version")" VENDOR_VERSION="$(<"$VENDOR_DIR/portable-$VENDOR_NAME-version")"

View File

@ -156,6 +156,10 @@ can take several different forms:
directories. TextMate can handle this correctly in project mode, but many directories. TextMate can handle this correctly in project mode, but many
editors will do strange things in this case. editors will do strange things in this case.
* `HOMEBREW_FORCE_VENDOR_RUBY`:
If set, Homebrew will always use its vendored, relocatable Ruby 2.0 version
even if the system version of Ruby is >=2.0.
* `HOMEBREW_GITHUB_API_TOKEN`: * `HOMEBREW_GITHUB_API_TOKEN`:
A personal access token for the GitHub API, which you can create at A personal access token for the GitHub API, which you can create at
<https://github.com/settings/tokens>. If set, GitHub will allow you a <https://github.com/settings/tokens>. If set, GitHub will allow you a

View File

@ -1,33 +1,4 @@
original-setup-ruby-path() {
if [[ -z "$HOMEBREW_DEVELOPER" ]]
then
unset HOMEBREW_RUBY_PATH
fi
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
export HOMEBREW_RUBY_PATH
}
setup-ruby-path() { setup-ruby-path() {
if [[ -z "$HOMEBREW_USE_VENDOR_RUBY" && -z "$HOMEBREW_FORCE_VENDOR_RUBY" ]]
then
original-setup-ruby-path
return
fi
local vendor_dir local vendor_dir
local vendor_ruby_current_version local vendor_ruby_current_version
local vendor_ruby_path local vendor_ruby_path

View File

@ -38,7 +38,7 @@ invalid multibyte escape: /^\037\235/
In the past, Homebrew assumed that `/usr/bin/ruby` was Ruby 1.8. On OS X 10.9, it is now Ruby 2.0. There are various incompatibilities between the two versions, so if you upgrade to OS X 10.9 while using a sufficiently old version of Homebrew, you will encounter errors. In the past, Homebrew assumed that `/usr/bin/ruby` was Ruby 1.8. On OS X 10.9, it is now Ruby 2.0. There are various incompatibilities between the two versions, so if you upgrade to OS X 10.9 while using a sufficiently old version of Homebrew, you will encounter errors.
The incompatibilities have been addressed in more recent versions of Homebrew, and it does not make assumptions about `/usr/bin/ruby`, instead it uses the executable inside OS X's Ruby 1.8 framework. The incompatibilities have been addressed in more recent versions of Homebrew, and it does not make assumptions about `/usr/bin/ruby`, instead it uses the executable inside OS X's Ruby framework or a vendored Ruby.
To recover from this situation, do the following: To recover from this situation, do the following:

View File

@ -561,6 +561,8 @@ several formulae in the same directory.</p>
<p><em>Note:</em> <code>brew edit</code> will open all of Homebrew as discontinuous files and <p><em>Note:</em> <code>brew edit</code> will open all of Homebrew as discontinuous files and
directories. TextMate can handle this correctly in project mode, but many directories. TextMate can handle this correctly in project mode, but many
editors will do strange things in this case.</p></dd> editors will do strange things in this case.</p></dd>
<dt><code>HOMEBREW_FORCE_VENDOR_RUBY</code></dt><dd><p>If set, Homebrew will always use its vendored, relocatable Ruby 2.0 version
even if the system version of Ruby is >=2.0.</p></dd>
<dt><code>HOMEBREW_GITHUB_API_TOKEN</code></dt><dd><p>A personal access token for the GitHub API, which you can create at <dt><code>HOMEBREW_GITHUB_API_TOKEN</code></dt><dd><p>A personal access token for the GitHub API, which you can create at
<a href="https://github.com/settings/tokens" data-bare-link="true">https://github.com/settings/tokens</a>. If set, GitHub will allow you a <a href="https://github.com/settings/tokens" data-bare-link="true">https://github.com/settings/tokens</a>. If set, GitHub will allow you a
greater number of API requests. See greater number of API requests. See

View File

@ -771,6 +771,10 @@ If set, Homebrew will use this editor when editing a single formula, or several
\fINote:\fR \fBbrew edit\fR will open all of Homebrew as discontinuous files and directories\. TextMate can handle this correctly in project mode, but many editors will do strange things in this case\. \fINote:\fR \fBbrew edit\fR will open all of Homebrew as discontinuous files and directories\. TextMate can handle this correctly in project mode, but many editors will do strange things in this case\.
. .
.TP .TP
\fBHOMEBREW_FORCE_VENDOR_RUBY\fR
If set, Homebrew will always use its vendored, relocatable Ruby 2\.0 version even if the system version of Ruby is >=2\.0\.
.
.TP
\fBHOMEBREW_GITHUB_API_TOKEN\fR \fBHOMEBREW_GITHUB_API_TOKEN\fR
A personal access token for the GitHub API, which you can create at \fIhttps://github\.com/settings/tokens\fR\. If set, GitHub will allow you a greater number of API requests\. See \fIhttps://developer\.github\.com/v3/#rate\-limiting\fR for more information\. Homebrew uses the GitHub API for features such as \fBbrew search\fR\. A personal access token for the GitHub API, which you can create at \fIhttps://github\.com/settings/tokens\fR\. If set, GitHub will allow you a greater number of API requests\. See \fIhttps://developer\.github\.com/v3/#rate\-limiting\fR for more information\. Homebrew uses the GitHub API for features such as \fBbrew search\fR\.
. .