Dependency#to_formula and associated helpers

This commit is contained in:
Jack Nagel 2013-01-23 00:26:24 -06:00
parent a569261a9b
commit e9e16fefa9
2 changed files with 8 additions and 4 deletions

View File

@ -169,6 +169,14 @@ class Dependency
def hash
name.hash
end
def to_formula
Formula.factory(name)
end
def requested?
ARGV.formulae.include?(to_formula) rescue false
end
end
# A base class for non-formula requirements needed by formulae.

View File

@ -77,10 +77,6 @@ class Formula
installed_prefix.children.length > 0 rescue false
end
def explicitly_requested?
ARGV.formulae.include?(self) rescue false
end
def linked_keg
HOMEBREW_REPOSITORY/'Library/LinkedKegs'/@name
end