Akinori MUSHA
1eb25f4ab9
Bump VERSION to 0.1.5.
2013-03-18 00:53:14 +09:00
Akinori MUSHA
1a7c38e9e0
Apply minor code improvements.
2013-03-18 00:40:47 +09:00
Akinori MUSHA
c389a52e2c
Drop dependency on WEBrick::HTTPUtils.
2013-03-18 00:09:01 +09:00
Akinori MUSHA
3e61ef78a2
Require 'uri'.
2013-03-17 23:56:58 +09:00
Akinori MUSHA
cbb25195d4
Bump VERSION to 0.1.4.
2013-03-15 19:25:16 +09:00
Akinori MUSHA
fc8ddebce0
Fix a terrible typo that kept YAMLServer from working. :(
2013-03-15 19:24:20 +09:00
Akinori MUSHA
c6d28de9b7
Improve documentation.
2013-03-15 19:22:39 +09:00
Akinori MUSHA
d2cb5ff69d
Bump VERSION to 0.1.3.
2013-03-15 12:31:49 +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
631608f82d
Bump VERSION to 0.1.2.
2013-03-15 12:14:58 +09:00
Akinori MUSHA
59ddb58b25
1.8 compatibility; Use IndexError instead of KeyError.
2013-03-15 12:11:38 +09:00
Akinori MUSHA
05e5d332df
These autoloads do not serve much.
2013-03-15 12:10:22 +09:00
Akinori MUSHA
236f3af719
Extend URI() globally. URI() is like everywhere by now.
2013-03-15 12:08:45 +09:00
Akinori MUSHA
a74db60721
Bump VERSION to 0.1.1.
2013-03-15 11:36:58 +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
b86690cb21
Check if the scheme is http(s) and the host is non-nil in URI.
2013-03-15 11:21:57 +09:00
Akinori MUSHA
c2e0dbb96f
Bump VERSION to 0.1.0.
2013-03-15 10:52:04 +09:00
Akinori MUSHA
5cebc4e56d
Ignore incompatible YAML data.
2013-03-15 10:46:50 +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
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
Akinori MUSHA
fd7450717a
Implement HTTP::CookieJar#empty? without an argument.
2013-03-15 04:20:59 +09:00
Akinori MUSHA
a831fc424c
Add HTTP::Cookie#set_cookie_value, and alias #cookie_value to #to_s.
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
1fcf008cf0
Make HTTP::Cookie#expired? optionally take a time.
2013-03-15 04:20:59 +09:00
Akinori MUSHA
d8be652a92
Add HTTP::Cookie#expire.
2013-03-15 04:20:58 +09:00
Akinori MUSHA
91193dace3
Fix saving in the cookies.txt format. Expires values were broken.
...
Remove duplicate and incomplete tests.
2013-03-15 04:20:58 +09:00
Akinori MUSHA
84d375e3b7
Make HTTP::Cookie.parse() reject cookies longer than 4096 bytes.
...
This limit is defined as HTTP::Cookie::MAX_LENGTH.
2013-03-15 04:20:58 +09:00
Akinori MUSHA
10e9ca5c60
Add HTTP::Cookie#session? as an alias for #session.
2013-03-15 04:20:58 +09:00
Akinori MUSHA
9d842404e3
Fix <=> so that two cookies of different values are not equal.
2013-03-12 18:32:18 +09:00
Akinori MUSHA
7554bffb32
Allow passing a base time to HTTP::Cookie.parse() via :date.
2013-03-12 18:32:18 +09:00
Akinori MUSHA
6d8fb94f83
Add support for the HttpOnly attribute.
...
New methods are added to HTTP::Cookie: httponly?, httponly=
2013-03-12 18:32:18 +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
Akinori MUSHA
b05008d996
Always initialize @origin to suppress warning.
2013-03-08 21:31:11 +09:00
Akinori MUSHA
3ec9dc3200
Reduce warnings from the interpreter. (method redefinition)
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
82deac2f19
HTTP::Cookie#origin=: Acceptability check must be performed after setting the domain and path.
2012-10-22 14:50:13 +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