Don't allow Keg.new for empty kegs

Kegs have to exist to be created.
This commit is contained in:
Max Howell 2009-07-31 01:18:03 +01:00
parent 4ac760779e
commit 6d64eb28d5

View File

@ -29,7 +29,9 @@ class Keg
elsif formula.is_a? Pathname
# TODO
elsif formula.is_a? String
kids=($cellar+formula).children
path=$cellar+formula
kids=path.children
raise "Empty installation: #{path}" if kids.length < 1
raise "Multiple versions installed" if kids.length > 1
@path=kids[0]
@name=formula