Akinori MUSHA
b02e800dfa
Comment out unused/advisory bits to gain coverage.
2013-04-16 00:54:56 +09:00
Akinori MUSHA
10ddb688df
Inhibit cloning MozillaStore.
2013-04-16 00:38:47 +09:00
Akinori MUSHA
d806955f57
Fix hand-made autoloading to allow directly referencing MozillaStore.
2013-04-16 00:37:10 +09:00
Akinori MUSHA
ded02f8327
Make MozillaStore#close actually "work" by closing open statements.
...
Add a finalizer to MozillaStore also, which automatically closes the
SQLite3 database.
2013-04-16 00:04:54 +09:00
Akinori MUSHA
e9230a00c1
Add tests for MozillaStore#upgrade_database and fix its bugs.
2013-04-16 00:03:03 +09:00
Akinori MUSHA
25dd32219f
MozillaStore#close: Do not call SQLite3::Database#close if already closed.
2013-04-15 23:57:35 +09:00
Akinori MUSHA
6ec66d11ed
Restore and improve compatibility with ruby 1.8.
2013-04-14 13:01:37 +09:00
Akinori MUSHA
a485e83ad9
Simply use cookie.domain instead of cookie.domain_name.hostname.
2013-04-12 01:19:49 +09:00
Akinori MUSHA
787a0edbb9
Make use of Hash#fetch.
2013-04-11 21:18:25 +09:00
Akinori MUSHA
6689b3b7aa
Drop support for obsolete attributes: version and comment.
2013-04-07 23:09:30 +09:00
Akinori MUSHA
26034253b1
Elaborate on the hash storage model.
2013-03-28 19:13:02 +09:00
Akinori MUSHA
4f526857aa
Store special cookies properly.
...
"Special" cookies here mean those of public suffixes and IP addresses.
2013-03-28 19:10:14 +09:00
Akinori MUSHA
91b5184d96
Hold session cookies in an internal HashStore.
2013-03-28 19:10:14 +09:00
Akinori MUSHA
add4a367fd
Include MonitorMixin in store classes and make them thread-safe.
2013-03-28 01:05:22 +09:00
Akinori MUSHA
30e2915c1e
Officially add AbstractStore#delete() as an API method.
2013-03-28 01:04:45 +09:00
Akinori MUSHA
e72b0fdbc5
YAMLServer#load: Add backward compatibility for reading YAML in the old format.
2013-03-28 00:13:32 +09:00
Akinori MUSHA
eed7e57813
Use the cookie creation time as base time for Max-Age.
...
Now #expire returns created_at + max_age when expires is nil.
Cookie.parse: the :date keyword is renamed to :created_at, and the
value is set to in parsed cookies via #created_at.
In YAML serialization, #max_age is stored.
2013-03-27 19:50:30 +09:00
Akinori MUSHA
4512c333b4
MozillaStore: Add #filename, #close and #closed?.
2013-03-27 19:50:27 +09:00
Akinori MUSHA
a7575ae3df
Improve documentation.
2013-03-27 18:17:56 +09:00
Akinori MUSHA
6fade20c59
Make GC threshold user specifiable.
2013-03-27 16:10:05 +09:00
Akinori MUSHA
69b3186666
Add MozillaStore.
2013-03-27 16:01:48 +09:00
Akinori MUSHA
bea9b1b502
each, cleanup: Fix the base date for expiration when the method starts.
...
This change is to remove an assumption that the clock is monotonic.
2013-03-27 15:10:03 +09:00
Akinori MUSHA
299bb24550
add(): Stop deleting an existing cookie when storing an expired cookie.
...
This is a backout of what I've done previously. Expiration check is
better done in extraction where a user can optionally specify a base
date.
Add an internal method delete() to delete an existing cookie.
2013-03-27 14:58:22 +09:00
Akinori MUSHA
bd3ae6c1ae
CookiestxtSaver: Hide HttpOnly cookies from old browsers.
...
This trick is the one that has been used in Mozilla before switching
the cookie database to SQLite.
2013-03-26 15:37:50 +09:00
Akinori MUSHA
8b78e3d1e4
CookiestxtSaver: Prefix the domain field with a dot if the domain flag is on.
...
The leading dot itself should be meaningless since there is the second
field to tell if the cookie is issued for a domain and that was the
reason I once removed it, but on second thought it doesn't hurt to put
one.
2013-03-26 15:37:50 +09:00
Akinori MUSHA
51da5e4c50
Do not touch and yield a cookie that should not be sent.
2013-03-26 01:43:06 +09:00
Akinori MUSHA
5b78957e19
Conform to RFC 6265 5.1.4 in that path=/a matches /a/* but not /ab.
...
Remove HTTP::Cookie.normalize_path and add HTTP::Cookie.path_match?
instead for comparison.
2013-03-23 02:02:56 +09:00
Akinori MUSHA
6dda359db1
Improve rdoc.
2013-03-23 00:37:21 +09:00
Akinori MUSHA
66f37b20dd
Rename expire to expire!, to reduce the risk of making a typo.
2013-03-21 15:46:45 +09:00
Akinori MUSHA
4532f190cc
Avoid 1.9 syntax.
2013-03-18 01:05:03 +09:00
Akinori MUSHA
fc8ddebce0
Fix a terrible typo that kept YAMLServer from working. :(
2013-03-15 19:24:20 +09:00
Akinori MUSHA
15f960bfbd
Reduce warnings.
2013-03-15 12:31:19 +09:00
Akinori MUSHA
4845b0de94
Trying to preload psych only on Ruby 1.9.2.
2013-03-15 12:29:54 +09:00
Akinori MUSHA
59ddb58b25
1.8 compatibility; Use IndexError instead of KeyError.
2013-03-15 12:11:38 +09:00
Akinori MUSHA
8be03978a0
Make each(uri) not fail if a non-HTTP URL is given.
...
Fix documents with #each. The uri argument was not made a keyword
argument.
Guarantee that the +uri+ given to AbstractStore#each() is a URI
object.
Make HashStore#each return self as required.
2013-03-15 11:33:54 +09:00
Akinori MUSHA
9d3975f641
A Store class should define empty?.
2013-03-15 11:27:02 +09:00
Akinori MUSHA
5cebc4e56d
Ignore incompatible YAML data.
2013-03-15 10:46:50 +09:00
Akinori MUSHA
8d8f01fa81
Cap the numbers of cookies per domain and cookies total, respectively.
...
This is implemented in HashStore#cleanup(), which is automatically
called by #add() after every 150 updates.
2013-03-15 04:20:59 +09:00
Akinori MUSHA
d004408296
Introduce an abstraction layer for the cookie store.
...
CookieJar#jar is removed and #store is added instead.
2013-03-15 04:20:59 +09:00
Akinori MUSHA
1f5eb6bc7f
Introduce an abstraction layer for saving (serializing) CookieJar.
...
CookieJar#save is the new name for the now obsolete #save_as.
CookieJar#save and #load now accept IO-like instead of a filename.
Change the YAML file format, and make #load discard incompatible data.
2013-03-15 04:20:59 +09:00