diamond-mechanize 2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (154) hide show
  1. data/CHANGELOG.rdoc +718 -0
  2. data/EXAMPLES.rdoc +187 -0
  3. data/FAQ.rdoc +11 -0
  4. data/GUIDE.rdoc +163 -0
  5. data/LICENSE.rdoc +20 -0
  6. data/Manifest.txt +159 -0
  7. data/README.rdoc +64 -0
  8. data/Rakefile +49 -0
  9. data/lib/mechanize.rb +1079 -0
  10. data/lib/mechanize/content_type_error.rb +13 -0
  11. data/lib/mechanize/cookie.rb +232 -0
  12. data/lib/mechanize/cookie_jar.rb +194 -0
  13. data/lib/mechanize/download.rb +59 -0
  14. data/lib/mechanize/element_matcher.rb +36 -0
  15. data/lib/mechanize/file.rb +65 -0
  16. data/lib/mechanize/file_connection.rb +17 -0
  17. data/lib/mechanize/file_request.rb +26 -0
  18. data/lib/mechanize/file_response.rb +74 -0
  19. data/lib/mechanize/file_saver.rb +39 -0
  20. data/lib/mechanize/form.rb +543 -0
  21. data/lib/mechanize/form/button.rb +6 -0
  22. data/lib/mechanize/form/check_box.rb +12 -0
  23. data/lib/mechanize/form/field.rb +54 -0
  24. data/lib/mechanize/form/file_upload.rb +21 -0
  25. data/lib/mechanize/form/hidden.rb +3 -0
  26. data/lib/mechanize/form/image_button.rb +19 -0
  27. data/lib/mechanize/form/keygen.rb +34 -0
  28. data/lib/mechanize/form/multi_select_list.rb +94 -0
  29. data/lib/mechanize/form/option.rb +50 -0
  30. data/lib/mechanize/form/radio_button.rb +55 -0
  31. data/lib/mechanize/form/reset.rb +3 -0
  32. data/lib/mechanize/form/select_list.rb +44 -0
  33. data/lib/mechanize/form/submit.rb +3 -0
  34. data/lib/mechanize/form/text.rb +3 -0
  35. data/lib/mechanize/form/textarea.rb +3 -0
  36. data/lib/mechanize/headers.rb +23 -0
  37. data/lib/mechanize/history.rb +82 -0
  38. data/lib/mechanize/http.rb +8 -0
  39. data/lib/mechanize/http/agent.rb +1004 -0
  40. data/lib/mechanize/http/auth_challenge.rb +59 -0
  41. data/lib/mechanize/http/auth_realm.rb +31 -0
  42. data/lib/mechanize/http/content_disposition_parser.rb +188 -0
  43. data/lib/mechanize/http/www_authenticate_parser.rb +155 -0
  44. data/lib/mechanize/monkey_patch.rb +16 -0
  45. data/lib/mechanize/page.rb +440 -0
  46. data/lib/mechanize/page/base.rb +7 -0
  47. data/lib/mechanize/page/frame.rb +27 -0
  48. data/lib/mechanize/page/image.rb +30 -0
  49. data/lib/mechanize/page/label.rb +20 -0
  50. data/lib/mechanize/page/link.rb +98 -0
  51. data/lib/mechanize/page/meta_refresh.rb +68 -0
  52. data/lib/mechanize/parser.rb +173 -0
  53. data/lib/mechanize/pluggable_parsers.rb +144 -0
  54. data/lib/mechanize/redirect_limit_reached_error.rb +19 -0
  55. data/lib/mechanize/redirect_not_get_or_head_error.rb +21 -0
  56. data/lib/mechanize/response_code_error.rb +21 -0
  57. data/lib/mechanize/response_read_error.rb +27 -0
  58. data/lib/mechanize/robots_disallowed_error.rb +28 -0
  59. data/lib/mechanize/test_case.rb +663 -0
  60. data/lib/mechanize/unauthorized_error.rb +3 -0
  61. data/lib/mechanize/unsupported_scheme_error.rb +6 -0
  62. data/lib/mechanize/util.rb +101 -0
  63. data/test/data/htpasswd +1 -0
  64. data/test/data/server.crt +16 -0
  65. data/test/data/server.csr +12 -0
  66. data/test/data/server.key +15 -0
  67. data/test/data/server.pem +15 -0
  68. data/test/htdocs/alt_text.html +10 -0
  69. data/test/htdocs/bad_form_test.html +9 -0
  70. data/test/htdocs/button.jpg +0 -0
  71. data/test/htdocs/canonical_uri.html +9 -0
  72. data/test/htdocs/dir with spaces/foo.html +1 -0
  73. data/test/htdocs/empty_form.html +6 -0
  74. data/test/htdocs/file_upload.html +26 -0
  75. data/test/htdocs/find_link.html +41 -0
  76. data/test/htdocs/form_multi_select.html +16 -0
  77. data/test/htdocs/form_multival.html +37 -0
  78. data/test/htdocs/form_no_action.html +18 -0
  79. data/test/htdocs/form_no_input_name.html +16 -0
  80. data/test/htdocs/form_order_test.html +11 -0
  81. data/test/htdocs/form_select.html +16 -0
  82. data/test/htdocs/form_set_fields.html +14 -0
  83. data/test/htdocs/form_test.html +188 -0
  84. data/test/htdocs/frame_referer_test.html +10 -0
  85. data/test/htdocs/frame_test.html +30 -0
  86. data/test/htdocs/google.html +13 -0
  87. data/test/htdocs/index.html +6 -0
  88. data/test/htdocs/link with space.html +5 -0
  89. data/test/htdocs/meta_cookie.html +11 -0
  90. data/test/htdocs/no_title_test.html +6 -0
  91. data/test/htdocs/noindex.html +9 -0
  92. data/test/htdocs/rails_3_encoding_hack_form_test.html +27 -0
  93. data/test/htdocs/relative/tc_relative_links.html +21 -0
  94. data/test/htdocs/robots.html +8 -0
  95. data/test/htdocs/robots.txt +2 -0
  96. data/test/htdocs/tc_bad_charset.html +9 -0
  97. data/test/htdocs/tc_bad_links.html +5 -0
  98. data/test/htdocs/tc_base_link.html +8 -0
  99. data/test/htdocs/tc_blank_form.html +11 -0
  100. data/test/htdocs/tc_charset.html +6 -0
  101. data/test/htdocs/tc_checkboxes.html +19 -0
  102. data/test/htdocs/tc_encoded_links.html +5 -0
  103. data/test/htdocs/tc_field_precedence.html +11 -0
  104. data/test/htdocs/tc_follow_meta.html +8 -0
  105. data/test/htdocs/tc_form_action.html +48 -0
  106. data/test/htdocs/tc_links.html +19 -0
  107. data/test/htdocs/tc_meta_in_body.html +9 -0
  108. data/test/htdocs/tc_pretty_print.html +17 -0
  109. data/test/htdocs/tc_referer.html +16 -0
  110. data/test/htdocs/tc_relative_links.html +19 -0
  111. data/test/htdocs/tc_textarea.html +23 -0
  112. data/test/htdocs/test_click.html +11 -0
  113. data/test/htdocs/unusual______.html +5 -0
  114. data/test/test_mechanize.rb +1164 -0
  115. data/test/test_mechanize_cookie.rb +451 -0
  116. data/test/test_mechanize_cookie_jar.rb +483 -0
  117. data/test/test_mechanize_download.rb +43 -0
  118. data/test/test_mechanize_file.rb +61 -0
  119. data/test/test_mechanize_file_connection.rb +21 -0
  120. data/test/test_mechanize_file_request.rb +19 -0
  121. data/test/test_mechanize_file_saver.rb +21 -0
  122. data/test/test_mechanize_form.rb +875 -0
  123. data/test/test_mechanize_form_check_box.rb +38 -0
  124. data/test/test_mechanize_form_encoding.rb +114 -0
  125. data/test/test_mechanize_form_field.rb +63 -0
  126. data/test/test_mechanize_form_file_upload.rb +20 -0
  127. data/test/test_mechanize_form_image_button.rb +12 -0
  128. data/test/test_mechanize_form_keygen.rb +32 -0
  129. data/test/test_mechanize_form_multi_select_list.rb +84 -0
  130. data/test/test_mechanize_form_option.rb +55 -0
  131. data/test/test_mechanize_form_radio_button.rb +78 -0
  132. data/test/test_mechanize_form_select_list.rb +76 -0
  133. data/test/test_mechanize_form_textarea.rb +52 -0
  134. data/test/test_mechanize_headers.rb +35 -0
  135. data/test/test_mechanize_history.rb +103 -0
  136. data/test/test_mechanize_http_agent.rb +1225 -0
  137. data/test/test_mechanize_http_auth_challenge.rb +39 -0
  138. data/test/test_mechanize_http_auth_realm.rb +49 -0
  139. data/test/test_mechanize_http_content_disposition_parser.rb +118 -0
  140. data/test/test_mechanize_http_www_authenticate_parser.rb +146 -0
  141. data/test/test_mechanize_link.rb +80 -0
  142. data/test/test_mechanize_page.rb +118 -0
  143. data/test/test_mechanize_page_encoding.rb +182 -0
  144. data/test/test_mechanize_page_frame.rb +16 -0
  145. data/test/test_mechanize_page_link.rb +390 -0
  146. data/test/test_mechanize_page_meta_refresh.rb +127 -0
  147. data/test/test_mechanize_parser.rb +289 -0
  148. data/test/test_mechanize_pluggable_parser.rb +52 -0
  149. data/test/test_mechanize_redirect_limit_reached_error.rb +24 -0
  150. data/test/test_mechanize_redirect_not_get_or_head_error.rb +14 -0
  151. data/test/test_mechanize_subclass.rb +22 -0
  152. data/test/test_mechanize_util.rb +103 -0
  153. data/test/test_multi_select.rb +119 -0
  154. metadata +216 -0
