diff options
Diffstat (limited to 'Library/Homebrew')
| -rw-r--r-- | Library/Homebrew/exceptions.rb | 24 | ||||
| -rw-r--r-- | Library/Homebrew/extend/ARGV.rb | 22 |
2 files changed, 23 insertions, 23 deletions
diff --git a/Library/Homebrew/exceptions.rb b/Library/Homebrew/exceptions.rb index 73cda01e5..66ae2b294 100644 --- a/Library/Homebrew/exceptions.rb +++ b/Library/Homebrew/exceptions.rb @@ -1,9 +1,30 @@ +class UsageError <RuntimeError; end +class FormulaUnspecifiedError <UsageError; end +class KegUnspecifiedError <UsageError; end -class NotAKegError < RuntimeError +class MultipleVersionsInstalledError <RuntimeError + attr :name + + def initialize name + @name = name + super "#{name} has multiple installed versions" + end +end + +class NotAKegError < RuntimeError; end + +class NoSuchKegError <RuntimeError + attr :name + + def initialize name + @name = name + super "No such keg: #{HOMEBREW_CELLAR}/#{name}" + end end class FormulaUnavailableError < RuntimeError attr :name + def initialize name @name = name super "No available formula for #{name}" @@ -13,6 +34,7 @@ end module Homebrew class InstallationError < RuntimeError attr :formula + def initialize formula @formula = formula end diff --git a/Library/Homebrew/extend/ARGV.rb b/Library/Homebrew/extend/ARGV.rb index f6baaf90d..76776c94c 100644 --- a/Library/Homebrew/extend/ARGV.rb +++ b/Library/Homebrew/extend/ARGV.rb @@ -1,25 +1,3 @@ -class UsageError <RuntimeError; end -class FormulaUnspecifiedError <UsageError; end -class KegUnspecifiedError <UsageError; end - -class MultipleVersionsInstalledError <RuntimeError - attr :name - - def initialize name - @name = name - super "#{name} has multiple installed versions" - end -end - -class NoSuchKegError <RuntimeError - attr :name - - def initialize name - @name = name - super "No such keg: #{HOMEBREW_CELLAR}/#{name}" - end -end - module HomebrewArgvExtension def named @named ||= reject{|arg| arg[0..0] == '-'} |
