Fix Formula.installed?

This commit is contained in:
Max Howell 2009-07-29 00:57:55 +01:00
parent 90c7029144
commit fc6e9e5bab

View File

@ -51,16 +51,15 @@ class AbstractFormula
end end
# end ruby is weird section # end ruby is weird section
def version attr_reader :version, :name
@version
end # reimplement if your package has dependencies
def name def deps
@name
end end
# if the dir is there, but it's empty we consider it not installed # if the dir is there, but it's empty we consider it not installed
def installed? def installed?
return prefix.children.count > 0 return prefix.children.length > 0
rescue rescue
return false return false
end end
@ -74,7 +73,6 @@ class AbstractFormula
# end ruby is weird section # end ruby is weird section
end end
public
def prefix def prefix
raise "@name.nil!" if @name.nil? raise "@name.nil!" if @name.nil?
raise "@version.nil?" if @version.nil? raise "@version.nil?" if @version.nil?