diff --git a/lib/http/cookie_jar/abstract_store.rb b/lib/http/cookie_jar/abstract_store.rb index 844464c..d24cdfe 100644 --- a/lib/http/cookie_jar/abstract_store.rb +++ b/lib/http/cookie_jar/abstract_store.rb @@ -79,7 +79,8 @@ class HTTP::CookieJar::AbstractStore include Enumerable def empty? - # true or false + each { return false } + true end def clear diff --git a/lib/http/cookie_jar/hash_store.rb b/lib/http/cookie_jar/hash_store.rb index 050358e..4478fc7 100644 --- a/lib/http/cookie_jar/hash_store.rb +++ b/lib/http/cookie_jar/hash_store.rb @@ -113,10 +113,6 @@ class HTTP::CookieJar self end - def empty? - @jar.empty? - end - def cleanup(session = false) now = Time.now all_cookies = [] diff --git a/lib/http/cookie_jar/mozilla_store.rb b/lib/http/cookie_jar/mozilla_store.rb index 3d8e340..feb5ca4 100644 --- a/lib/http/cookie_jar/mozilla_store.rb +++ b/lib/http/cookie_jar/mozilla_store.rb @@ -398,19 +398,6 @@ class HTTP::CookieJar self end - SQL[:count] = <<-'SQL' - SELECT COUNT(id) FROM moz_cookies - SQL - - def count - @stmt[:count].execute.first[0] - end - protected :count - - def empty? - @sjar.empty? && count == 0 - end - SQL[:delete_expired] = <<-'SQL' DELETE FROM moz_cookies WHERE expiry < :expiry SQL