diff options
Diffstat (limited to 'lib/glsav1.rb')
-rw-r--r-- | lib/glsav1.rb | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/glsav1.rb b/lib/glsav1.rb index 789de2b..0ecea87 100644 --- a/lib/glsav1.rb +++ b/lib/glsav1.rb @@ -1,3 +1,5 @@ +require 'date' + # A version 1 GLSA class GLSAv1 attr_reader :id, :title, :synopsis, :product, :date, :revised, :revision, :bugs, :access, :packages, @@ -8,9 +10,10 @@ class GLSAv1 @title = xml.xpath('/glsa/title/text()').first.content @synopsis = xml.xpath('/glsa/synopsis/text()').first.content @product = xml.xpath('/glsa/product/text()').first.content - @date = xml.xpath('/glsa/announced/text()').first.content + @date = DateTime.parse(xml.xpath('/glsa/announced/text()').first.content) @revised, @revision = xml.xpath('/glsa/revised/text()').first.content.split(': ') + @revised = DateTime.parse(@revised) @bugs = xml.xpath('/glsa/bug/text()').map {|bug_node| bug_node.content.to_i } @access = xml.xpath('/glsa/access/text()').first.content |