def self.check(filename)
@@warnings = 0
@filename = filename
@svg = Document.new(File.new("#{filename}", 'r'))
puts "Checking document metadata..."
if Icon.check_document_metadata(@svg, @filename)
puts "Done."
else
raise "Failed. Check above messages for more info."
end
puts "Checking plate layer..."
if Icon.check_layer_plate(@svg)
puts "Done."
else
raise "Failed. Check above messages for more info."
end
puts "Checking artwork layer..."
if Icon.check_layer_artwork(@svg)
puts "Done."
else
raise "Failed. Check above messages for more info."
end
puts "\nCheck complete. No fatal errors found."
if @@warnings > 0
if @@warnings == 1
puts "There was #{@@warnings} warning."
else
puts "There were #{@@warnings} warnings."
end
end
end