Use Formatter for all URLs.

This commit is contained in:
Markus Reiter 2016-09-17 03:21:51 +02:00
parent 75e8b59aad
commit 884b268506
8 changed files with 26 additions and 25 deletions

View File

@ -16,7 +16,7 @@ def blacklisted?(name)
Homebrew provides pip via: `brew install python`. However you will then Homebrew provides pip via: `brew install python`. However you will then
have two Pythons installed on your Mac, so alternatively you can install have two Pythons installed on your Mac, so alternatively you can install
pip via the instructions at: pip via the instructions at:
https://pip.readthedocs.io/en/stable/installing/ #{Formatter.url("https://pip.readthedocs.io/en/stable/installing/")}
EOS EOS
when "pil" then <<-EOS.undent when "pil" then <<-EOS.undent
Instead of PIL, consider `pip install pillow` or `brew install Homebrew/python/pillow`. Instead of PIL, consider `pip install pillow` or `brew install Homebrew/python/pillow`.
@ -24,7 +24,7 @@ def blacklisted?(name)
when "macruby" then <<-EOS.undent when "macruby" then <<-EOS.undent
MacRuby is not packaged and is on an indefinite development hiatus. MacRuby is not packaged and is on an indefinite development hiatus.
You can read more about it at: You can read more about it at:
https://github.com/MacRuby/MacRuby #{Formatter.url("https://github.com/MacRuby/MacRuby")}
EOS EOS
when /(lib)?lzma/ when /(lib)?lzma/
"lzma is now part of the xz formula." "lzma is now part of the xz formula."
@ -50,7 +50,7 @@ def blacklisted?(name)
To install Clojure you should install Leiningen: To install Clojure you should install Leiningen:
brew install leiningen brew install leiningen
and then follow the tutorial: and then follow the tutorial:
https://github.com/technomancy/leiningen/blob/stable/doc/TUTORIAL.md #{Formatter.url("https://github.com/technomancy/leiningen/blob/stable/doc/TUTORIAL.md")}
EOS EOS
when "osmium" then <<-EOS.undent when "osmium" then <<-EOS.undent
The creator of Osmium requests that it not be packaged and that people The creator of Osmium requests that it not be packaged and that people
@ -65,8 +65,8 @@ def blacklisted?(name)
brew install typesafe-activator brew install typesafe-activator
You can read more about this change at: You can read more about this change at:
https://www.playframework.com/documentation/2.3.x/Migration23 #{Formatter.url("https://www.playframework.com/documentation/2.3.x/Migration23")}
https://www.playframework.com/documentation/2.3.x/Highlights23 #{Formatter.url("https://www.playframework.com/documentation/2.3.x/Highlights23")}
EOS EOS
when "haskell-platform" then <<-EOS.undent when "haskell-platform" then <<-EOS.undent
We no longer package haskell-platform. Consider installing ghc We no longer package haskell-platform. Consider installing ghc

View File

@ -102,12 +102,12 @@ module Hbc
A report has been made to Apple about this app. Their certificate will hopefully be revoked. A report has been made to Apple about this app. Their certificate will hopefully be revoked.
See the public report at See the public report at
https://openradar.appspot.com/#{radar_number} #{Formatter.url("https://openradar.appspot.com/#{radar_number}")}
If this report is accurate, please duplicate it at If this report is accurate, please duplicate it at
https://bugreport.apple.com/ #{Formatter.url("https://bugreport.apple.com/")}
If this report is a mistake, please let us know by opening an issue at If this report is a mistake, please let us know by opening an issue at
https://github.com/caskroom/homebrew-cask/issues/new #{Formatter.url("https://github.com/caskroom/homebrew-cask/issues/new")}
EOS EOS
end end

View File

