Commit graph

209 commits

Author SHA1 Message Date
Akinori MUSHA
655fc9eb56 Add tests for the constructor & store. 2013-04-14 12:19:11 +09:00
Akinori MUSHA
c9a8e29202 Fix a typo. 2013-04-14 12:19:10 +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
5478f3d9c9 Improve rdoc. 2013-04-14 11:49:40 +09:00
Akinori MUSHA
6fcc298b80 MozillaStore saves timestamps in seconds, so use a session cookie for testing. 2013-04-13 13:35:54 +09:00
Akinori MUSHA
9fec000a29 Slightly fix the timestamp tests. 2013-04-13 13:27:09 +09:00
Akinori MUSHA
2e8fcb4a76 yaml_initialize: Initialize @origin to reduce warnings. 2013-04-13 13:04:54 +09:00
Akinori MUSHA
17a3cbc970 Remove an unsupported keyword: session. 2013-04-13 12:57:13 +09:00
Akinori MUSHA
02587d67e0 Cookie.new: Deprecate un-downcased keywords. 2013-04-13 12:56:33 +09:00
Akinori MUSHA
75267e8002 Use assert_send for comparison tests to see what is going on. 2013-04-12 23:18:06 +09:00
Akinori MUSHA
e1857d76a4 Add Cookie.cookie_value and Cookie.cookie_value_to_hash. 2013-04-12 02:15:13 +09:00
Akinori MUSHA
82e65b4a9b Allow assigning nil to the cookie value to make an expiration cookie.
Cookie.new(): Make the value parameter can be omittable.
2013-04-12 02:13:08 +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
917adc1abb Add a test for Cookie#accessed_at. 2013-04-12 01:25:04 +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
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
787a0edbb9 Make use of Hash#fetch. 2013-04-11 21:18:25 +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
9c7d563da5 Update README.md. 2013-04-08 14:05:48 +09:00
Akinori MUSHA
ef1f759e9d Fix an example. 2013-04-08 13:53:40 +09:00
Akinori MUSHA
f0eb5d0cd8 Improve markups. 2013-04-08 00:03:04 +09:00
Akinori MUSHA
865ca54c20 Improve compatibility notes and overall markups. 2013-04-07 23:52:24 +09:00
Akinori MUSHA
db2a4afff1 Bump VERSION to 1.0.0.pre10. 2013-04-07 23:10:25 +09:00
Akinori MUSHA
6689b3b7aa Drop support for obsolete attributes: version and comment. 2013-04-07 23:09:30 +09:00
Akinori MUSHA
9e46ce0d30 Cookie#max_age= should reject malformed strings. 2013-04-07 23:07:20 +09:00
Akinori MUSHA
f5f82c0304 Fix test_parse_bad_version and test_parse_bad_max_age. 2013-04-07 23:02:14 +09:00
Akinori MUSHA
dcf7f7e7a5 Avoid a bug of ruby 1.8. 2013-04-03 20:09:48 +09:00
Akinori MUSHA
726e2f89ea Emulate behavior of URI() of ruby >=1.9 where it raises ArgumentError. 2013-04-03 18:41:22 +09:00
Akinori MUSHA
9b4ce19873 Bump VERSION to 1.0.0.pre9. 2013-04-03 18:08:56 +09:00
Akinori MUSHA
7dba33bd40 Cookie#domain=: Fix handling of an empty string and let it accept nil. 2013-04-03 17:58:41 +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
25630b35e7 Use case-when. 2013-04-02 23:34:44 +09:00
Akinori MUSHA
1d9dc5754c Fix testing with simplecov. 2013-04-02 22:59:52 +09:00
Akinori MUSHA
7ab0a15d78 Update rdoc. 2013-03-29 15:34:27 +09:00
Akinori MUSHA
48f5783ba5 origin=: Do not raise error if the new value is the same as the stock value. 2013-03-29 02:14:55 +09:00
Akinori MUSHA
5a78013d85 Bump the version to 1.0.0.pre8. 2013-03-29 01:58:43 +09:00
Akinori MUSHA
1c140c035d Add a utility shorthand method HTTP::CookieJar#parse. 2013-03-29 01:55:43 +09:00
Akinori MUSHA
dc65a98907 HTTP::Cookie.parse: Change the signature again.
I made the uri parameter optional when I introduced the origin
attribute, but on second thought it should always be given.

I'm making the origin parameter fixed and mandatory again, but this
time it comes next to set_cookie.  This order should look more natural
because the one that comes first is to be parsed.

Since Mechanize::Cookie.parse required the uri parameter to be a URI
object, backward compatibility is still possible.
2013-03-29 01:39:30 +09:00
Akinori MUSHA
ef7bdeefba Cookie#cookie_value too should quote values if necessary. 2013-03-28 22:06:19 +09:00
Akinori MUSHA
2dc17ab7dc Better indentation while test is passing. 2013-03-28 19:24:05 +09:00
Akinori MUSHA
3131a46f14 Bump the version to 1.0.0.pre7. 2013-03-28 19:13:04 +09:00
Akinori MUSHA
26034253b1 Elaborate on the hash storage model. 2013-03-28 19:13:02 +09:00
Akinori MUSHA
8d7da32cc3 Fully test MozillaStore as well as HashStore. 2013-03-27 02:49:55 +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