mirror of
https://github.com/samsonjs/http-cookie.git
synced 2026-03-25 08:55:53 +00:00
Fix *Store#empty?.
This commit is contained in:
parent
2bb7485460
commit
a3ab578671
3 changed files with 2 additions and 18 deletions
|
|
@ -79,7 +79,8 @@ class HTTP::CookieJar::AbstractStore
|
|||
include Enumerable
|
||||
|
||||
def empty?
|
||||
# true or false
|
||||
each { return false }
|
||||
true
|
||||
end
|
||||
|
||||
def clear
|
||||
|
|
|
|||
|
|
@ -113,10 +113,6 @@ class HTTP::CookieJar
|
|||
self
|
||||
end
|
||||
|
||||
def empty?
|
||||
@jar.empty?
|
||||
end
|
||||
|
||||
def cleanup(session = false)
|
||||
now = Time.now
|
||||
all_cookies = []
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in a new issue