aai10-mechanize 2.0.1.0

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