mirror of
https://github.com/samsonjs/http-cookie.git
synced 2026-04-27 14:57:46 +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
|
include Enumerable
|
||||||
|
|
||||||
def empty?
|
def empty?
|
||||||
# true or false
|
each { return false }
|
||||||
|
true
|
||||||
end
|
end
|
||||||
|
|
||||||
def clear
|
def clear
|
||||||
|
|
|
||||||
|
|
@ -113,10 +113,6 @@ class HTTP::CookieJar
|
||||||
self
|
self
|
||||||
end
|
end
|
||||||
|
|
||||||
def empty?
|
|
||||||
@jar.empty?
|
|
||||||
end
|
|
||||||
|
|
||||||
def cleanup(session = false)
|
def cleanup(session = false)
|
||||||
now = Time.now
|
now = Time.now
|
||||||
all_cookies = []
|
all_cookies = []
|
||||||
|
|
|
||||||
|
|
@ -398,19 +398,6 @@ class HTTP::CookieJar
|
||||||
self
|
self
|
||||||
end
|
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'
|
SQL[:delete_expired] = <<-'SQL'
|
||||||
DELETE FROM moz_cookies WHERE expiry < :expiry
|
DELETE FROM moz_cookies WHERE expiry < :expiry
|
||||||
SQL
|
SQL
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue