Read all formula in a 'rescue' block.
For operations that read all formulae, catch exceptions and skip broken ones, rather than bomb out entirely.
This commit is contained in:
parent
9295f9c022
commit
ab9ccd7d89
@ -34,10 +34,15 @@ class Formulary
|
||||
def self.read_all
|
||||
# yields once for each
|
||||
Formulary.names.each do |name|
|
||||
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
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user