Skip to content
Snippets Groups Projects
Commit 8e944d57 authored by Adam Vandenberg's avatar Adam Vandenberg
Browse files

Add 'unload'

parent 5c27f0cc
No related branches found
No related tags found
No related merge requests found
......@@ -87,7 +87,7 @@ class Formula
# Unload the class so Formula#version returns the correct value
begin
Object.send(:remove_const, Formula.class_s(name))
Formulary.unload_formula name
nostdout { Formula.factory(path).version }
rescue *IGNORED_EXCEPTIONS => e
# We rescue these so that we can skip bad versions and
......
# The Formulary is responsible for creating instances of Formula.
class Formulary
def self.unload_formula formula_name
Object.send(:remove_const, Formula.class_s(formula_name))
end
def self.formula_class_defined? formula_name
Object.const_defined?(Formula.class_s(formula_name))
end
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment