lib/plezi/common/cache.rb in plezi-0.11.0 vs lib/plezi/common/cache.rb in plezi-0.11.1
- old
+ new
@@ -76,15 +76,15 @@
CACHE_LOCK.synchronize { CACHE_STORE.clear } # if CACHE_STORE[filename]
end
# returns true if the filename is cached.
def cached? filename
- !CACHE_STORE[filename].nil?
+ CACHE_STORE[filename] && true
end
# returns true if the file exists on disk or in the cache.
def file_exists? filename
- (CACHE_STORE[filename] || File.exists?(filename)) ? true : false
+ ( CACHE_STORE[filename] || File.exists?(filename) ) && true
end
# returns true if the file has been update since data was last cached.
def cache_needs_update? filename
return true if CACHE_STORE[filename].nil? || CACHE_STORE[filename].mtime < File.mtime(filename)