Move some exceptions
This commit is contained in:
parent
719e6c8999
commit
0225f07eba
@ -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
|
end
|
||||||
|
|
||||||
class FormulaUnavailableError < RuntimeError
|
class FormulaUnavailableError < RuntimeError
|
||||||
attr :name
|
attr :name
|
||||||
|
|
||||||
def initialize name
|
def initialize name
|
||||||
@name = name
|
@name = name
|
||||||
super "No available formula for #{name}"
|
super "No available formula for #{name}"
|
||||||
@ -13,6 +34,7 @@ end
|
|||||||
module Homebrew
|
module Homebrew
|
||||||
class InstallationError < RuntimeError
|
class InstallationError < RuntimeError
|
||||||
attr :formula
|
attr :formula
|
||||||
|
|
||||||
def initialize formula
|
def initialize formula
|
||||||
@formula = formula
|
@formula = formula
|
||||||
end
|
end
|
||||||
|
@ -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
|
module HomebrewArgvExtension
|
||||||
def named
|
def named
|
||||||
@named ||= reject{|arg| arg[0..0] == '-'}
|
@named ||= reject{|arg| arg[0..0] == '-'}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user