def initialize(filename,opts={})
@symlinks_initialized = false
@filename = filename
@svg = Document.new(File.new("#{filename}", 'r'))
@@warnings = 0
unless opts[:skip_check]
if !Icon.check_document_metadata(@svg, @filename)
raise "Failed. Check above messages for more info."
end
if !Icon.check_layer_plate(@svg)
raise "Failed. Check above messages for more info."
end
if !Icon.check_layer_artwork(@svg)
raise "Failed. Check above messages for more info."
end
end
@iconname = @svg.root.elements['//dc:title'].text
@context = @svg.root.elements['//dc:description'].text
puts "Icon #{@filename} loaded successfully."
if @@warnings > 0
if @@warnings == 1
puts "There was #{@@warnings} warning during icon load."
else
puts "There were #{@@warnings} warnings during icon load."
end
end
end