Files | Admin

Notes:

Release Name: mechanize-0.5.2

Notes: = Mechanize Release Notes == 0.5.2 This release comes with a few cool new features. First, support for select lists which are "multi" has been added. This means that you can select multiple values for a select list that has the "multiple" attribute. See WWW::Mechanize::MultiSelectList for more information. New methods for select lists have been added. You can use the select_all method to select all options and select_none to select none to select no options. Options can now be "selected" which selects an option, "unselected", which unselects an option, and "clicked" which toggles the current status of the option. What this means is that instead of having to select the first option like this: select_list.value = select_list.options.first.value You can select the first option by just saying this: select_list.options.first.select Of course you can still set the select list to an arbitrary value by just setting the value of the select list. A new method has been added to Form so that multiple fields can be set at the same time. To set 'foo', and 'name' at the same time on the form, you can do the following: form.set_fields( :foo => 'bar', :name => 'Aaron' ) Or to set the second fields named 'name' you can do the following: form.set_fields( :name => ['Aaron', 1] ) Finally, attr_finder has been deprecated, and all syntax like this: @agent.links(:text => 'foo') needs to be changed to: @agent.links.text('foo') With this release you will just get a warning, and the code will be removed in 0.6.0.


Changes: = Mechanize CHANGELOG == 0.5.2 * Fixed a bug with input names that are nil * Added a warning when using attr_finder because attr_finder will be deprecated in 0.6.0 in favor of method calls. So this syntax: @agent.links(:text => 'foo') should be changed to this: @agent.links.text('foo') * Added support for selecting multiple options in select tags that support multiple options. See WWW::Mechanize::MultiSelectList. * New select list methods have been added, select_all, select_none. * Options for select lists can now be "clicked" which toggles their selection, they can be "selected" and "unselected". See WWW::Mechanize::Option * Added a method to set multiple fields at the same time, WWW::Mechanize::Form#set_fields. Which can be used like so: form.set_fields( :foo => 'bar', :name => 'Aaron' )