Merge pull request #830 from mrnfrancesco/fix-issue-815

Fix issue 815
This commit is contained in:
Ryan Dewhurst
2015-06-04 09:46:26 +02:00
2 changed files with 13 additions and 4 deletions

View File

@@ -79,11 +79,18 @@ def missing_db_file?
false
end
def last_update
date = nil
if File.exists?(LAST_UPDATE_FILE)
content = File.read(LAST_UPDATE_FILE)
date = Time.parse(content) rescue nil
end
date
end
def update_required?
return true unless File.exist?(LAST_UPDATE_FILE)
content = File.read(LAST_UPDATE_FILE)
date = Time.parse(content) rescue Time.parse("2000-01-01")
return date < 5.days.ago
date = last_update
(true if date.nil?) or (date < 5.days.ago)
end
# Define colors