versions: unload old class before obtaining version

This is silly, but I am no Rubyist and I don't have time to
figure out why Formula.factory(foo).url works as expected but
Formula.factory(foo).version does not.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
This commit is contained in:
Jack Nagel 2012-01-06 22:00:38 -06:00
parent f3f04e595d
commit 5bfd8faf90

View File

@ -62,6 +62,8 @@ class Formula
mktemp do
path = Pathname.new(Pathname.pwd+"#{name}.rb")
path.write text_from_sha(sha)
# FIXME: shouldn't have to do this?
Object.send(:remove_const, "#{name.capitalize}")
Formula.factory(path).version
end rescue nil
end