*/diagnostic: tweak messaging.

Update some messaging based on recent user confusion and the
`/usr/local/Homebrew` and Ruby 2 migrations.
This commit is contained in:
Mike McQuaid 2016-10-02 17:30:08 +01:00
parent 4f916cdfee
commit 8a57fee68c
3 changed files with 10 additions and 11 deletions

View File

@ -389,10 +389,10 @@ module Homebrew
return if HOMEBREW_PREFIX.to_s == "/usr/local" return if HOMEBREW_PREFIX.to_s == "/usr/local"
<<-EOS.undent <<-EOS.undent
Your Homebrew is not installed to /usr/local Your Homebrew's prefix is not /usr/local.
You can install Homebrew anywhere you want but some bottles (binary You can install Homebrew anywhere you want but some bottles (binary packages)
packages) can only be used in /usr/local and some formulae (packages) can only be used with a /usr/local prefix and some formulae (packages)
may not build correctly unless you install in /usr/local. Sorry! may not build correctly with a non-/usr/local prefix.
EOS EOS
end end

View File

@ -65,8 +65,8 @@ module Homebrew
return unless MacOS::Xcode.installed? && MacOS::Xcode.outdated? return unless MacOS::Xcode.installed? && MacOS::Xcode.outdated?
message = <<-EOS.undent message = <<-EOS.undent
Your Xcode (#{MacOS::Xcode.version}) is outdated Your Xcode (#{MacOS::Xcode.version}) is outdated.
Please update to Xcode #{MacOS::Xcode.latest_version}. Please update to Xcode #{MacOS::Xcode.latest_version} (or delete it).
#{MacOS::Xcode.update_instructions} #{MacOS::Xcode.update_instructions}
EOS EOS
@ -171,8 +171,7 @@ module Homebrew
end end
def check_ruby_version def check_ruby_version
ruby_version = MacOS.version >= "10.9" ? "2.0" : "1.8" return if RUBY_VERSION[/\d\.\d/] == "2.0"
return if RUBY_VERSION[/\d\.\d/] == ruby_version
<<-EOS.undent <<-EOS.undent
Ruby version #{RUBY_VERSION} is unsupported on #{MacOS.version}. Homebrew Ruby version #{RUBY_VERSION} is unsupported on #{MacOS.version}. Homebrew
@ -264,8 +263,8 @@ module Homebrew
return if installed_version >= latest_version return if installed_version >= latest_version
<<-EOS.undent <<-EOS.undent
Your XQuartz (#{installed_version}) is outdated Your XQuartz (#{installed_version}) is outdated.
Please install XQuartz #{latest_version}: Please install XQuartz #{latest_version} (or delete it):
https://xquartz.macosforge.org https://xquartz.macosforge.org
EOS EOS
end end

View File

@ -85,7 +85,7 @@ class DiagnosticChecksTest < Homebrew::TestCase
def test_check_homebrew_prefix def test_check_homebrew_prefix
# the integration tests are run in a special prefix # the integration tests are run in a special prefix
assert_match "Your Homebrew is not installed to /usr/local", assert_match "Your Homebrew's prefix is not /usr/local.",
@checks.check_homebrew_prefix @checks.check_homebrew_prefix
end end