From efe905f7f677fd300d62cd76d3f906e7552f8e9b Mon Sep 17 00:00:00 2001 From: Alex Legler Date: Fri, 13 Jan 2017 15:14:25 +0100 Subject: Support --- lib/glsav1.rb | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/lib/glsav1.rb b/lib/glsav1.rb index d2c1692..9da61a2 100644 --- a/lib/glsav1.rb +++ b/lib/glsav1.rb @@ -11,8 +11,14 @@ class GLSAv1 @synopsis = text_content xml, '/glsa/synopsis/text()' @product = text_content xml, '/glsa/product/text()' @date = DateTime.parse(xml.xpath('/glsa/announced/text()').first.content) - @revised, - @revision = xml.xpath('/glsa/revised/text()').first.content.split(': ') + + if xml.xpath('/glsa/revised').first['count'].nil? + @revised, + @revision = xml.xpath('/glsa/revised/text()').first.content.split(': ') + else + @revised = xml.xpath('/glsa/revised/text()').first.content + @revision = xml.xpath('/glsa/revised').first['count'] + end @revised = DateTime.parse(@revised) @bugs = xml.xpath('/glsa/bug/text()').map { |bug_node| bug_node.content.to_i } -- cgit v1.2.3-65-gdbad