aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/utils.rb
diff options
context:
space:
mode:
authorMike McQuaid2016-07-31 19:12:04 +0100
committerMike McQuaid2016-07-31 19:22:12 +0100
commit7a00f03c92607f65336be0285584e8351ad8a73a (patch)
treed32890c80b25a3150c9059cde1231b8a45132c19 /Library/Homebrew/utils.rb
parent3e5ccaf3d2761697a67260bb1ad50be922afe57c (diff)
downloadbrew-7a00f03c92607f65336be0285584e8351ad8a73a.tar.bz2
utils: tell people to report deprecations to tap.
This should hopefully avoid Homebrew/brew or Homebrew/homebrew-core having these exceptions reported to us.
Diffstat (limited to 'Library/Homebrew/utils.rb')
-rw-r--r--Library/Homebrew/utils.rb9
1 files changed, 7 insertions, 2 deletions
diff --git a/Library/Homebrew/utils.rb b/Library/Homebrew/utils.rb
index 1c4be7047..4e8da3c24 100644
--- a/Library/Homebrew/utils.rb
+++ b/Library/Homebrew/utils.rb
@@ -130,8 +130,13 @@ def odeprecated(method, replacement = nil, options = {})
# - Location outside of 'compat/'.
# - Location of caller of deprecated method (if all else fails).
backtrace = options.fetch(:caller, caller)
+ tap_message = nil
caller_message = backtrace.detect do |line|
- line.start_with?("#{HOMEBREW_LIBRARY}/Taps/")
+ if line =~ %r{^#{Regexp.escape HOMEBREW_LIBRARY}/Taps/([^/]+/[^/]+)/}
+ tap = Tap.fetch $1
+ tap_message = "\nPlease report this to the #{tap} tap!"
+ true
+ end
end
caller_message ||= backtrace.detect do |line|
!line.start_with?("#{HOMEBREW_LIBRARY_PATH}/compat/")
@@ -141,7 +146,7 @@ def odeprecated(method, replacement = nil, options = {})
message = <<-EOS.undent
Calling #{method} is #{verb}!
#{replacement_message}
- #{caller_message}
+ #{caller_message}#{tap_message}
EOS
if ARGV.homebrew_developer? || options[:die]