From 483d41c7efbc3fa6281de3f983627e6751f6b6fa Mon Sep 17 00:00:00 2001 From: Jack Nagel Date: Fri, 6 Jan 2012 22:00:38 -0600 Subject: 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 --- Library/Homebrew/cmd/versions.rb | 2 ++ 1 file changed, 2 insertions(+) (limited to 'Library') diff --git a/Library/Homebrew/cmd/versions.rb b/Library/Homebrew/cmd/versions.rb index 906fc4f8c..696282545 100644 --- a/Library/Homebrew/cmd/versions.rb +++ b/Library/Homebrew/cmd/versions.rb @@ -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 -- cgit v1.2.3