Fix *Store#empty?.

This commit is contained in:
Akinori MUSHA 2013-04-16 09:57:31 +09:00
parent 2bb7485460
commit a3ab578671
3 changed files with 2 additions and 18 deletions

View file

@ -79,7 +79,8 @@ class HTTP::CookieJar::AbstractStore
include Enumerable
def empty?
# true or false
each { return false }
true
end
def clear

View file

@ -113,10 +113,6 @@ class HTTP::CookieJar
self
end
def empty?
@jar.empty?
end
def cleanup(session = false)
now = Time.now
all_cookies = []

View file

@ -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