Skip to content

Instantly share code, notes, and snippets.

@grimsock
Created January 20, 2010 22:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save grimsock/282342 to your computer and use it in GitHub Desktop.
Save grimsock/282342 to your computer and use it in GitHub Desktop.
def self.cached_deliveries
if File.exists?(DELIVERIES_CACHE_PATH) == false || File.zero?(DELIVERIES_CACHE_PATH) == true
return []
else
File.open(DELIVERIES_CACHE_PATH,'r') do |f|
Marshal.load(f)
end
end
end
def self.cached_deliveries
begin
File.open(DELIVERIES_CACHE_PATH,'r') do |f|
Marshal.load(f)
end
rescue
[]
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment