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

Read all formula in a 'rescue' block.

For operations that read all formulae, catch exceptions and
skip broken ones, rather than bomb out entirely.
parent 9295f9c0
No related branches found
No related tags found
No related merge requests found
......@@ -34,10 +34,15 @@ class Formulary
def self.read_all
# yields once for each
Formulary.names.each do |name|
require Formula.path(name)
klass_name = Formula.class_s(name)
klass = eval(klass_name)
yield name, klass
begin
require Formula.path(name)
klass_name = Formula.class_s(name)
klass = eval(klass_name)
yield name, klass
rescue Exception=>e
opoo "Error importing #{name}:"
puts "#{e}"
end
end
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