lib/pdd.rb in pdd-0.5.2 vs lib/pdd.rb in pdd-0.6
- old
+ new
@@ -121,10 +121,10 @@
def sanitize(xml)
xsd = Nokogiri::XML::Schema(
File.read(File.join(File.dirname(__FILE__), '../assets/puzzles.xsd'))
)
- errors = xsd.validate(Nokogiri::XML(xml)).map { |error| error.message }
+ errors = xsd.validate(Nokogiri::XML(xml)).map(&:message)
errors.each { |e| PDD.log.error e }
PDD.log.error(xml) unless errors.empty?
fail SchemaError, errors.join('; ') unless errors.empty?
xml
end