aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/cmd
diff options
context:
space:
mode:
authorMarkus Reiter2016-09-17 03:21:51 +0200
committerMarkus Reiter2016-10-01 20:00:49 +0200
commit884b26850615d5624e09762e1ae8bc5b104a934a (patch)
tree310fc74849e3b15b940bd7f57b67c323120a771a /Library/Homebrew/cmd
parent75e8b59aad4814112a53119f68ed629d60b3f97b (diff)
downloadbrew-884b26850615d5624e09762e1ae8bc5b104a934a.tar.bz2
Use Formatter for all URLs.
Diffstat (limited to 'Library/Homebrew/cmd')
-rw-r--r--Library/Homebrew/cmd/help.rb11
-rw-r--r--Library/Homebrew/cmd/update-report.rb2
2 files changed, 7 insertions, 6 deletions
diff --git a/Library/Homebrew/cmd/help.rb b/Library/Homebrew/cmd/help.rb
index 05a3003cc..c8845b086 100644
--- a/Library/Homebrew/cmd/help.rb
+++ b/Library/Homebrew/cmd/help.rb
@@ -78,11 +78,12 @@ module Homebrew
HOMEBREW_HELP
else
help_lines.map do |line|
- line.slice(2..-1).
- sub(/^ \* /, "#{Tty.bold}brew#{Tty.reset} ").
- gsub(/`(.*?)`/, "#{Tty.bold}\\1#{Tty.reset}").
- gsub(/<(.*?)>/, "#{Tty.underline}\\1#{Tty.reset}").
- gsub("@hide_from_man_page", "")
+ line.slice(2..-1)
+ .sub(/^ \* /, "#{Tty.bold}brew#{Tty.reset} ")
+ .gsub(/`(.*?)`/, "#{Tty.bold}\\1#{Tty.reset}")
+ .gsub(%r{<([^\s]+?://[^\s]+?)>}) { |url| Formatter.url(url) }
+ .gsub(/<(.*?)>/, "#{Tty.underline}\\1#{Tty.reset}")
+ .gsub("@hide_from_man_page", "")
end.join.strip
end
end
diff --git a/Library/Homebrew/cmd/update-report.rb b/Library/Homebrew/cmd/update-report.rb
index c275606e2..f97191bda 100644
--- a/Library/Homebrew/cmd/update-report.rb
+++ b/Library/Homebrew/cmd/update-report.rb
@@ -288,7 +288,7 @@ module Homebrew
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
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
$stderr.puts e.backtrace
end