diff options
| author | Xu Cheng | 2015-05-08 19:16:06 +0800 |
|---|---|---|
| committer | Xu Cheng | 2015-05-27 13:53:40 +0800 |
| commit | 811c4c5add5048e2e67814045e6d5fbb7820ddcb (patch) | |
| tree | 6e4c866b1f11a788c0988e7402d9d223c24e2bb3 /Library/Homebrew/exceptions.rb | |
| parent | 3a3a49bd93ee3a5a39019bb972a2a851ba2ab2f6 (diff) | |
| download | brew-811c4c5add5048e2e67814045e6d5fbb7820ddcb.tar.bz2 | |
load tap formula through direct search
Diffstat (limited to 'Library/Homebrew/exceptions.rb')
| -rw-r--r-- | Library/Homebrew/exceptions.rb | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/Library/Homebrew/exceptions.rb b/Library/Homebrew/exceptions.rb index 663236cba..28a97bc82 100644 --- a/Library/Homebrew/exceptions.rb +++ b/Library/Homebrew/exceptions.rb @@ -65,6 +65,25 @@ class TapFormulaUnavailableError < FormulaUnavailableError end end +class TapFormulaAmbiguityError < RuntimeError + attr_reader :name, :paths, :formulae + + def initialize name, paths + @name = name + @paths = paths + @formulae = paths.map do |path| + path.to_s =~ HOMEBREW_TAP_PATH_REGEX + "#{$1}/#{$2.sub("homebrew-", "")}/#{path.basename(".rb")}" + end + + super <<-EOS.undent + Formulae found in multiple taps: #{formulae.map { |f| "\n * #{f}" }.join} + + Please use the fully-qualified name e.g. #{formulae.first} to refer the formula. + EOS + end +end + class OperationInProgressError < RuntimeError def initialize name message = <<-EOS.undent |