@ -78,11 +78,12 @@ module Homebrew
HOMEBREW_HELP HOMEBREW_HELP
else else
help_lines.map do |line| help_lines.map do |line|
line.slice(2..-1). line.slice(2..-1)
sub(/^ \* /, "#{Tty.bold}brew#{Tty.reset} "). .sub(/^ \* /, "#{Tty.bold}brew#{Tty.reset} ")
gsub(/`(.*?)`/, "#{Tty.bold}\\1#{Tty.reset}"). .gsub(/`(.*?)`/, "#{Tty.bold}\\1#{Tty.reset}")
gsub(/<(.*?)>/, "#{Tty.underline}\\1#{Tty.reset}"). .gsub(%r{<([^\s]+?://[^\s]+?)>}) { |url| Formatter.url(url) }
gsub("@hide_from_man_page", "") .gsub(/<(.*?)>/, "#{Tty.underline}\\1#{Tty.reset}")
.gsub("@hide_from_man_page", "")
end.join.strip end.join.strip
end end
end end

View File

@ -288,7 +288,7 @@ module Homebrew
Please try to resolve this error yourself and then run `brew update` again to Please try to resolve this error yourself and then run `brew update` again to
complete the migration. If you need help please +1 an existing error or comment complete the migration. If you need help please +1 an existing error or comment
with your new error in issue: with your new error in issue:
#{Tty.em}https://github.com/Homebrew/brew/issues/987#{Tty.reset} #{Formatter.url("https://github.com/Homebrew/brew/issues/987")}
EOS EOS
$stderr.puts e.backtrace $stderr.puts e.backtrace
end end

View File

@ -473,7 +473,7 @@ module Homebrew
If you have trouble downloading packages with Homebrew, then maybe this If you have trouble downloading packages with Homebrew, then maybe this
is the problem? If the following command doesn't work, then try removing is the problem? If the following command doesn't work, then try removing
your curlrc: your curlrc:
curl https://github.com curl #{Formatter.url("https://github.com")}
EOS EOS
end end
@ -610,7 +610,7 @@ module Homebrew
Setting DYLD_INSERT_LIBRARIES can cause Go builds to fail. Setting DYLD_INSERT_LIBRARIES can cause Go builds to fail.
Having this set is common if you use this software: Having this set is common if you use this software:
http://asepsis.binaryage.com/ #{Formatter.url("http://asepsis.binaryage.com/")}
EOS EOS
end end
@ -752,7 +752,7 @@ module Homebrew
Without a correctly configured origin, Homebrew won't update Without a correctly configured origin, Homebrew won't update
properly. You can solve this by adding the Homebrew remote: properly. You can solve this by adding the Homebrew remote:
cd #{HOMEBREW_REPOSITORY} cd #{HOMEBREW_REPOSITORY}
git remote add origin https://github.com/Homebrew/brew.git git remote add origin #{Formatter.url("https://github.com/Homebrew/brew.git")}
EOS EOS
elsif origin !~ %r{Homebrew/brew(\.git)?$} elsif origin !~ %r{Homebrew/brew(\.git)?$}
<<-EOS.undent <<-EOS.undent
@ -764,7 +764,7 @@ module Homebrew
Unless you have compelling reasons, consider setting the Unless you have compelling reasons, consider setting the
origin remote to point at the main repository, located at: origin remote to point at the main repository, located at:
https://github.com/Homebrew/brew.git #{Formatter.url("https://github.com/Homebrew/brew.git")}
EOS EOS
end end
end end
@ -956,8 +956,8 @@ module Homebrew
<<-EOS.undent <<-EOS.undent
A .pydistutils.cfg file was found in $HOME, which may cause Python A .pydistutils.cfg file was found in $HOME, which may cause Python
builds to fail. See: builds to fail. See:
https://bugs.python.org/issue6138 #{Formatter.url("https://bugs.python.org/issue6138")}
https://bugs.python.org/issue4655 #{Formatter.url("https://bugs.python.org/issue4655")}
EOS EOS
end end

View File

@ -318,7 +318,7 @@ class BuildError < RuntimeError
def dump def dump
if !ARGV.verbose? if !ARGV.verbose?
puts puts
puts Formatter.error("READ THIS: #{Formatter.url(OS::ISSUES_URL)}") puts Formatter.error(Formatter.url(OS::ISSUES_URL), label: "READ THIS")
if formula.tap if formula.tap
case formula.tap.name case formula.tap.name
when "homebrew/boneyard" when "homebrew/boneyard"
@ -327,7 +327,7 @@ class BuildError < RuntimeError
else else
if issues_url = formula.tap.issues_url if issues_url = formula.tap.issues_url
puts "If reporting this issue please do so at (not Homebrew/brew):" puts "If reporting this issue please do so at (not Homebrew/brew):"
puts " #{issues_url}" puts " #{Formatter.url(issues_url)}"
end end
end end
end end

View File

@ -44,7 +44,7 @@ class XcodeRequirement < Requirement
EOS EOS
else else
message + <<-EOS.undent message + <<-EOS.undent
Xcode can be installed from https://developer.apple.com/xcode/downloads/ Xcode can be installed from #{Formatter.url("https://developer.apple.com/xcode/downloads/")}
EOS EOS
end end
end end

View File

@ -106,14 +106,14 @@ module GitHub
onoe <<-EOS.undent onoe <<-EOS.undent
Your macOS keychain GitHub credentials do not have sufficient scope! Your macOS keychain GitHub credentials do not have sufficient scope!
Scopes they have: #{credentials_scopes} Scopes they have: #{credentials_scopes}
Create a personal access token: https://github.com/settings/tokens Create a personal access token: #{Formatter.url("https://github.com/settings/tokens")}
and then set HOMEBREW_GITHUB_API_TOKEN as the authentication method instead. and then set HOMEBREW_GITHUB_API_TOKEN as the authentication method instead.
EOS EOS
when :environment when :environment
onoe <<-EOS.undent onoe <<-EOS.undent
Your HOMEBREW_GITHUB_API_TOKEN does not have sufficient scope! Your HOMEBREW_GITHUB_API_TOKEN does not have sufficient scope!
Scopes it has: #{credentials_scopes} Scopes it has: #{credentials_scopes}
Create a new personal access token: https://github.com/settings/tokens Create a new personal access token: #{Formatter.url("https://github.com/settings/tokens")}
and then set the new HOMEBREW_GITHUB_API_TOKEN as the authentication method instead. and then set the new HOMEBREW_GITHUB_API_TOKEN as the authentication method instead.
EOS EOS
end end