Akinori MUSHA
8930674adf
Change the custom URI parser to be a bit more conservative
...
First try the default URI(), and if it fails relax the restrictions on
the path component as a fallback.
2023-11-02 01:48:31 +09:00
Christian Schmidt
052479536c
Allow non-RFC 3986-compliant URLs
2023-10-12 18:34:07 +02:00
Lee Jarvis
5319f88dc2
fix unused variable warning in LoadError rescue
2013-05-25 10:17:13 +01:00
Akinori MUSHA
40aba54618
Accept a class object where a symbol addressing a class is accepted.
...
Convert IndexError to ArgumentError, and ArgumentError to TypeError as
appropriate.
2013-04-21 20:35:17 +09:00
Akinori MUSHA
0d5e666642
Improve rdoc.
2013-04-16 22:37:19 +09:00
Akinori MUSHA
bafb83fc06
Let AbstractStore & AbstractSaver autoloaded and add tests for autoloading.
2013-04-16 16:49:27 +09:00
Akinori MUSHA
2bb7485460
Add tests for CookieJar#clone, #cleanup, expiration by #each and #empty?.
2013-04-16 15:05:00 +09:00
Akinori MUSHA
d806955f57
Fix hand-made autoloading to allow directly referencing MozillaStore.
2013-04-16 00:37:10 +09:00
Akinori MUSHA
d44218c2e2
Cookie#acceptable? should not raise ArgumentError when it takes no argument.
...
Let CookieJar#add convert RuntimeError raised by acceptable? to
ArgumentError.
2013-04-15 10:29:07 +09:00
Akinori MUSHA
a1a130f156
CookieJar#parse: Use the block's return values to decide whether to add a cookie.
2013-04-14 12:10:28 +09:00
Akinori MUSHA
8c30527293
Update rdoc and comments.
2013-04-12 20:22:50 +09:00
Akinori MUSHA
f1fe763007
CookieJar#cookie(): Allow call without an argument.
2013-04-12 01:40:17 +09:00
Akinori MUSHA
53758d0a77
Omit expiration check in cookies(). Remove an unused variable.
2013-04-12 15:41:18 +09:00
Akinori MUSHA
f3b8abdd8e
Add CookieJar#delete().
2013-04-12 01:19:39 +09:00
Akinori MUSHA
2ef3e42067
Add a note about the for_domain flag in the rdoc for CookieJar#add().
2013-04-12 01:19:03 +09:00
Akinori MUSHA
8649485f53
Improve rdoc.
2013-04-11 21:13:40 +09:00
Akinori MUSHA
57218cb858
HTTP::CookieJar#cookies: accessed_at is updated in the underlying store.
2013-04-11 21:12:53 +09:00
Akinori MUSHA
f0eb5d0cd8
Improve markups.
2013-04-08 00:03:04 +09:00
Akinori MUSHA
dcf7f7e7a5
Avoid a bug of ruby 1.8.
2013-04-03 20:09:48 +09:00
Akinori MUSHA
ffabb614ad
Perform acceptance check in CookieJar#add instead of origin=.
...
- Cookie#acceptable? is added, which is called by such methods as
Cookie.parse and CookieJar#add.
- Cookie#origin= no longer raises ArgumentError just because it
conflicts with the domain.
- Cookie#origin= raises ArgumentError if it is given an object that is
not URI or string-like.
2013-04-03 17:57:27 +09:00
Akinori MUSHA
90ffce9aa6
Improve rdoc.
2013-04-03 17:29:08 +09:00
Akinori MUSHA
1c140c035d
Add a utility shorthand method HTTP::CookieJar#parse.
2013-03-29 01:55:43 +09:00
Akinori MUSHA
a7575ae3df
Improve documentation.
2013-03-27 18:17:56 +09:00
Akinori MUSHA
a0ea64da56
CookieJar.new: Pass the store class via a :store keyword.
2013-03-27 17:43:58 +09:00
Akinori MUSHA
69b3186666
Add MozillaStore.
2013-03-27 16:01:48 +09:00
Akinori MUSHA
f5bc5032dd
No need to check validity here any more.
2013-03-26 01:43:19 +09:00
Akinori MUSHA
38f7e98f09
Replace compatibility errors with documentation.
...
Leave compatibility stuff to Mechanize itself and just keep
http-cookie clean.
2013-03-23 00:27:38 +09:00
Akinori MUSHA
c442e8e0c8
The compatibility method clear! does not need to take arguments.
2013-03-21 17:30:25 +09:00
Akinori MUSHA
c6d28de9b7
Improve documentation.
2013-03-15 19:22:39 +09:00
Akinori MUSHA
05e5d332df
These autoloads do not serve much.
2013-03-15 12:10:22 +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
c0d5f3a121
Add error messages to make migration from Mechanize::Cookie easier.
...
Add a section to elaborate on the incompatibilities to README.md.
2013-03-15 05:53:11 +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
Akinori MUSHA
fd7450717a
Implement HTTP::CookieJar#empty? without an argument.
2013-03-15 04:20:59 +09:00
Akinori MUSHA
f60e678cb8
Do not store a cookie if it is already expired at the time of adding.
2013-03-15 04:20:59 +09:00
Akinori MUSHA
10e9ca5c60
Add HTTP::Cookie#session? as an alias for #session.
2013-03-15 04:20:58 +09:00
Akinori MUSHA
f79387080b
Use Hash#clear rather than creating a new one.
2013-03-08 21:31:11 +09:00
Akinori MUSHA
5f21b364d3
Remove an unused variable to suppress warning.
2013-03-08 21:31:11 +09:00
Mike Morearty
184fae797e
Slight change to cookie-jar header
...
Instead of "Netscape HTTP Cookie File", now writing "HTTP Cookie File".
Python's cookie code recognizes either one.
2013-02-18 15:54:14 -08:00
Mike Morearty
0decfe98b7
Add header line when writing to cookies.txt
...
When Python is reading a Netscape-format cookies.txt file, it seems to
require an initial line that looks like this:
# Netscape HTTP Cookie File
2013-02-17 18:23:32 -08:00
Akinori MUSHA
f4cd8ffb58
Hide load_yaml, renaming to require_yaml.
2012-10-22 15:14:19 +09:00
Akinori MUSHA
2a9476707c
HTTP::CookieJar#load: Use File.open() instead of Kernel#open().
2012-10-22 15:10:34 +09:00
Akinori MUSHA
7fa5b10df6
HTTP::CookieJar#each: Take an optional URL/URI which is used as a scope.
...
Do not call cleanup in each or cookies.
2012-10-22 15:08:08 +09:00
Akinori MUSHA
7c5ac21d0f
HTTP::CookieJar#cleanup: Use delete_if.
2012-10-22 15:03:36 +09:00
Akinori MUSHA
b7254599bd
Try not to expose @jar in normal methods.
2012-10-22 14:52:30 +09:00
Akinori MUSHA
c7247cf965
HTTP::CookieJar#empty?: Optimize.
2012-10-22 14:51:59 +09:00
Akinori MUSHA
1731b155e6
HTTP::CookieJar#add: Check if both the domain and path of the cookie are set.
2012-10-22 14:50:49 +09:00
Akinori MUSHA
fa45e028a7
Treat an empty path as '/'.
...
HTTP::CookieJar#cookies: Do not modify a given URI. Remove a
redundant cleanup() call.
2012-10-22 14:21:46 +09:00
Akinori MUSHA
24e9b26004
HTTP::CookieJar#add: Use the hostname of domain_name.
2012-10-22 12:59:08 +09:00