lib/geocoder/cache.rb in geocoder-1.4.3 vs lib/geocoder/cache.rb in geocoder-1.4.4
- old
+ new
@@ -38,10 +38,14 @@
# Delete cache entry for given URL,
# or pass <tt>:all</tt> to clear all URLs.
#
def expire(url)
if url == :all
- urls.each{ |u| expire(u) }
+ if store.respond_to?(:keys)
+ urls.each{ |u| expire(u) }
+ else
+ raise(NoMethodError, "The Geocoder cache store must implement `#keys` for `expire(:all)` to work")
+ end
else
expire_single_url(url)
end
end