diff options
author | Alex Legler <alex@a3li.li> | 2015-12-25 17:16:14 +0100 |
---|---|---|
committer | Alex Legler <alex@a3li.li> | 2015-12-25 17:16:14 +0100 |
commit | f02847608d9dbde44947588286c8c0cc01237a87 (patch) | |
tree | dc066280f8adfc35c9ef06633d1c7bb79efee6d1 /lib/glsa_repository.rb | |
parent | Make parsing more resilient to weird advisories (diff) | |
download | security-f02847608d9dbde44947588286c8c0cc01237a87.tar.gz security-f02847608d9dbde44947588286c8c0cc01237a87.tar.bz2 security-f02847608d9dbde44947588286c8c0cc01237a87.zip |
Ruby style settings and fixes
Diffstat (limited to 'lib/glsa_repository.rb')
-rw-r--r-- | lib/glsa_repository.rb | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/glsa_repository.rb b/lib/glsa_repository.rb index 9fe571a..ae45369 100644 --- a/lib/glsa_repository.rb +++ b/lib/glsa_repository.rb @@ -44,7 +44,7 @@ class GLSARepository end def latest(n = 10) - @latest[0...n].map {|id| @advisories[id] } + @latest[0...n].map { |id| @advisories[id] } end def[](id) @@ -52,13 +52,14 @@ class GLSARepository end def has?(id) - @advisories.has_key? id + @advisories.key? id end private + def update? if ((DateTime.now - @load_date) * 60 * 60 * 24).to_i > CACHE_SECONDS update! end end -end
\ No newline at end of file +end |