neocoin-mechanize 2.0.2

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