From 5cb3f3ba62bffd185b7f94850f57538658676a93 Mon Sep 17 00:00:00 2001 From: Aaron Patterson Date: Sun, 21 Dec 2008 19:21:11 -0800 Subject: [PATCH] removing hpricot, updating history --- GUIDE.txt | 8 ++-- History.txt | 10 ++++ Rakefile | 2 +- lib/www/mechanize.rb | 5 +- lib/www/mechanize/form.rb | 10 ++-- lib/www/mechanize/form/multi_select_list.rb | 2 +- lib/www/mechanize/list.rb | 52 -------------------- lib/www/mechanize/page.rb | 53 +++++++++------------ mechanize.gemspec | 32 +++++++------ 9 files changed, 61 insertions(+), 113 deletions(-) delete mode 100644 lib/www/mechanize/list.rb diff --git a/GUIDE.txt b/GUIDE.txt index 252bfdb1..da4ed94d 100644 --- a/GUIDE.txt +++ b/GUIDE.txt @@ -115,10 +115,8 @@ tell it what file name you want to upload: form.file_uploads.first.file_name = "somefile.jpg" == Scraping Data -Mechanize uses hpricot[http://code.whytheluckystiff.net/hpricot/] to parse +Mechanize uses nokogiri[http://nokogiri.rubyforge.org/] to parse html. What does this mean for you? You can treat a mechanize page like -an hpricot object. After you have used Mechanize to navigate to the page -that you need to scrape, then scrape it using hpricot methods: +an nokogiri object. After you have used Mechanize to navigate to the page +that you need to scrape, then scrape it using nokogiri methods: agent.get('http://someurl.com/').search(".//p[@class='posted']") -For more information on this powerful scraper, take a look at -HpricotBasics[http://code.whytheluckystiff.net/hpricot/wiki/HpricotBasics] diff --git a/History.txt b/History.txt index 9ac80193..b142d6ce 100644 --- a/History.txt +++ b/History.txt @@ -1,5 +1,15 @@ = Mechanize CHANGELOG +=== 0.9.0 + +* Deprecations + * WWW::Mechanize::List is gone! + * Mechanize uses Nokogiri as it's HTML parser but you may switch to + Hpricot by using WWW::Mechanize.html_parser = Hpricot + +* Bug Fixes: + * Nil check on page when base tag is used #23021 + === 0.8.5 * Deprecations diff --git a/Rakefile b/Rakefile index 3eea1818..d7f98952 100644 --- a/Rakefile +++ b/Rakefile @@ -9,7 +9,7 @@ HOE = Hoe.new('mechanize', WWW::Mechanize::VERSION) do |p| p.developer('Aaron Patterson','aaronp@rubyforge.org') p.developer('Mike Dalessio','mike.dalessio@gmail.com') p.summary = "Mechanize provides automated web-browsing" - p.extra_deps = [['hpricot', '>= 0.5.0']] + p.extra_deps = [['nokogiri', '>= 1.0.7']] end desc "Update SSL Certificate" diff --git a/lib/www/mechanize.rb b/lib/www/mechanize.rb index b2da025e..bec3e090 100644 --- a/lib/www/mechanize.rb +++ b/lib/www/mechanize.rb @@ -6,7 +6,7 @@ require 'stringio' require 'digest/md5' require 'fileutils' -require 'hpricot' +require 'nokogiri' require 'forwardable' require 'www/mechanize/util' @@ -18,7 +18,6 @@ require 'www/mechanize/cookie' require 'www/mechanize/cookie_jar' require 'www/mechanize/history' -require 'www/mechanize/list' require 'www/mechanize/form' require 'www/mechanize/pluggable_parsers' require 'www/mechanize/file_response' @@ -87,7 +86,7 @@ class Mechanize alias :follow_redirect? :redirect_ok - @html_parser = Hpricot + @html_parser = Nokogiri::HTML class << self; attr_accessor :html_parser, :log end def initialize diff --git a/lib/www/mechanize/form.rb b/lib/www/mechanize/form.rb index d1ee0242..075e5b76 100644 --- a/lib/www/mechanize/form.rb +++ b/lib/www/mechanize/form.rb @@ -232,11 +232,11 @@ def #{singular}_with criteria = {} private def parse - @fields = WWW::Mechanize::List.new - @buttons = WWW::Mechanize::List.new - @file_uploads = WWW::Mechanize::List.new - @radiobuttons = WWW::Mechanize::List.new - @checkboxes = WWW::Mechanize::List.new + @fields = [] + @buttons = [] + @file_uploads = [] + @radiobuttons = [] + @checkboxes = [] # Find all input tags form_node.search('input').each do |node| diff --git a/lib/www/mechanize/form/multi_select_list.rb b/lib/www/mechanize/form/multi_select_list.rb index d386548f..24632040 100644 --- a/lib/www/mechanize/form/multi_select_list.rb +++ b/lib/www/mechanize/form/multi_select_list.rb @@ -14,7 +14,7 @@ class MultiSelectList < Field def initialize(name, node) value = [] - @options = WWW::Mechanize::List.new + @options = [] # parse node.search('option').each do |n| diff --git a/lib/www/mechanize/list.rb b/lib/www/mechanize/list.rb deleted file mode 100644 index a4f96fe7..00000000 --- a/lib/www/mechanize/list.rb +++ /dev/null @@ -1,52 +0,0 @@ -module WWW - class Mechanize - # This class is deprecated and will be removed in Mechanize version 0.9.0 - class List < Array - @@notified = false - - # This method provides syntax sugar so that you can write expressions - # like this: - # form.fields.with.name('foo').and.href('bar.html') - # - def with - if !@@notified - $stderr.puts("WWW::Mechanize::List#with is deprecated and will be removed in Mechanize 0.9.0.") - @@notified = true - end - self - end - - def value=(arg) - if !@@notified - $stderr.puts("WWW::Mechanize::List#value= is deprecated and will be removed in Mechanize 0.9.0.") - @@notified = true - end - first().value=(arg) - end - - alias :and :with - - def respond_to?(method_sym) - first.respond_to?(method_sym) - end - - def method_missing(meth_sym, *args) - if !@@notified - $stderr.puts("WWW::Mechanize::List##{meth_sym} is deprecated and will be removed in version 0.9.0. Please use: *_with(:#{meth_sym} => #{args.first ? args.first.inspect : 'nil'})") - @@notified = true - end - if length > 0 - return first.send(meth_sym) if args.empty? - arg = args.first - if arg.class == Regexp - WWW::Mechanize::List.new(find_all { |e| e.send(meth_sym) =~ arg }) - else - WWW::Mechanize::List.new(find_all { |e| e.send(meth_sym) == arg }) - end - else - '' - end - end - end - end -end diff --git a/lib/www/mechanize/page.rb b/lib/www/mechanize/page.rb index cb555b43..b3e01188 100644 --- a/lib/www/mechanize/page.rb +++ b/lib/www/mechanize/page.rb @@ -86,56 +86,47 @@ def #{type}_with(criteria) end def links - @links ||= WWW::Mechanize::List.new( - %w{ a area }.map do |tag| - search(tag).map do |node| - Link.new(node, @mech, self) - end - end.flatten - ) + @links ||= %w{ a area }.map do |tag| + search(tag).map do |node| + Link.new(node, @mech, self) + end + end.flatten end def forms - @forms ||= WWW::Mechanize::List.new( - search('form').map do |html_form| - form = Form.new(html_form, @mech, self) - form.action ||= @uri.to_s - form - end - ) + @forms ||= search('form').map do |html_form| + form = Form.new(html_form, @mech, self) + form.action ||= @uri.to_s + form + end end def meta - @meta ||= WWW::Mechanize::List.new( - search('meta').map do |node| - next unless node['http-equiv'] && node['content'] - (equiv, content) = node['http-equiv'], node['content'] - if equiv && equiv.downcase == 'refresh' - if content && content =~ /^\d+\s*;\s*url\s*=\s*'?([^\s']+)/i - node['href'] = $1 - Meta.new(node, @mech, self) - end + @meta ||= search('meta').map do |node| + next unless node['http-equiv'] && node['content'] + (equiv, content) = node['http-equiv'], node['content'] + if equiv && equiv.downcase == 'refresh' + if content && content =~ /^\d+\s*;\s*url\s*=\s*'?([^\s']+)/i + node['href'] = $1 + Meta.new(node, @mech, self) end - end.compact - ) + end + end.compact end def bases - @bases ||= WWW::Mechanize::List.new( + @bases ||= search('base').map { |node| Base.new(node, @mech, self) } - ) end def frames - @frames ||= WWW::Mechanize::List.new( + @frames ||= search('frame').map { |node| Frame.new(node, @mech, self) } - ) end def iframes - @iframes ||= WWW::Mechanize::List.new( + @iframes ||= search('iframe').map { |node| Frame.new(node, @mech, self) } - ) end end end diff --git a/mechanize.gemspec b/mechanize.gemspec index 1c9021b1..b4b5294c 100644 --- a/mechanize.gemspec +++ b/mechanize.gemspec @@ -1,36 +1,38 @@ +# -*- encoding: utf-8 -*- + Gem::Specification.new do |s| s.name = %q{mechanize} - s.version = "0.8.3.20081002222419" + s.version = "0.8.5.20081221192100" s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version= - s.authors = ["Aaron Patterson"] - s.date = %q{2008-10-02} + s.authors = ["Aaron Patterson", "Mike Dalessio"] + s.date = %q{2008-12-21} s.description = %q{The Mechanize library is used for automating interaction with websites. Mechanize automatically stores and sends cookies, follows redirects, can follow links, and submit forms. Form fields can be populated and submitted. Mechanize also keeps track of the sites that you have visited as a history.} - s.email = %q{aaronp@rubyforge.org} - s.extra_rdoc_files = ["EXAMPLES.txt", "FAQ.txt", "GUIDE.txt", "History.txt", "LICENSE.txt", "Manifest.txt", "NOTES.txt", "README.txt"] - s.files = ["EXAMPLES.txt", "FAQ.txt", "GUIDE.txt", "History.txt", "LICENSE.txt", "Manifest.txt", "NOTES.txt", "README.txt", "Rakefile", "examples/flickr_upload.rb", "examples/mech-dump.rb", "examples/proxy_req.rb", "examples/rubyforge.rb", "examples/spider.rb", "lib/mechanize.rb", "lib/www/mechanize.rb", "lib/www/mechanize/chain.rb", "lib/www/mechanize/chain/auth_headers.rb", "lib/www/mechanize/chain/body_decoding_handler.rb", "lib/www/mechanize/chain/connection_resolver.rb", "lib/www/mechanize/chain/custom_headers.rb", "lib/www/mechanize/chain/handler.rb", "lib/www/mechanize/chain/header_resolver.rb", "lib/www/mechanize/chain/parameter_resolver.rb", "lib/www/mechanize/chain/post_connect_hook.rb", "lib/www/mechanize/chain/pre_connect_hook.rb", "lib/www/mechanize/chain/request_resolver.rb", "lib/www/mechanize/chain/response_body_parser.rb", "lib/www/mechanize/chain/response_header_handler.rb", "lib/www/mechanize/chain/response_reader.rb", "lib/www/mechanize/chain/ssl_resolver.rb", "lib/www/mechanize/chain/uri_resolver.rb", "lib/www/mechanize/content_type_error.rb", "lib/www/mechanize/cookie.rb", "lib/www/mechanize/cookie_jar.rb", "lib/www/mechanize/file.rb", "lib/www/mechanize/file_response.rb", "lib/www/mechanize/file_saver.rb", "lib/www/mechanize/form.rb", "lib/www/mechanize/form/button.rb", "lib/www/mechanize/form/check_box.rb", "lib/www/mechanize/form/field.rb", "lib/www/mechanize/form/file_upload.rb", "lib/www/mechanize/form/image_button.rb", "lib/www/mechanize/form/multi_select_list.rb", "lib/www/mechanize/form/option.rb", "lib/www/mechanize/form/radio_button.rb", "lib/www/mechanize/form/select_list.rb", "lib/www/mechanize/headers.rb", "lib/www/mechanize/history.rb", "lib/www/mechanize/inspect.rb", "lib/www/mechanize/list.rb", "lib/www/mechanize/monkey_patch.rb", "lib/www/mechanize/page.rb", "lib/www/mechanize/page/base.rb", "lib/www/mechanize/page/frame.rb", "lib/www/mechanize/page/link.rb", "lib/www/mechanize/page/meta.rb", "lib/www/mechanize/pluggable_parsers.rb", "lib/www/mechanize/redirect_limit_reached_error.rb", "lib/www/mechanize/response_code_error.rb", "lib/www/mechanize/unsupported_scheme_error.rb", "lib/www/mechanize/util.rb", "mechanize.gemspec", "test/chain/test_argument_validator.rb", "test/chain/test_custom_headers.rb", "test/chain/test_parameter_resolver.rb", "test/chain/test_request_resolver.rb", "test/chain/test_response_reader.rb", "test/data/htpasswd", "test/data/server.crt", "test/data/server.csr", "test/data/server.key", "test/data/server.pem", "test/helper.rb", "test/htdocs/alt_text.html", "test/htdocs/bad_form_test.html", "test/htdocs/button.jpg", "test/htdocs/empty_form.html", "test/htdocs/file_upload.html", "test/htdocs/find_link.html", "test/htdocs/form_multi_select.html", "test/htdocs/form_multival.html", "test/htdocs/form_no_action.html", "test/htdocs/form_no_input_name.html", "test/htdocs/form_select.html", "test/htdocs/form_select_all.html", "test/htdocs/form_select_none.html", "test/htdocs/form_select_noopts.html", "test/htdocs/form_set_fields.html", "test/htdocs/form_test.html", "test/htdocs/frame_test.html", "test/htdocs/google.html", "test/htdocs/iframe_test.html", "test/htdocs/index.html", "test/htdocs/link with space.html", "test/htdocs/meta_cookie.html", "test/htdocs/no_title_test.html", "test/htdocs/relative/tc_relative_links.html", "test/htdocs/tc_bad_links.html", "test/htdocs/tc_base_link.html", "test/htdocs/tc_blank_form.html", "test/htdocs/tc_checkboxes.html", "test/htdocs/tc_encoded_links.html", "test/htdocs/tc_follow_meta.html", "test/htdocs/tc_form_action.html", "test/htdocs/tc_links.html", "test/htdocs/tc_no_attributes.html", "test/htdocs/tc_pretty_print.html", "test/htdocs/tc_radiobuttons.html", "test/htdocs/tc_referer.html", "test/htdocs/tc_relative_links.html", "test/htdocs/tc_textarea.html", "test/htdocs/unusual______.html", "test/servlets.rb", "test/ssl_server.rb", "test/test_authenticate.rb", "test/test_bad_links.rb", "test/test_blank_form.rb", "test/test_checkboxes.rb", "test/test_content_type.rb", "test/test_cookie_class.rb", "test/test_cookie_jar.rb", "test/test_cookies.rb", "test/test_encoded_links.rb", "test/test_errors.rb", "test/test_follow_meta.rb", "test/test_form_action.rb", "test/test_form_as_hash.rb", "test/test_form_button.rb", "test/test_form_no_inputname.rb", "test/test_forms.rb", "test/test_frames.rb", "test/test_get_headers.rb", "test/test_gzipping.rb", "test/test_hash_api.rb", "test/test_history.rb", "test/test_history_added.rb", "test/test_html_unscape_forms.rb", "test/test_if_modified_since.rb", "test/test_keep_alive.rb", "test/test_links.rb", "test/test_mech.rb", "test/test_mechanize_file.rb", "test/test_multi_select.rb", "test/test_no_attributes.rb", "test/test_option.rb", "test/test_page.rb", "test/test_pluggable_parser.rb", "test/test_post_form.rb", "test/test_pretty_print.rb", "test/test_radiobutton.rb", "test/test_redirect_limit_reached.rb", "test/test_referer.rb", "test/test_relative_links.rb", "test/test_response_code.rb", "test/test_save_file.rb", "test/test_scheme.rb", "test/test_select.rb", "test/test_select_all.rb", "test/test_select_none.rb", "test/test_select_noopts.rb", "test/test_set_fields.rb", "test/test_ssl_server.rb", "test/test_subclass.rb", "test/test_textarea.rb", "test/test_upload.rb", "test/test_verbs.rb"] + s.email = ["aaronp@rubyforge.org", "mike.dalessio@gmail.com"] + s.extra_rdoc_files = ["EXAMPLES.txt", "FAQ.txt", "GUIDE.txt", "History.txt", "LICENSE.txt", "Manifest.txt", "README.txt"] + s.files = ["EXAMPLES.txt", "FAQ.txt", "GUIDE.txt", "History.txt", "LICENSE.txt", "Manifest.txt", "README.txt", "Rakefile", "examples/flickr_upload.rb", "examples/mech-dump.rb", "examples/proxy_req.rb", "examples/rubyforge.rb", "examples/spider.rb", "lib/mechanize.rb", "lib/www/mechanize.rb", "lib/www/mechanize/chain.rb", "lib/www/mechanize/chain/auth_headers.rb", "lib/www/mechanize/chain/body_decoding_handler.rb", "lib/www/mechanize/chain/connection_resolver.rb", "lib/www/mechanize/chain/custom_headers.rb", "lib/www/mechanize/chain/handler.rb", "lib/www/mechanize/chain/header_resolver.rb", "lib/www/mechanize/chain/parameter_resolver.rb", "lib/www/mechanize/chain/post_connect_hook.rb", "lib/www/mechanize/chain/pre_connect_hook.rb", "lib/www/mechanize/chain/request_resolver.rb", "lib/www/mechanize/chain/response_body_parser.rb", "lib/www/mechanize/chain/response_header_handler.rb", "lib/www/mechanize/chain/response_reader.rb", "lib/www/mechanize/chain/ssl_resolver.rb", "lib/www/mechanize/chain/uri_resolver.rb", "lib/www/mechanize/content_type_error.rb", "lib/www/mechanize/cookie.rb", "lib/www/mechanize/cookie_jar.rb", "lib/www/mechanize/file.rb", "lib/www/mechanize/file_response.rb", "lib/www/mechanize/file_saver.rb", "lib/www/mechanize/form.rb", "lib/www/mechanize/form/button.rb", "lib/www/mechanize/form/check_box.rb", "lib/www/mechanize/form/field.rb", "lib/www/mechanize/form/file_upload.rb", "lib/www/mechanize/form/image_button.rb", "lib/www/mechanize/form/multi_select_list.rb", "lib/www/mechanize/form/option.rb", "lib/www/mechanize/form/radio_button.rb", "lib/www/mechanize/form/select_list.rb", "lib/www/mechanize/headers.rb", "lib/www/mechanize/history.rb", "lib/www/mechanize/inspect.rb", "lib/www/mechanize/list.rb", "lib/www/mechanize/monkey_patch.rb", "lib/www/mechanize/page.rb", "lib/www/mechanize/page/base.rb", "lib/www/mechanize/page/frame.rb", "lib/www/mechanize/page/link.rb", "lib/www/mechanize/page/meta.rb", "lib/www/mechanize/pluggable_parsers.rb", "lib/www/mechanize/redirect_limit_reached_error.rb", "lib/www/mechanize/redirect_not_get_or_head_error.rb", "lib/www/mechanize/response_code_error.rb", "lib/www/mechanize/unsupported_scheme_error.rb", "lib/www/mechanize/util.rb", "mechanize.gemspec", "test/chain/test_argument_validator.rb", "test/chain/test_custom_headers.rb", "test/chain/test_parameter_resolver.rb", "test/chain/test_request_resolver.rb", "test/chain/test_response_reader.rb", "test/data/htpasswd", "test/data/server.crt", "test/data/server.csr", "test/data/server.key", "test/data/server.pem", "test/helper.rb", "test/htdocs/alt_text.html", "test/htdocs/bad_form_test.html", "test/htdocs/button.jpg", "test/htdocs/empty_form.html", "test/htdocs/file_upload.html", "test/htdocs/find_link.html", "test/htdocs/form_multi_select.html", "test/htdocs/form_multival.html", "test/htdocs/form_no_action.html", "test/htdocs/form_no_input_name.html", "test/htdocs/form_select.html", "test/htdocs/form_select_all.html", "test/htdocs/form_select_none.html", "test/htdocs/form_select_noopts.html", "test/htdocs/form_set_fields.html", "test/htdocs/form_test.html", "test/htdocs/frame_test.html", "test/htdocs/google.html", "test/htdocs/iframe_test.html", "test/htdocs/index.html", "test/htdocs/link with space.html", "test/htdocs/meta_cookie.html", "test/htdocs/no_title_test.html", "test/htdocs/relative/tc_relative_links.html", "test/htdocs/tc_bad_links.html", "test/htdocs/tc_base_link.html", "test/htdocs/tc_blank_form.html", "test/htdocs/tc_checkboxes.html", "test/htdocs/tc_encoded_links.html", "test/htdocs/tc_follow_meta.html", "test/htdocs/tc_form_action.html", "test/htdocs/tc_links.html", "test/htdocs/tc_no_attributes.html", "test/htdocs/tc_pretty_print.html", "test/htdocs/tc_radiobuttons.html", "test/htdocs/tc_referer.html", "test/htdocs/tc_relative_links.html", "test/htdocs/tc_textarea.html", "test/htdocs/unusual______.html", "test/servlets.rb", "test/ssl_server.rb", "test/test_authenticate.rb", "test/test_bad_links.rb", "test/test_blank_form.rb", "test/test_checkboxes.rb", "test/test_content_type.rb", "test/test_cookie_class.rb", "test/test_cookie_jar.rb", "test/test_cookies.rb", "test/test_encoded_links.rb", "test/test_errors.rb", "test/test_follow_meta.rb", "test/test_form_action.rb", "test/test_form_as_hash.rb", "test/test_form_button.rb", "test/test_form_no_inputname.rb", "test/test_forms.rb", "test/test_frames.rb", "test/test_get_headers.rb", "test/test_gzipping.rb", "test/test_hash_api.rb", "test/test_history.rb", "test/test_history_added.rb", "test/test_html_unscape_forms.rb", "test/test_if_modified_since.rb", "test/test_keep_alive.rb", "test/test_links.rb", "test/test_mech.rb", "test/test_mechanize_file.rb", "test/test_multi_select.rb", "test/test_no_attributes.rb", "test/test_option.rb", "test/test_page.rb", "test/test_pluggable_parser.rb", "test/test_post_form.rb", "test/test_pretty_print.rb", "test/test_radiobutton.rb", "test/test_redirect_limit_reached.rb", "test/test_redirect_verb_handling.rb", "test/test_referer.rb", "test/test_relative_links.rb", "test/test_response_code.rb", "test/test_save_file.rb", "test/test_scheme.rb", "test/test_select.rb", "test/test_select_all.rb", "test/test_select_none.rb", "test/test_select_noopts.rb", "test/test_set_fields.rb", "test/test_ssl_server.rb", "test/test_subclass.rb", "test/test_textarea.rb", "test/test_upload.rb", "test/test_verbs.rb"] s.has_rdoc = true s.homepage = %q{ http://mechanize.rubyforge.org/} s.rdoc_options = ["--main", "README.txt"] s.require_paths = ["lib"] s.rubyforge_project = %q{mechanize} - s.rubygems_version = %q{1.2.0} + s.rubygems_version = %q{1.3.1} s.summary = %q{Mechanize provides automated web-browsing} - s.test_files = ["test/chain/test_argument_validator.rb", "test/chain/test_custom_headers.rb", "test/chain/test_parameter_resolver.rb", "test/chain/test_request_resolver.rb", "test/chain/test_response_reader.rb", "test/test_authenticate.rb", "test/test_bad_links.rb", "test/test_blank_form.rb", "test/test_checkboxes.rb", "test/test_content_type.rb", "test/test_cookie_class.rb", "test/test_cookie_jar.rb", "test/test_cookies.rb", "test/test_encoded_links.rb", "test/test_errors.rb", "test/test_follow_meta.rb", "test/test_form_action.rb", "test/test_form_as_hash.rb", "test/test_form_button.rb", "test/test_form_no_inputname.rb", "test/test_forms.rb", "test/test_frames.rb", "test/test_get_headers.rb", "test/test_gzipping.rb", "test/test_hash_api.rb", "test/test_history.rb", "test/test_history_added.rb", "test/test_html_unscape_forms.rb", "test/test_if_modified_since.rb", "test/test_keep_alive.rb", "test/test_links.rb", "test/test_mech.rb", "test/test_mechanize_file.rb", "test/test_multi_select.rb", "test/test_no_attributes.rb", "test/test_option.rb", "test/test_page.rb", "test/test_pluggable_parser.rb", "test/test_post_form.rb", "test/test_pretty_print.rb", "test/test_radiobutton.rb", "test/test_redirect_limit_reached.rb", "test/test_referer.rb", "test/test_relative_links.rb", "test/test_response_code.rb", "test/test_save_file.rb", "test/test_scheme.rb", "test/test_select.rb", "test/test_select_all.rb", "test/test_select_none.rb", "test/test_select_noopts.rb", "test/test_set_fields.rb", "test/test_ssl_server.rb", "test/test_subclass.rb", "test/test_textarea.rb", "test/test_upload.rb", "test/test_verbs.rb"] + s.test_files = ["test/chain/test_argument_validator.rb", "test/chain/test_custom_headers.rb", "test/chain/test_parameter_resolver.rb", "test/chain/test_request_resolver.rb", "test/chain/test_response_reader.rb", "test/test_authenticate.rb", "test/test_bad_links.rb", "test/test_blank_form.rb", "test/test_checkboxes.rb", "test/test_content_type.rb", "test/test_cookie_class.rb", "test/test_cookie_jar.rb", "test/test_cookies.rb", "test/test_encoded_links.rb", "test/test_errors.rb", "test/test_follow_meta.rb", "test/test_form_action.rb", "test/test_form_as_hash.rb", "test/test_form_button.rb", "test/test_form_no_inputname.rb", "test/test_forms.rb", "test/test_frames.rb", "test/test_get_headers.rb", "test/test_gzipping.rb", "test/test_hash_api.rb", "test/test_history.rb", "test/test_history_added.rb", "test/test_html_unscape_forms.rb", "test/test_if_modified_since.rb", "test/test_keep_alive.rb", "test/test_links.rb", "test/test_mech.rb", "test/test_mechanize_file.rb", "test/test_multi_select.rb", "test/test_no_attributes.rb", "test/test_option.rb", "test/test_page.rb", "test/test_pluggable_parser.rb", "test/test_post_form.rb", "test/test_pretty_print.rb", "test/test_radiobutton.rb", "test/test_redirect_limit_reached.rb", "test/test_redirect_verb_handling.rb", "test/test_referer.rb", "test/test_relative_links.rb", "test/test_response_code.rb", "test/test_save_file.rb", "test/test_scheme.rb", "test/test_select.rb", "test/test_select_all.rb", "test/test_select_none.rb", "test/test_select_noopts.rb", "test/test_set_fields.rb", "test/test_ssl_server.rb", "test/test_subclass.rb", "test/test_textarea.rb", "test/test_upload.rb", "test/test_verbs.rb"] if s.respond_to? :specification_version then current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION s.specification_version = 2 - if current_version >= 3 then - s.add_runtime_dependency(%q, [">= 0.5.0"]) - s.add_development_dependency(%q, [">= 1.7.0"]) + if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then + s.add_runtime_dependency(%q, [">= 1.0.7"]) + s.add_development_dependency(%q, [">= 1.8.2"]) else - s.add_dependency(%q, [">= 0.5.0"]) - s.add_dependency(%q, [">= 1.7.0"]) + s.add_dependency(%q, [">= 1.0.7"]) + s.add_dependency(%q, [">= 1.8.2"]) end else - s.add_dependency(%q, [">= 0.5.0"]) - s.add_dependency(%q, [">= 1.7.0"]) + s.add_dependency(%q, [">= 1.0.7"]) + s.add_dependency(%q, [">= 1.8.2"]) end end