versions: unload constant before calling Formula.factory

Closes Homebrew/homebrew#18634.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
This commit is contained in:
Russell Teabeault 2013-03-21 09:28:40 -06:00 committed by Jack Nagel
parent c6b0b563e8
commit ad622a9e87

View File

@ -68,8 +68,8 @@ class Formula
# Unload the class so Formula#version returns the correct value
begin
version = nostdout { Formula.factory(path).version }
Object.send(:remove_const, Formula.class_s(name))
version = nostdout { Formula.factory(path).version }
version
rescue SyntaxError, TypeError, NameError, ArgumentError
# We rescue these so that we can skip bad versions and