@@ -0,0 +1,718 @@
1
+ = Mechanize CHANGELOG
2
+
3
+ === 2.1 / 2011-12-20
4
+
5
+ * Deprecations
6
+ * Mechanize#get no longer accepts an options hash.
7
+ * Mechanize::Util::to_native_charset has been removed.
8
+
9
+ * Minor enhancements
10
+ * Mechanize now depends on net-http-persistent 2.3+. This new version
11
+ brings idle timeouts to help with the dreaded "too many connection resets"
12
+ issue when POSTing to a closed connection. Issue #123
13
+ * SSL connections will be verified against the system certificate store by
14
+ default.
15
+ * Added Mechanize#retry_change_requests to allow mechanize to retry POST and
16
+ other non-idempotent requests when you know it is safe to do so. Issue
17
+ #123
18
+ * Mechanize can now stream files directly to disk without loading them into
19
+ memory first through Mechanize::Download, a pluggable parser for
20
+ downloading files.
21
+
22
+ All responses larger than Mechanize#max_file_buffer are downloaded to a
23
+ Tempfile. For backwards compatibility Mechanize::File subclasses still
24
+ load the response body into memory.
25
+
26
+ To force all unknown content types to download to disk instead of memory
27
+ set:
28
+
29
+ agent.pluggable_parser.default = Mechanize::Download
30
+ * Added Mechanize#content_encoding_hooks which allow handling of
31
+ non-standard content encodings like "agzip". Patch #125 by kitamomonga
32
+ * Added dom_class to elements and the element matcher like dom_id. Patch
33
+ #156 by Dan Hansen.
34
+ * Added support for the HTML5 keygen form element. See
35
+ http://dev.w3.org/html5/spec/Overview.html#the-keygen-element Patch #157
36
+ by Victor Costan.
37
+ * Mechanize no longer follows meta refreshes that have no "url=" in the
38
+ content attribute to avoid infinite loops. To follow a meta refresh to
39
+ the same page set Mechanize#follow_meta_refresh_self to true. Issue #134
40
+ by Jo Hund.
41
+ * Updated 'Mac Safari' User-Agent alias to Safari 5.1.1. 'Mac Safari 4' can
42
+ be used for the old 'Mac Safari' alias.
43
+ * When given multiple HTTP authentication options mechanize now picks the
44
+ strongest method.
45
+ * Improvements to HTTP authorization:
46
+ * mechanize raises Mechanize::UnathorizedError for 401 responses which is
47
+ a sublcass of Mechanize::ResponseCodeError.
48
+ * Added support for NTLM authentication, but this has not been tested.
49
+ * Mechanize::Cookie.new accepts attributes in a hash.
50
+ * Mechanize::CookieJar#<<(cookie) (alias: add!) is added. Issue #139
51
+ * Different mechanize instances may now have different loggers. Issue #122
52
+ * Mechanize now accepts a proxy port as a service name or number string.
53
+ Issue #167
54
+
55
+ * Bug fixes
56
+ * Mechanize now handles cookies just as most modern browsers do,
57
+ roughly based on RFC 6265.
58
+ * domain=.example.com (which is invalid) is considered identical to
59
+ domain=example.com.
60
+ * A cookie with domain=example.com is sent to host.sub.example.com
61
+ as well as host.example.com and example.com.
62
+ * A cookie with domain=TLD (no dots) is accepted and sent if the
63
+ host name is TLD, and rejected otherwise. To retain compatibility
64
+ and convention, host/domain names starting with "local" are exempt
65
+ from this rule.
66
+ * A cookie with no domain attribute is only sent to the original
67
+ host.
68
+ * A cookie with an Effective TLD is rejected based on the public
69
+ suffix list. (cf. http://publicsuffix.org/)
70
+ * "Secure" cookies are not sent via non-https connection.
71
+ * Subdomain match is not performed against an IP address.
72
+ * It is recommended that you clear out existing cookie jars for
73
+ regeneration because previously saved cookies may not have been
74
+ parsed correctly.
75
+ * Mechanize takes more care to avoid saving files with certain unsafe names.
76
+ You should still take care not to use mechanize to save files directly
77
+ into your home directory ($HOME). Issue #163.
78
+ * Mechanize#cookie_jar= works again. Issue #126
79
+ * The original Referer value persists on redirection. Issue #150
80
+ * Do not send a referer on a Refresh header based redirection.
81
+ * Fixed encoding error in tests when LANG=C. Patch #142 by jinschoi.
82
+ * The order of items in a form submission now match the DOM order. Patch
83
+ #129 by kitamomonga
84
+ * Fixed proxy example in EXAMPLE. Issue #146 by NielsKSchjoedt
85
+
86
+ === 2.0.1 / 2011-06-28
87
+
88
+ Mechanize now uses minitest to avoid 1.9 vs 1.8 assertion availability in
89
+ test/unit
90
+
91
+ * Bug Fixes
92
+ * Restored Mechanize#set_proxy. Issue #117, #118, #119
93
+ * Mechanize::CookieJar#load now lazy-loads YAML. Issue #118
94
+ * Mechanize#keep_alive_time no longer crashes but does nothing as
95
+ net-http-persistent does not support HTTP/1.0 keep-alive extensions.
96
+
97
+ === 2.0 / 2011-06-27
98
+
99
+ Mechanize is now under the MIT license
100
+
101
+ * API changes
102
+ * WWW::Mechanize has been removed. Use Mechanize.
103
+ * Pre connect hooks are now called with the agent and the request. See
104
+ Mechanize#pre_connect_hooks.
105
+ * Post connect hooks are now called with the agent and the response. See
106
+ Mechanize#post_connect_hooks.
107
+ * Mechanize::Chain is gone, as an internal API this should cause no problems.
108
+ * Mechanize#fetch_page no longer accepts an options Hash.
109
+ * Mechanize#put now accepts headers instead of an options Hash as the last
110
+ argument
111
+ * Mechanize#delete now accepts headers instead of an options Hash as the
112
+ last argument
113
+ * Mechanize#request_with_entity now accepts headers instead of an options
114
+ Hash as the last argument
115
+ * Mechanize no longer raises RuntimeError directly, Mechanize::Error or
116
+ ArgumentError are raised instead.
117
+ * The User-Agent header has changed. It no longer includes the WWW- prefix
118
+ and now includes the ruby version. The URL has been updated as well.
119
+ * Mechanize now requires ruby 1.8.7 or newer.
120
+ * Hpricot support has been removed as webrobots requires nokogiri.
121
+ * Mechanize#get no longer accepts the referer as the second argument.
122
+ * Mechanize#get no longer allows the HTTP method to be changed (:verb
123
+ option).
124
+ * Mechanize::Page::Meta is now Mechanize::Page::MetaRefresh to accurately
125
+ depict its responsibilities.
126
+ * Mechanize::Page#meta is now Mechanize::Page#meta_refresh as it only
127
+ contains meta elements with http-equiv of "refresh"
128
+ * Mechanize::Page#charset is now Mechanize::Page::charset. GH #112, patch
129
+ by Godfrey Chan.
130
+
131
+ * Deprecations
132
+ * Mechanize#get with an options hash is deprecated and will be removed after
133
+ October, 2011.
134
+ * Mechanize::Util::to_native_charset is deprecated as it is no longer used
135
+ by Mechanize.
136
+
137
+ * New Features
138
+
139
+ * Add header reference methods to Mechanize::File so that a reponse
140
+ object gets compatible with Net::HTTPResponse.
141
+ * Mechanize#click accepts a regexp or string to click a button/link in the
142
+ current page. It works as expected when not passed a string or regexp.
143
+ * Provide a way to only follow permanent redirects (301)
144
+ automatically: <tt>agent.redirect_ok = :permanent</tt> GH #73
145
+ * Mechanize now supports HTML5 meta charset. GH #113
146
+ * Documented various Mechanize accessors. GH #66
147
+ * Mechanize now uses net-http-digest_auth. GH #31
148
+ * Mechanize now implements session cookies. GH #78
149
+ * Mechanize now implements deflate decoding. GH #40
150
+ * Mechanize now allows a certificate and key to be passed directly. GH #71
151
+ * Mechanize::Form::MultiSelectList now implements #option_with and
152
+ #options_with. GH #42
153
+ * Add Mechanize::Page::Link#rel and #rel?(kind) to read and test the rel
154
+ attribute.
155
+ * Add Mechanize::Page#canonical_uri to read a </tt><link
156
+ rel="canonical"></tt> tag.
157
+ * Add support for Robots Exclusion Protocol (i.e. robots.txt) and
158
+ nofollow/noindex in meta tags and the rel attribute. Automatic
159
+ exclusion can be turned on by setting:
160
+ agent.robots = true
161
+ * Manual robots.txt test can be performed with
162
+ Mechanize#robots_allowed? and #robots_disallowed?.
163
+ * Mechanize::Form now supports the accept-charset attribute. GH #96
164
+ * Mechanize::ResponseReadError is raised if there is an exception while
165
+ reading the response body. This allows recovery from broken HTTP servers
166
+ (or connections). GH #90
167
+ * Mechanize#follow_meta_refresh set to :anywhere will follow meta refresh
168
+ found outside of a document's head. GH #99
169
+ * Add support for HTML5's rel="noreferrer" attribute which indicates
170
+ no "Referer" information should be sent when following the link.
171
+ * A frame will now load its content when #content is called. GH #111
172
+ * Added Mechanize#default_encoding to provide a default for pages with no
173
+ encoding specified. GH #104
174
+ * Added Mechanize#force_default_encoding which only uses
175
+ Mechanize#default_encoding for parsing HTML. GH #104
176
+
177
+ * Bug Fixes:
178
+
179
+ * Fixed a bug where Referer is not sent when accessing a relative
180
+ URI starting with "http".
181
+ * Fix handling of Meta Refresh with relative paths. GH #39
182
+ * Mechanize::CookieJar now supports RFC 2109 correctly. GH #85
183
+ * Fixed typo in EXAMPLES.rdoc. GH #74
184
+ * The base element is now handled correctly for images. GH #72
185
+ * Image buttons with no name attribute are now included in the form's button
186
+ list. GH#56
187
+ * Improved handling of non ASCII-7bit compatible characters in links (only
188
+ an issue on ruby 1.8). GH #36, GH #75
189
+ * Loading cookies.txt is faster. GH #38
190
+ * Mechanize no longer sends cookies for a.b.example to axb.example. GH #41
191
+ * Mechanize no longer sends the button name as a form field for image
192
+ buttons. GH #45
193
+ * Blank cookie values are now skipped. GH #80
194
+ * Mechanize now adds a '.' to cookie domains if no '.' was sent. This is
195
+ not allowed by RFC 2109 but does appear in RFC 2965. GH #86
196
+ * file URIs are now read in binary mode. GH #83
197
+ * Content-Encoding: x-gzip is now treated like gzip per RFC 2616.
198
+ * Mechanize now unescapes URIs for meta refresh. GH #68
199
+ * Mechanize now has more robust HTML charset detection. GH #43
200
+ * Mechanize::Form::Textarea is now created from a textarea element. GH #94
201
+ * A meta content-type now overrides the HTTP content type. GH #114
202
+ * Mechanize::Page::Link#uri now handles both escaped and unescaped hrefs.
203
+ GH #107
204
+
205
+ === 1.0.0
206
+
207
+ * New Features:
208
+
209
+ * An optional verb may be passed to Mechanize#get GH #26
210
+ * The WWW constant is deprecated. Switch to the top level constant Mechanize
211
+ * SelectList#option_with and options_with for finding options
212
+
213
+ * Bug Fixes:
214
+
215
+ * Rescue errors from bogus encodings
216
+ * 7bit content-encoding support. Thanks sporkmonger! GH #2
217
+ * Fixed a bug with iconv conversion. Thanks awesomeman! GH #9
218
+ * meta redirects outside the head are not followed. GH #13
219
+ * Form submissions work with nil page encodings. GH #25
220
+ * Fixing default values with serialized cookies. GH #3
221
+ * Checkboxes and fields are sorted by page appearance before submitting. #11
222
+
223
+ === 0.9.3
224
+
225
+ * Bug Fixes:
226
+
227
+ * Do not apply encoding if encoding equals 'none' Thanks Akinori MUSHA!
228
+ * Fixed Page#encoding= when changing the value from or to nil. Made
229
+ it return the assigned value while at it. (Akinori MUSHA)
230
+ * Custom request headers may be supplied WWW::Mechanize#request_headers
231
+ RF #24516
232
+ * HTML Parser may be set on a per instance level WWW::Mechanize#html_parser
233
+ RF #24693
234
+ * Fixed string encoding in ruby 1.9. RF #2433
235
+ * Rescuing Zlib::DataErrors (Thanks Kelley Reynolds)
236
+ * Fixing a problem with frozen SSL objects. RF #24950
237
+ * Do not send a referer on meta refresh. RF #24945
238
+ * Fixed a bug with double semi-colons in Content-Disposition headers
239
+ * Properly handling cookies that specify a path. RF #25259
240
+
241
+ === 0.9.2 / 2009/03/05
242
+
243
+ * New Features:
244
+ * Mechanize#submit and Form#submit take arbitrary headers(thanks penguincoder)
245
+
246
+ * Bug Fixes:
247
+ * Fixed a bug with bad cookie parsing
248
+ * Form::RadioButton#click unchecks other buttons (RF #24159)
249
+ * Fixed problems with Iconv (RF #24190, RF #24192, RF #24043)
250
+ * POST parameters should be CGI escaped
251
+ * Made Content-Type match case insensitive (Thanks Kelly Reynolds)
252
+ * Non-string form parameters work
253
+
254
+ === 0.9.1 2009/02/23
255
+
256
+ * New Features:
257
+ * Encoding may be specified for a page: Page#encoding=
258
+
259
+ * Bug Fixes:
260
+ * m17n fixes. ありがとう konn!
261
+ * Fixed a problem with base tags. ありがとう Keisuke
262
+ * HEAD requests do not record in the history
263
+ * Default encoding to ISO-8859-1 instead of ASCII
264
+ * Requests with URI instances should not be polluted RF #23472
265
+ * Nonce count fixed for digest auth requests. Thanks Adrian Slapa!
266
+ * Fixed a referer issue with requests using a uri. RF #23472
267
+ * WAP content types will now be parsed
268
+ * Rescued poorly formatted cookies. Thanks Kelley Reynolds!
269
+
270
+ === 0.9.0
271
+
272
+ * Deprecations
273
+ * WWW::Mechanize::List is gone!
274
+ * Mechanize uses Nokogiri as it's HTML parser but you may switch to
275
+ Hpricot by using WWW::Mechanize.html_parser = Hpricot
276
+
277
+ * Bug Fixes:
278
+ * Nil check on page when base tag is used #23021
279
+
280
+ === 0.8.5
281
+
282
+ * Deprecations
283
+ * WWW::Mechanize::List will be deprecated in 0.9.0, and warnings have
284
+ been added to help you upgrade.
285
+
286
+ * Bug Fixes:
287
+ * Stopped raising EOF exceptions on HEAD requests. ありがとう:HIRAKU Kuroda
288
+ * Fixed exceptions when a logger is set and file:// requests are made.
289
+ * Made Mechanize 1.9 compatible
290
+ * Not setting the port in the host header for SSL sites.
291
+ * Following refresh headers. Thanks Tim Connor!
292
+ * Cookie Jar handles cookie domains containing ports, like
293
+ 'mydomain.com:443' (Thanks Michal Ochman!)
294
+ * Fixing strange uri escaping problems [#22604]
295
+ * Making content-type determintation more robust. (thanks Han Holl!)
296
+ * Dealing with links that are query string only. [#22402]
297
+ * Nokogiri may be dropped in as a replacement.
298
+ WWW::Mechanize.html_parser = Nokogiri::HTML
299
+ * Making sure the correct page is added to the history on meta refresh.
300
+ [#22708]
301
+ * Mechanize#get requests no longer send a referer unless they are relative
302
+ requests.
303
+
304
+ === 0.8.4
305
+
306
+ * Bug Fixes:
307
+ * Setting the port number on the host header.
308
+ * Fixing Authorization headers for picky servers
309
+
310
+ === 0.8.3
311
+
312
+ * Bug Fixes:
313
+ * Making sure logger is set during SSL connections.
314
+
315
+ === 0.8.2
316
+
317
+ * Bug Fixes:
318
+ * Doh! I was accidentally setting headers twice.
319
+
320
+ === 0.8.1
321
+
322
+ * Bug Fixes:
323
+ * Fixed problem with nil pointer when logger is set
324
+
325
+ === 0.8.0
326
+
327
+ * New Features:
328
+ * Lifecycle hooks. Mechanize#pre_connect_hooks, Mechanize#post_connect_hooks
329
+ * file:/// urls are now supported
330
+ * Added Mechanize::Page#link_with, frame_with for searching for links using
331
+ +criteria+.
332
+ * Implementing PUT, DELETE, and HEAD requests
333
+
334
+ * Bug Fixes:
335
+ * Fixed an infinite loop when content-length and body length don't match.
336
+ * Only setting headers once
337
+ * Adding IIS authentication support
338
+
339
+ === 0.7.8
340
+
341
+ * Bug Fixes:
342
+ * Fixed bug when receiving a 304 response (HTTPNotModified) on a page not
343
+ cached in history.
344
+ * #21428 Default to HTML parser for 'application/xhtml+xml' content-type.
345
+ * Fixed an issue where redirects were resending posted data
346
+
347
+ === 0.7.7
348
+
349
+ * New Features:
350
+ * Page#form_with takes a +criteria+ hash.
351
+ * Page#form is changed to Page#form_with
352
+ * Mechanize#get takes custom http headers. Thanks Mike Dalessio!
353
+ * Form#click_button submits a form defaulting to the current button.
354
+ * Form#set_fields now takes a hash. Thanks Tobi!
355
+ * Mechanize#redirection_limit= for setting the max number of redirects.
356
+
357
+ * Bug Fixes:
358
+ * Added more examples. Thanks Robert Jackson.
359
+ * #20480 Making sure the Host header is set.
360
+ * #20672 Making sure cookies with weird semicolons work.
361
+ * Fixed bug with percent signs in urls.
362
+ http://d.hatena.ne.jp/kitamomonga/20080410/ruby_mechanize_percent_url_bug
363
+ * #21132 Not checking for EOF errors on redirect
364
+ * Fixed a weird gzipping error.
365
+ * #21233 Smarter multipart boundry. Thanks Todd Willey!
366
+ * #20097 Supporting meta tag cookies.
367
+
368
+ === 0.7.6
369
+
370
+ * New Features:
371
+ * Added support for reading Mozilla cookie jars. Thanks Chris Riddoch!
372
+ * Moving text, password, hidden, int to default. Thanks Tim Harper!
373
+ * Mechanize#history_added callback for page loads. Thanks Tobi Reif!
374
+ * Mechanize#scheme_handlers callbacks for handling unsupported schemes on
375
+ links.
376
+
377
+ * Bug Fixes:
378
+ * Ignoring scheme case
379
+ http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=470642
380
+ * Not encoding tildes in uris. Thanks Bruno. [#19380]
381
+ * Resetting request bodys when retrying form posts. Thanks Bruno. [#19379]
382
+ * Throwing away keep alive connections on EPIPE and ECONNRESET.
383
+ * Duplicating request headers when retrying a 401. Thanks Hiroshi Ichikawa.
384
+ * Simulating an EOF error when a response length is bad. Thanks Tobias Gruetzmacher.
385
+ http://rubyforge.org/tracker/index.php?func=detail&aid=19178&group_id=1453&atid=5711
386
+ * Defaulting option tags to the inner text.
387
+ http://rubyforge.org/tracker/index.php?func=detail&aid=19976&group_id=1453&atid=5709
388
+ * Supporting blank strings for option values.
389
+ http://rubyforge.org/tracker/index.php?func=detail&aid=19975&group_id=1453&atid=5709
390
+
391
+ === 0.7.5
392
+
393
+ * Fixed a bug when fetching files and not pages. Thanks Mat Schaffer!
394
+
395
+ === 0.7.4
396
+
397
+ * doh!
398
+
399
+ === 0.7.3
400
+
401
+ * Pages are now yielded to a blocks given to WWW::Mechanize#get
402
+ * WWW::Mechanize#get now takes hash arguments for uri parameters.
403
+ * WWW::Mechanize#post takes an IO object as a parameter and posts correctly.
404
+ * Fixing a strange zlib inflate problem on windows
405
+
406
+ === 0.7.2
407
+
408
+ * Handling gzipped responses with no Content-Length header
409
+
410
+ === 0.7.1
411
+
412
+ * Added iPhone to the user agent aliases. [#17572]
413
+ * Fixed a bug with EOF errors in net/http. [#17570]
414
+ * Handling 0 length gzipped responses. [#17471]
415
+
416
+ === 0.7.0
417
+
418
+ * Removed Ruby 1.8.2 support
419
+ * Changed parser to lazily parse links
420
+ * Lazily parsing document
421
+ * Adding verify_callback for SSL requests. Thanks Mike Dalessio!
422
+ * Fixed a bug with Accept-Language header. Thanks Bill Siggelkow.
423
+
424
+ === 0.6.11
425
+
426
+ * Detecting single quotes in meta redirects.
427
+ * Adding pretty inspect for ruby versions > 1.8.4 (Thanks Joel Kociolek)
428
+ http://rubyforge.org/tracker/index.php?func=detail&aid=13150&group_id=1453&atid=5709
429
+ * Fixed bug with file name in multipart posts
430
+ http://rubyforge.org/tracker/?func=detail&aid=15594&group_id=1453&atid=5709
431
+ * Posting forms relative to the originating page. Thanks Mortee.
432
+ * Added a FAQ
433
+ http://rubyforge.org/tracker/?func=detail&aid=15772&group_id=1453&atid=5709
434
+
435
+ === 0.6.10
436
+
437
+ * Made digest authentication work with POSTs.
438
+ * Made sure page was HTML before following meta refreshes.
439
+ http://rubyforge.org/tracker/index.php?func=detail&aid=12260&group_id=1453&atid=5709
440
+ * Made sure that URLS with a host and no path would default to '/' for history
441
+ purposes.
442
+ http://rubyforge.org/tracker/index.php?func=detail&aid=12368&group_id=1453&atid=5709
443
+ * Avoiding memory leaks with transact. Thanks Tobias Gruetzmacher!
444
+ http://rubyforge.org/tracker/index.php?func=detail&aid=12057&group_id=1453&atid=5711
445
+ * Fixing a problem with # signs in the file name. Thanks Tobias Gruetzmacher!
446
+ http://rubyforge.org/tracker/index.php?func=detail&aid=12510&group_id=1453&atid=5711
447
+ * Made sure that blank form values are submitted.
448
+ http://rubyforge.org/tracker/index.php?func=detail&aid=12505&group_id=1453&atid=5709
449
+ * Mechanize now respects the base tag. Thanks Stephan Dale.
450
+ http://rubyforge.org/tracker/index.php?func=detail&aid=12468&group_id=1453&atid=5709
451
+ * Aliasing inspect to pretty_inspect. Thanks Eric Promislow.
452
+ http://rubyforge.org/pipermail/mechanize-users/2007-July/000157.html
453
+
454
+ === 0.6.9
455
+
456
+ * Updating UTF-8 support for urls
457
+ * Adding AREA tags to the links list.
458
+ http://rubyforge.org/pipermail/mechanize-users/2007-May/000140.html
459
+ * WWW::Mechanize#follow_meta_refresh will allow you to automatically follow
460
+ meta refresh tags. [#10032]
461
+ * Adding x-gzip to accepted content-encoding. Thanks Simon Strandgaard
462
+ http://rubyforge.org/tracker/index.php?func=detail&aid=11167&group_id=1453&atid=5711
463
+ * Added Digest Authentication support. Thanks to Ryan Davis and Eric Hodel,
464
+ you get a gold star!
465
+
466
+ === 0.6.8
467
+
468
+ * Keep alive can be shut off now with WWW::Mechanize#keep_alive
469
+ * Conditional requests can be shut off with WWW::Mechanize#conditional_requests
470
+ * Monkey patched Net::HTTP#keep_alive?
471
+ * [#9877] Moved last request time. Thanks Max Stepanov
472
+ * Added WWW::Mechanize::File#save
473
+ * Defaulting file name to URI or Content-Disposition
474
+ * Updating compatability with hpricot
475
+ * Added more unit tests
476
+
477
+ === 0.6.7
478
+
479
+ * Fixed a bug with keep-alive requests
480
+ * [#9549] fixed problem with cookie paths
481
+
482
+ === 0.6.6
483
+
484
+ * Removing hpricot overrides
485
+ * Fixed a bug where alt text can be nil. Thanks Yannick!
486
+ * Unparseable expiration dates in cookies are now treated as session cookies
487
+ * Caching connections
488
+ * Requests now default to keep alive
489
+ * [#9434] Fixed bug where html entities weren't decoded
490
+ * [#9150] Updated mechanize history to deal with redirects
491
+
492
+ === 0.6.5
493
+
494
+ * Copying headers to a hash to prevent memory leaks
495
+ * Speeding up page parsing
496
+ * Aliased fields to elements
497
+ * Adding If-Modified-Since header
498
+ * Added delete_field! to form. Thanks to Sava Chankov
499
+ * Updated uri escaping to support high order characters. Thanks to Henrik Nyh.
500
+ * Better handling relative URIs. Thanks to Henrik Nyh
501
+ * Now handles pipes in URLs
502
+ http://rubyforge.org/tracker/?func=detail&aid=7140&group_id=1453&atid=5709
503
+ * Now escaping html entities in form fields.
504
+ http://rubyforge.org/tracker/?func=detail&aid=7563&group_id=1453&atid=5709
505
+ * Added MSIE 7.0 user agent string
506
+
507
+ === 0.6.4
508
+
509
+ * Adding the "redirect_ok" method to Mechanize to stop mechanize from
510
+ following redirects.
511
+ http://rubyforge.org/tracker/index.php?func=detail&aid=6571&group_id=1453&atid=5712
512
+ * Added protected method Mechanize#set_headers so that subclasses can set
513
+ custom headers.
514
+ http://rubyforge.org/tracker/?func=detail&aid=7208&group_id=1453&atid=5712
515
+ * Aliased Page#referer to Page#page
516
+ * Fixed a bug when clicking relative urls
517
+ http://rubyforge.org/pipermail/mechanize-users/2006-November/000035.html
518
+ * Fixing a bug when bad version or max age is passed to Cookie::parse
519
+ http://rubyforge.org/pipermail/mechanize-users/2006-November/000033.html
520
+ * Fixing a bug with response codes. [#6526]
521
+ * Fixed bug [#6548]. Input type of 'button' was not being added as a button.
522
+ * Fixed bug [#7139]. REXML parser calls hpricot parser by accident
523
+
524
+ === 0.6.3
525
+
526
+ * Added keys and values methods to Form
527
+ * Added has_value? to Form
528
+ * Added a has_field? method to Form
529
+ * The add_field! method on Form now creates a field for you on the form.
530
+ Thanks to Mat Schaffer for the patch.
531
+ http://rubyforge.org/pipermail/mechanize-users/2006-November/000025.html
532
+ * Fixed a bug when form actions have html ecoded entities in them.
533
+ http://rubyforge.org/pipermail/mechanize-users/2006-October/000019.html
534
+ * Fixed a bug when links or frame sources have html encoded entities in the
535
+ href or src.
536
+ * Fixed a bug where '#' symbols are encoded
537
+ http://rubyforge.org/forum/message.php?msg_id=14747
538
+
539
+ === 0.6.2
540
+
541
+ * Added a yield to Page#form so that dealing with forms can be more DSL like.
542
+ * Added the parsed page to the ResponseCodeError so that the parsed results
543
+ can be accessed even in the event of an error.
544
+ http://rubyforge.org/pipermail/mechanize-users/2006-September/000007.html
545
+ * Updated documentation (Thanks to Paul Smith)
546
+
547
+ === 0.6.1
548
+
549
+ * Added a method to Form called "submit". Now forms can be submitted by
550
+ calling a method on the form.
551
+ * Added a click method to links
552
+ * Added an REXML pluggable parser for backwards compatability. To use it,
553
+ just do this:
554
+ agent.pluggable_parser.html = WWW::Mechanize::REXMLPage
555
+ * Fixed a bug with referrers by adding a page attribute to forms and links.
556
+ * Fixed a bug where domain names were case sensitive.
557
+ http://tenderlovemaking.com/2006/09/04/road-to-ruby-mechanize-060/#comment-53
558
+ * Fixed a bug with URI escaped links.
559
+ http://rubyforge.org/pipermail/mechanize-users/2006-September/000002.html
560
+ * Fixed a bug when options in select lists don't have a value. Thanks Dan Higham
561
+ [#5837] Code in lib/mechanize/form_elements.rb is incorrect.
562
+ * Fixed a bug with loading text in to links.
563
+ http://rubyforge.org/pipermail/mechanize-users/2006-September/000000.html
564
+
565
+ === 0.6.0
566
+
567
+ * Changed main parser to use hpricot
568
+ * Made WWW::Mechanize::Page class searchable like hpricot
569
+ * Updated WWW::Mechanize#click to support hpricot links like this:
570
+ @agent.click (page/"a").first
571
+ * Clicking a Frame is now possible:
572
+ @agent.click (page/"frame").first
573
+ * Removed deprecated attr_finder
574
+ * Removed REXML helper methods since the main parser is now hpricot
575
+ * Overhauled cookie parser to use WEBrick::Cookie
576
+
577
+ === 0.5.4
578
+
579
+ * Added WWW::Mechanize#trasact for saving history state between in a
580
+ transaction. See the EXAMPLES file. Thanks Johan Kiviniemi.
581
+ * Added support for gzip compressed pages
582
+ * Forms can now be accessed like a hash. For example, to set the value
583
+ of an input field named 'name' to "Aaron", you can do this:
584
+ form['name'] = "Aaron"
585
+ Or to get the value of a field named 'name', do this:
586
+ puts form['name']
587
+ * File uploads will now read the file specified in FileUpload#file_name
588
+ * FileUpload can use an IO object in FileUpload#file_data
589
+ * Fixed a bug with saving files on windows
590
+ * Fixed a bug with the filename being set in forms
591
+
592
+ === 0.5.3
593
+
594
+ * Mechanize#click will now act on the first element of an array. So if an
595
+ array of links is passed to WWW::Mechanize#click, the first link is clicked.
596
+ That means the syntax for clicking links is shortened and still supports
597
+ selecting a link. The following are equivalent:
598
+ agent.click page.links.first
599
+ agent.click page.links
600
+ * Fixed a bug with spaces in href's and get's
601
+ * Added a tick, untick, and click method to radio buttons so that
602
+ radiobuttons can be "clicked"
603
+ * Added a tick, untick, and click method to check boxes so that
604
+ checkboxes can be "clicked"
605
+ * Options on Select lists can now be "tick"ed, and "untick"ed.
606
+ * Fixed a potential bug conflicting with rails. Thanks Eric Kolve
607
+ * Updated log4r support for a speed increase. Thanks Yinon Bentor
608
+ * Added inspect methods and pretty printing
609
+
610
+ === 0.5.2
611
+
612
+ * Fixed a bug with input names that are nil
613
+ * Added a warning when using attr_finder because attr_finder will be deprecated
614
+ in 0.6.0 in favor of method calls. So this syntax:
615
+ @agent.links(:text => 'foo')
616
+ should be changed to this:
617
+ @agent.links.text('foo')
618
+ * Added support for selecting multiple options in select tags that support
619
+ multiple options. See WWW::Mechanize::MultiSelectList.
620
+ * New select list methods have been added, select_all, select_none.
621
+ * Options for select lists can now be "clicked" which toggles their selection,
622
+ they can be "selected" and "unselected". See WWW::Mechanize::Option
623
+ * Added a method to set multiple fields at the same time,
624
+ WWW::Mechanize::Form#set_fields. Which can be used like so:
625
+ form.set_fields( :foo => 'bar', :name => 'Aaron' )
626
+
627
+ === 0.5.1
628
+
629
+ * Fixed bug with file uploads
630
+ * Added performance tweaks to the cookie class
631
+
632
+ === 0.5.0
633
+
634
+ * Added pluggable parsers. (Thanks to Eric Kolve for the idea)
635
+ * Changed namespace so all classes are under WWW::Mechanize.
636
+ * Updating Forms so that fields can be used as accessors (Thanks Gregory Brown)
637
+ * Added WWW::Mechanize::File as default object used for unknown content types.
638
+ * Added 'save_as' method to Mechanize::File, so any page can be saved.
639
+ * Adding 'save_as' and 'load' to CookieJar so that cookies can be saved
640
+ between sessions.
641
+ * Added WWW::Mechanize::FileSaver pluggable parser to automatically save files.
642
+ * Added WWW::Mechanize::Page#title for page titles
643
+ * Added OpenSSL certificate support (Thanks Mike Dalessio)
644
+ * Removed support for body filters in favor of pluggable parsers.
645
+ * Fixed cookie bug adding a '/' when the url is missing one (Thanks Nick Dainty)
646
+
647
+ === 0.4.7
648
+
649
+ * Fixed bug with no action in forms. Thanks to Adam Wiggins
650
+ * Setting a default user-agent string
651
+ * Added house cleaning to the cookie jar so expired cookies don't stick around.
652
+ * Added new method WWW::Form#field to find the first field with a given name.
653
+ (thanks to Gregory Brown)
654
+ * Added WWW::Mechanize#get_file for fetching non text/html files
655
+
656
+ === 0.4.6
657
+
658
+ * Added support for proxies
659
+ * Added a uri field to WWW::Link
660
+ * Added a error class WWW::Mechanize::ContentTypeError
661
+ * Added image alt text to link text
662
+ * Added an visited? method to WWW::Mechanize
663
+ * Added Array#value= which will set the first value to the argument. That
664
+ allows syntax as such: form.fields.name('q').value = 'xyz'
665
+ Before it was like this: form.fields.name('q').first.value = 'xyz'
666
+
667
+ === 0.4.5
668
+
669
+ * Added support for multiple values of the same name
670
+ * Updated build_query_string to take an array of arrays (Thanks Michal Janeczek)
671
+ * Added WWW::Mechanize#body_filter= so that response bodies can be preprocessed
672
+ * Added WWW::Page#body_filter= so that response bodies can be preprocessed
673
+ * Added support for more date formats in the cookie parser
674
+ * Fixed a bug with empty select lists
675
+ * Fixing a problem with cookies not handling no spaces after semicolons
676
+
677
+ === 0.4.4
678
+
679
+ * Fixed error in method signature, basic_authetication is now basic_auth
680
+ * Fixed bug with encoding names in file uploads (Big thanks to Alex Young)
681
+ * Added options to the select list
682
+
683
+ === 0.4.3
684
+
685
+ * Added syntactic sugar for finding things
686
+ * Fixed bug with HttpOnly option in cookies
687
+ * Fixed a bug with cookie date parsing
688
+ * Defaulted dropdown lists to the first element
689
+ * Added unit tests
690
+
691
+ === 0.4.2
692
+
693
+ * Added support for iframes
694
+ * Made mechanize dependant on ruby-web rather than narf
695
+ * Added unit tests
696
+ * Fixed a bunch of warnings
697
+
698
+ === 0.4.1
699
+
700
+ * Added support for file uploading
701
+ * Added support for frames (Thanks Gabriel[mailto:leerbag@googlemail.com])
702
+ * Added more unit tests
703
+ * Fixed some bugs
704
+
705
+ === 0.4.0
706
+
707
+ * Added more unit tests
708
+ * Added a cookie jar with better cookie support, included expiration of cookies
709
+ and general cookie security.
710
+ * Updated mechanize to use built in net/http if ruby version is new enough.
711
+ * Added support for meta refresh tags
712
+ * Defaulted form actions to 'GET'
713
+ * Fixed various bugs
714
+ * Added more unit tests
715
+ * Added a response code exception
716
+ * Thanks to Brian Ellin (brianellin@gmail.com) for:
717
+ Added support for CA files, and support for 301 response codes
718
+