summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex Legler <alex@a3li.li>2015-12-25 17:16:14 +0100
committerAlex Legler <alex@a3li.li>2015-12-25 17:16:14 +0100
commitf02847608d9dbde44947588286c8c0cc01237a87 (patch)
treedc066280f8adfc35c9ef06633d1c7bb79efee6d1 /lib/glsa_repository.rb
parentMake parsing more resilient to weird advisories (diff)
downloadsecurity-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.rb7
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