diff options
-rw-r--r-- | lib/glsav1.rb | 10 |
1 files 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 } |