akamai_bookmarklet 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.document +5 -0
- data/.gitignore +21 -0
- data/Gemfile +3 -0
- data/LICENSE +20 -0
- data/README.rdoc +17 -0
- data/Rakefile +53 -0
- data/VERSION +1 -0
- data/bin/nokogiri +3 -0
- data/bin/rackup +3 -0
- data/config.ru +6 -0
- data/lib/akamai_bookmarklet.rb +2 -0
- data/lib/application/application.rb +34 -0
- data/lib/application/views/bookmarklet.html.erb +22 -0
- data/lib/application/views/purge.js.erb +32 -0
- data/test/helper.rb +10 -0
- data/test/test_akamai_bookmarklet.rb +7 -0
- data/vendor/gems/environment.rb +4 -0
- data/vendor/gems/ruby/1.8/cache/akamai-0.0.1.gem +0 -0
- data/vendor/gems/ruby/1.8/cache/casrack_the_authenticator-1.6.0.gem +0 -0
- data/vendor/gems/ruby/1.8/cache/nokogiri-1.3.3.gem +0 -0
- data/vendor/gems/ruby/1.8/cache/rack-1.1.0.gem +0 -0
- data/vendor/gems/ruby/1.8/cache/sinatra-0.9.4.gem +0 -0
- data/vendor/gems/ruby/1.8/environment.rb +112 -0
- data/vendor/gems/ruby/1.8/gems/akamai-0.0.1/.document +5 -0
- data/vendor/gems/ruby/1.8/gems/akamai-0.0.1/.gitignore +21 -0
- data/vendor/gems/ruby/1.8/gems/akamai-0.0.1/LICENSE +20 -0
- data/vendor/gems/ruby/1.8/gems/akamai-0.0.1/README.rdoc +17 -0
- data/vendor/gems/ruby/1.8/gems/akamai-0.0.1/Rakefile +53 -0
- data/vendor/gems/ruby/1.8/gems/akamai-0.0.1/VERSION +1 -0
- data/vendor/gems/ruby/1.8/gems/akamai-0.0.1/lib/akamai.rb +54 -0
- data/vendor/gems/ruby/1.8/gems/akamai-0.0.1/test/helper.rb +10 -0
- data/vendor/gems/ruby/1.8/gems/akamai-0.0.1/test/test_akamai.rb +7 -0
- data/vendor/gems/ruby/1.8/gems/casrack_the_authenticator-1.6.0/.gitignore +3 -0
- data/vendor/gems/ruby/1.8/gems/casrack_the_authenticator-1.6.0/README.rdoc +87 -0
- data/vendor/gems/ruby/1.8/gems/casrack_the_authenticator-1.6.0/Rakefile +7 -0
- data/vendor/gems/ruby/1.8/gems/casrack_the_authenticator-1.6.0/VERSION +1 -0
- data/vendor/gems/ruby/1.8/gems/casrack_the_authenticator-1.6.0/casrack_the_authenticator.gemspec +83 -0
- data/vendor/gems/ruby/1.8/gems/casrack_the_authenticator-1.6.0/developer_tasks/doc.rake +22 -0
- data/vendor/gems/ruby/1.8/gems/casrack_the_authenticator-1.6.0/developer_tasks/gem.rake +20 -0
- data/vendor/gems/ruby/1.8/gems/casrack_the_authenticator-1.6.0/developer_tasks/test.rake +24 -0
- data/vendor/gems/ruby/1.8/gems/casrack_the_authenticator-1.6.0/features/fake.feature +34 -0
- data/vendor/gems/ruby/1.8/gems/casrack_the_authenticator-1.6.0/features/require_cas.feature +19 -0
- data/vendor/gems/ruby/1.8/gems/casrack_the_authenticator-1.6.0/features/simple.feature +32 -0
- data/vendor/gems/ruby/1.8/gems/casrack_the_authenticator-1.6.0/features/step_definitions/fake_cas_steps.rb +14 -0
- data/vendor/gems/ruby/1.8/gems/casrack_the_authenticator-1.6.0/features/step_definitions/rack_steps.rb +69 -0
- data/vendor/gems/ruby/1.8/gems/casrack_the_authenticator-1.6.0/features/support/assertions.rb +3 -0
- data/vendor/gems/ruby/1.8/gems/casrack_the_authenticator-1.6.0/features/support/rack_support.rb +89 -0
- data/vendor/gems/ruby/1.8/gems/casrack_the_authenticator-1.6.0/lib/casrack_the_authenticator/configuration.rb +88 -0
- data/vendor/gems/ruby/1.8/gems/casrack_the_authenticator-1.6.0/lib/casrack_the_authenticator/fake.rb +49 -0
- data/vendor/gems/ruby/1.8/gems/casrack_the_authenticator-1.6.0/lib/casrack_the_authenticator/require_cas.rb +36 -0
- data/vendor/gems/ruby/1.8/gems/casrack_the_authenticator-1.6.0/lib/casrack_the_authenticator/service_ticket_validator.rb +55 -0
- data/vendor/gems/ruby/1.8/gems/casrack_the_authenticator-1.6.0/lib/casrack_the_authenticator/simple.rb +82 -0
- data/vendor/gems/ruby/1.8/gems/casrack_the_authenticator-1.6.0/lib/casrack_the_authenticator.rb +11 -0
- data/vendor/gems/ruby/1.8/gems/casrack_the_authenticator-1.6.0/test/configuration_test.rb +83 -0
- data/vendor/gems/ruby/1.8/gems/casrack_the_authenticator-1.6.0/test/fake_test.rb +94 -0
- data/vendor/gems/ruby/1.8/gems/casrack_the_authenticator-1.6.0/test/service_ticket_validator_test.rb +85 -0
- data/vendor/gems/ruby/1.8/gems/casrack_the_authenticator-1.6.0/test/simple_test.rb +131 -0
- data/vendor/gems/ruby/1.8/gems/casrack_the_authenticator-1.6.0/test/test_helper.rb +16 -0
- data/vendor/gems/ruby/1.8/gems/nokogiri-1.3.3/.autotest +27 -0
- data/vendor/gems/ruby/1.8/gems/nokogiri-1.3.3/.require_paths +3 -0
- data/vendor/gems/ruby/1.8/gems/nokogiri-1.3.3/CHANGELOG.ja.rdoc +285 -0
- data/vendor/gems/ruby/1.8/gems/nokogiri-1.3.3/CHANGELOG.rdoc +272 -0
- data/vendor/gems/ruby/1.8/gems/nokogiri-1.3.3/Manifest.txt +254 -0
- data/vendor/gems/ruby/1.8/gems/nokogiri-1.3.3/README.ja.rdoc +107 -0
- data/vendor/gems/ruby/1.8/gems/nokogiri-1.3.3/README.rdoc +121 -0
- data/vendor/gems/ruby/1.8/gems/nokogiri-1.3.3/Rakefile +208 -0
- data/vendor/gems/ruby/1.8/gems/nokogiri-1.3.3/bin/nokogiri +47 -0
- data/vendor/gems/ruby/1.8/gems/nokogiri-1.3.3/ext/nokogiri/Makefile +150 -0
- data/vendor/gems/ruby/1.8/gems/nokogiri-1.3.3/ext/nokogiri/conftest.dSYM/Contents/Info.plist +25 -0
- data/vendor/gems/ruby/1.8/gems/nokogiri-1.3.3/ext/nokogiri/conftest.dSYM/Contents/Resources/DWARF/conftest +0 -0
- data/vendor/gems/ruby/1.8/gems/nokogiri-1.3.3/ext/nokogiri/extconf.rb +161 -0
- data/vendor/gems/ruby/1.8/gems/nokogiri-1.3.3/ext/nokogiri/html_document.c +181 -0
- data/vendor/gems/ruby/1.8/gems/nokogiri-1.3.3/ext/nokogiri/html_document.h +10 -0
- data/vendor/gems/ruby/1.8/gems/nokogiri-1.3.3/ext/nokogiri/html_document.o +0 -0
- data/vendor/gems/ruby/1.8/gems/nokogiri-1.3.3/ext/nokogiri/html_element_description.c +272 -0
- data/vendor/gems/ruby/1.8/gems/nokogiri-1.3.3/ext/nokogiri/html_element_description.h +10 -0
- data/vendor/gems/ruby/1.8/gems/nokogiri-1.3.3/ext/nokogiri/html_element_description.o +0 -0
- data/vendor/gems/ruby/1.8/gems/nokogiri-1.3.3/ext/nokogiri/html_entity_lookup.c +30 -0
- data/vendor/gems/ruby/1.8/gems/nokogiri-1.3.3/ext/nokogiri/html_entity_lookup.h +8 -0
- data/vendor/gems/ruby/1.8/gems/nokogiri-1.3.3/ext/nokogiri/html_entity_lookup.o +0 -0
- data/vendor/gems/ruby/1.8/gems/nokogiri-1.3.3/ext/nokogiri/html_sax_parser.c +57 -0
- data/vendor/gems/ruby/1.8/gems/nokogiri-1.3.3/ext/nokogiri/html_sax_parser.h +11 -0
- data/vendor/gems/ruby/1.8/gems/nokogiri-1.3.3/ext/nokogiri/html_sax_parser.o +0 -0
- data/vendor/gems/ruby/1.8/gems/nokogiri-1.3.3/ext/nokogiri/mkmf.log +248 -0
- data/vendor/gems/ruby/1.8/gems/nokogiri-1.3.3/ext/nokogiri/nokogiri.bundle +0 -0
- data/vendor/gems/ruby/1.8/gems/nokogiri-1.3.3/ext/nokogiri/nokogiri.c +83 -0
- data/vendor/gems/ruby/1.8/gems/nokogiri-1.3.3/ext/nokogiri/nokogiri.h +149 -0
- data/vendor/gems/ruby/1.8/gems/nokogiri-1.3.3/ext/nokogiri/nokogiri.o +0 -0
- data/vendor/gems/ruby/1.8/gems/nokogiri-1.3.3/ext/nokogiri/xml_attr.c +92 -0
- data/vendor/gems/ruby/1.8/gems/nokogiri-1.3.3/ext/nokogiri/xml_attr.h +9 -0
- data/vendor/gems/ruby/1.8/gems/nokogiri-1.3.3/ext/nokogiri/xml_attr.o +0 -0
- data/vendor/gems/ruby/1.8/gems/nokogiri-1.3.3/ext/nokogiri/xml_cdata.c +53 -0
- data/vendor/gems/ruby/1.8/gems/nokogiri-1.3.3/ext/nokogiri/xml_cdata.h +9 -0
- data/vendor/gems/ruby/1.8/gems/nokogiri-1.3.3/ext/nokogiri/xml_cdata.o +0 -0
- data/vendor/gems/ruby/1.8/gems/nokogiri-1.3.3/ext/nokogiri/xml_comment.c +51 -0
- data/vendor/gems/ruby/1.8/gems/nokogiri-1.3.3/ext/nokogiri/xml_comment.h +9 -0
- data/vendor/gems/ruby/1.8/gems/nokogiri-1.3.3/ext/nokogiri/xml_comment.o +0 -0
- data/vendor/gems/ruby/1.8/gems/nokogiri-1.3.3/ext/nokogiri/xml_document.c +318 -0
- data/vendor/gems/ruby/1.8/gems/nokogiri-1.3.3/ext/nokogiri/xml_document.h +24 -0
- data/vendor/gems/ruby/1.8/gems/nokogiri-1.3.3/ext/nokogiri/xml_document.o +0 -0
- data/vendor/gems/ruby/1.8/gems/nokogiri-1.3.3/ext/nokogiri/xml_document_fragment.c +48 -0
- data/vendor/gems/ruby/1.8/gems/nokogiri-1.3.3/ext/nokogiri/xml_document_fragment.h +10 -0
- data/vendor/gems/ruby/1.8/gems/nokogiri-1.3.3/ext/nokogiri/xml_document_fragment.o +0 -0
- data/vendor/gems/ruby/1.8/gems/nokogiri-1.3.3/ext/nokogiri/xml_dtd.c +135 -0
- data/vendor/gems/ruby/1.8/gems/nokogiri-1.3.3/ext/nokogiri/xml_dtd.h +10 -0
- data/vendor/gems/ruby/1.8/gems/nokogiri-1.3.3/ext/nokogiri/xml_dtd.o +0 -0
- data/vendor/gems/ruby/1.8/gems/nokogiri-1.3.3/ext/nokogiri/xml_entity_reference.c +50 -0
- data/vendor/gems/ruby/1.8/gems/nokogiri-1.3.3/ext/nokogiri/xml_entity_reference.h +9 -0
- data/vendor/gems/ruby/1.8/gems/nokogiri-1.3.3/ext/nokogiri/xml_entity_reference.o +0 -0
- data/vendor/gems/ruby/1.8/gems/nokogiri-1.3.3/ext/nokogiri/xml_io.c +24 -0
- data/vendor/gems/ruby/1.8/gems/nokogiri-1.3.3/ext/nokogiri/xml_io.h +10 -0
- data/vendor/gems/ruby/1.8/gems/nokogiri-1.3.3/ext/nokogiri/xml_io.o +0 -0
- data/vendor/gems/ruby/1.8/gems/nokogiri-1.3.3/ext/nokogiri/xml_namespace.c +74 -0
- data/vendor/gems/ruby/1.8/gems/nokogiri-1.3.3/ext/nokogiri/xml_namespace.h +12 -0
- data/vendor/gems/ruby/1.8/gems/nokogiri-1.3.3/ext/nokogiri/xml_namespace.o +0 -0
- data/vendor/gems/ruby/1.8/gems/nokogiri-1.3.3/ext/nokogiri/xml_node.c +955 -0
- data/vendor/gems/ruby/1.8/gems/nokogiri-1.3.3/ext/nokogiri/xml_node.h +14 -0
- data/vendor/gems/ruby/1.8/gems/nokogiri-1.3.3/ext/nokogiri/xml_node.o +0 -0
- data/vendor/gems/ruby/1.8/gems/nokogiri-1.3.3/ext/nokogiri/xml_node_set.c +390 -0
- data/vendor/gems/ruby/1.8/gems/nokogiri-1.3.3/ext/nokogiri/xml_node_set.h +9 -0
- data/vendor/gems/ruby/1.8/gems/nokogiri-1.3.3/ext/nokogiri/xml_node_set.o +0 -0
- data/vendor/gems/ruby/1.8/gems/nokogiri-1.3.3/ext/nokogiri/xml_processing_instruction.c +54 -0
- data/vendor/gems/ruby/1.8/gems/nokogiri-1.3.3/ext/nokogiri/xml_processing_instruction.h +9 -0
- data/vendor/gems/ruby/1.8/gems/nokogiri-1.3.3/ext/nokogiri/xml_processing_instruction.o +0 -0
- data/vendor/gems/ruby/1.8/gems/nokogiri-1.3.3/ext/nokogiri/xml_reader.c +565 -0
- data/vendor/gems/ruby/1.8/gems/nokogiri-1.3.3/ext/nokogiri/xml_reader.h +10 -0
- data/vendor/gems/ruby/1.8/gems/nokogiri-1.3.3/ext/nokogiri/xml_reader.o +0 -0
- data/vendor/gems/ruby/1.8/gems/nokogiri-1.3.3/ext/nokogiri/xml_relax_ng.c +159 -0
- data/vendor/gems/ruby/1.8/gems/nokogiri-1.3.3/ext/nokogiri/xml_relax_ng.h +9 -0
- data/vendor/gems/ruby/1.8/gems/nokogiri-1.3.3/ext/nokogiri/xml_relax_ng.o +0 -0
- data/vendor/gems/ruby/1.8/gems/nokogiri-1.3.3/ext/nokogiri/xml_sax_parser.c +345 -0
- data/vendor/gems/ruby/1.8/gems/nokogiri-1.3.3/ext/nokogiri/xml_sax_parser.h +10 -0
- data/vendor/gems/ruby/1.8/gems/nokogiri-1.3.3/ext/nokogiri/xml_sax_parser.o +0 -0
- data/vendor/gems/ruby/1.8/gems/nokogiri-1.3.3/ext/nokogiri/xml_sax_push_parser.c +86 -0
- data/vendor/gems/ruby/1.8/gems/nokogiri-1.3.3/ext/nokogiri/xml_sax_push_parser.h +9 -0
- data/vendor/gems/ruby/1.8/gems/nokogiri-1.3.3/ext/nokogiri/xml_sax_push_parser.o +0 -0
- data/vendor/gems/ruby/1.8/gems/nokogiri-1.3.3/ext/nokogiri/xml_schema.c +156 -0
- data/vendor/gems/ruby/1.8/gems/nokogiri-1.3.3/ext/nokogiri/xml_schema.h +9 -0
- data/vendor/gems/ruby/1.8/gems/nokogiri-1.3.3/ext/nokogiri/xml_schema.o +0 -0
- data/vendor/gems/ruby/1.8/gems/nokogiri-1.3.3/ext/nokogiri/xml_syntax_error.c +210 -0
- data/vendor/gems/ruby/1.8/gems/nokogiri-1.3.3/ext/nokogiri/xml_syntax_error.h +13 -0
- data/vendor/gems/ruby/1.8/gems/nokogiri-1.3.3/ext/nokogiri/xml_syntax_error.o +0 -0
- data/vendor/gems/ruby/1.8/gems/nokogiri-1.3.3/ext/nokogiri/xml_text.c +47 -0
- data/vendor/gems/ruby/1.8/gems/nokogiri-1.3.3/ext/nokogiri/xml_text.h +9 -0
- data/vendor/gems/ruby/1.8/gems/nokogiri-1.3.3/ext/nokogiri/xml_text.o +0 -0
- data/vendor/gems/ruby/1.8/gems/nokogiri-1.3.3/ext/nokogiri/xml_xpath.c +53 -0
- data/vendor/gems/ruby/1.8/gems/nokogiri-1.3.3/ext/nokogiri/xml_xpath.h +11 -0
- data/vendor/gems/ruby/1.8/gems/nokogiri-1.3.3/ext/nokogiri/xml_xpath.o +0 -0
- data/vendor/gems/ruby/1.8/gems/nokogiri-1.3.3/ext/nokogiri/xml_xpath_context.c +252 -0
- data/vendor/gems/ruby/1.8/gems/nokogiri-1.3.3/ext/nokogiri/xml_xpath_context.h +9 -0
- data/vendor/gems/ruby/1.8/gems/nokogiri-1.3.3/ext/nokogiri/xml_xpath_context.o +0 -0
- data/vendor/gems/ruby/1.8/gems/nokogiri-1.3.3/ext/nokogiri/xslt_stylesheet.c +131 -0
- data/vendor/gems/ruby/1.8/gems/nokogiri-1.3.3/ext/nokogiri/xslt_stylesheet.h +9 -0
- data/vendor/gems/ruby/1.8/gems/nokogiri-1.3.3/ext/nokogiri/xslt_stylesheet.o +0 -0
- data/vendor/gems/ruby/1.8/gems/nokogiri-1.3.3/lib/action-nokogiri.rb +38 -0
- data/vendor/gems/ruby/1.8/gems/nokogiri-1.3.3/lib/nokogiri/css/generated_parser.rb +646 -0
- data/vendor/gems/ruby/1.8/gems/nokogiri-1.3.3/lib/nokogiri/css/generated_tokenizer.rb +142 -0
- data/vendor/gems/ruby/1.8/gems/nokogiri-1.3.3/lib/nokogiri/css/node.rb +107 -0
- data/vendor/gems/ruby/1.8/gems/nokogiri-1.3.3/lib/nokogiri/css/parser.rb +82 -0
- data/vendor/gems/ruby/1.8/gems/nokogiri-1.3.3/lib/nokogiri/css/parser.y +227 -0
- data/vendor/gems/ruby/1.8/gems/nokogiri-1.3.3/lib/nokogiri/css/syntax_error.rb +7 -0
- data/vendor/gems/ruby/1.8/gems/nokogiri-1.3.3/lib/nokogiri/css/tokenizer.rb +7 -0
- data/vendor/gems/ruby/1.8/gems/nokogiri-1.3.3/lib/nokogiri/css/tokenizer.rex +54 -0
- data/vendor/gems/ruby/1.8/gems/nokogiri-1.3.3/lib/nokogiri/css/xpath_visitor.rb +172 -0
- data/vendor/gems/ruby/1.8/gems/nokogiri-1.3.3/lib/nokogiri/css.rb +25 -0
- data/vendor/gems/ruby/1.8/gems/nokogiri-1.3.3/lib/nokogiri/decorators/hpricot/node.rb +56 -0
- data/vendor/gems/ruby/1.8/gems/nokogiri-1.3.3/lib/nokogiri/decorators/hpricot/node_set.rb +54 -0
- data/vendor/gems/ruby/1.8/gems/nokogiri-1.3.3/lib/nokogiri/decorators/hpricot/xpath_visitor.rb +30 -0
- data/vendor/gems/ruby/1.8/gems/nokogiri-1.3.3/lib/nokogiri/decorators/hpricot.rb +3 -0
- data/vendor/gems/ruby/1.8/gems/nokogiri-1.3.3/lib/nokogiri/decorators/slop.rb +33 -0
- data/vendor/gems/ruby/1.8/gems/nokogiri-1.3.3/lib/nokogiri/decorators.rb +2 -0
- data/vendor/gems/ruby/1.8/gems/nokogiri-1.3.3/lib/nokogiri/ffi/html/document.rb +37 -0
- data/vendor/gems/ruby/1.8/gems/nokogiri-1.3.3/lib/nokogiri/ffi/html/element_description.rb +85 -0
- data/vendor/gems/ruby/1.8/gems/nokogiri-1.3.3/lib/nokogiri/ffi/html/entity_lookup.rb +16 -0
- data/vendor/gems/ruby/1.8/gems/nokogiri-1.3.3/lib/nokogiri/ffi/html/sax/parser.rb +21 -0
- data/vendor/gems/ruby/1.8/gems/nokogiri-1.3.3/lib/nokogiri/ffi/io_callbacks.rb +40 -0
- data/vendor/gems/ruby/1.8/gems/nokogiri-1.3.3/lib/nokogiri/ffi/libxml.rb +322 -0
- data/vendor/gems/ruby/1.8/gems/nokogiri-1.3.3/lib/nokogiri/ffi/structs/common_node.rb +26 -0
- data/vendor/gems/ruby/1.8/gems/nokogiri-1.3.3/lib/nokogiri/ffi/structs/html_elem_desc.rb +24 -0
- data/vendor/gems/ruby/1.8/gems/nokogiri-1.3.3/lib/nokogiri/ffi/structs/html_entity_desc.rb +13 -0
- data/vendor/gems/ruby/1.8/gems/nokogiri-1.3.3/lib/nokogiri/ffi/structs/xml_alloc.rb +16 -0
- data/vendor/gems/ruby/1.8/gems/nokogiri-1.3.3/lib/nokogiri/ffi/structs/xml_attr.rb +19 -0
- data/vendor/gems/ruby/1.8/gems/nokogiri-1.3.3/lib/nokogiri/ffi/structs/xml_buffer.rb +16 -0
- data/vendor/gems/ruby/1.8/gems/nokogiri-1.3.3/lib/nokogiri/ffi/structs/xml_document.rb +108 -0
- data/vendor/gems/ruby/1.8/gems/nokogiri-1.3.3/lib/nokogiri/ffi/structs/xml_dtd.rb +26 -0
- data/vendor/gems/ruby/1.8/gems/nokogiri-1.3.3/lib/nokogiri/ffi/structs/xml_node.rb +28 -0
- data/vendor/gems/ruby/1.8/gems/nokogiri-1.3.3/lib/nokogiri/ffi/structs/xml_node_set.rb +53 -0
- data/vendor/gems/ruby/1.8/gems/nokogiri-1.3.3/lib/nokogiri/ffi/structs/xml_notation.rb +11 -0
- data/vendor/gems/ruby/1.8/gems/nokogiri-1.3.3/lib/nokogiri/ffi/structs/xml_ns.rb +15 -0
- data/vendor/gems/ruby/1.8/gems/nokogiri-1.3.3/lib/nokogiri/ffi/structs/xml_relax_ng.rb +14 -0
- data/vendor/gems/ruby/1.8/gems/nokogiri-1.3.3/lib/nokogiri/ffi/structs/xml_sax_handler.rb +51 -0
- data/vendor/gems/ruby/1.8/gems/nokogiri-1.3.3/lib/nokogiri/ffi/structs/xml_sax_push_parser_context.rb +14 -0
- data/vendor/gems/ruby/1.8/gems/nokogiri-1.3.3/lib/nokogiri/ffi/structs/xml_schema.rb +13 -0
- data/vendor/gems/ruby/1.8/gems/nokogiri-1.3.3/lib/nokogiri/ffi/structs/xml_syntax_error.rb +31 -0
- data/vendor/gems/ruby/1.8/gems/nokogiri-1.3.3/lib/nokogiri/ffi/structs/xml_text_reader.rb +12 -0
- data/vendor/gems/ruby/1.8/gems/nokogiri-1.3.3/lib/nokogiri/ffi/structs/xml_xpath_context.rb +37 -0
- data/vendor/gems/ruby/1.8/gems/nokogiri-1.3.3/lib/nokogiri/ffi/structs/xml_xpath_object.rb +35 -0
- data/vendor/gems/ruby/1.8/gems/nokogiri-1.3.3/lib/nokogiri/ffi/structs/xml_xpath_parser_context.rb +20 -0
- data/vendor/gems/ruby/1.8/gems/nokogiri-1.3.3/lib/nokogiri/ffi/structs/xslt_stylesheet.rb +13 -0
- data/vendor/gems/ruby/1.8/gems/nokogiri-1.3.3/lib/nokogiri/ffi/xml/attr.rb +41 -0
- data/vendor/gems/ruby/1.8/gems/nokogiri-1.3.3/lib/nokogiri/ffi/xml/cdata.rb +19 -0
- data/vendor/gems/ruby/1.8/gems/nokogiri-1.3.3/lib/nokogiri/ffi/xml/comment.rb +18 -0
- data/vendor/gems/ruby/1.8/gems/nokogiri-1.3.3/lib/nokogiri/ffi/xml/document.rb +118 -0
- data/vendor/gems/ruby/1.8/gems/nokogiri-1.3.3/lib/nokogiri/ffi/xml/document_fragment.rb +26 -0
- data/vendor/gems/ruby/1.8/gems/nokogiri-1.3.3/lib/nokogiri/ffi/xml/dtd.rb +58 -0
- data/vendor/gems/ruby/1.8/gems/nokogiri-1.3.3/lib/nokogiri/ffi/xml/entity_reference.rb +19 -0
- data/vendor/gems/ruby/1.8/gems/nokogiri-1.3.3/lib/nokogiri/ffi/xml/namespace.rb +44 -0
- data/vendor/gems/ruby/1.8/gems/nokogiri-1.3.3/lib/nokogiri/ffi/xml/node.rb +404 -0
- data/vendor/gems/ruby/1.8/gems/nokogiri-1.3.3/lib/nokogiri/ffi/xml/node_set.rb +133 -0
- data/vendor/gems/ruby/1.8/gems/nokogiri-1.3.3/lib/nokogiri/ffi/xml/processing_instruction.rb +20 -0
- data/vendor/gems/ruby/1.8/gems/nokogiri-1.3.3/lib/nokogiri/ffi/xml/reader.rb +206 -0
- data/vendor/gems/ruby/1.8/gems/nokogiri-1.3.3/lib/nokogiri/ffi/xml/relax_ng.rb +85 -0
- data/vendor/gems/ruby/1.8/gems/nokogiri-1.3.3/lib/nokogiri/ffi/xml/sax/parser.rb +149 -0
- data/vendor/gems/ruby/1.8/gems/nokogiri-1.3.3/lib/nokogiri/ffi/xml/sax/push_parser.rb +38 -0
- data/vendor/gems/ruby/1.8/gems/nokogiri-1.3.3/lib/nokogiri/ffi/xml/schema.rb +92 -0
- data/vendor/gems/ruby/1.8/gems/nokogiri-1.3.3/lib/nokogiri/ffi/xml/syntax_error.rb +76 -0
- data/vendor/gems/ruby/1.8/gems/nokogiri-1.3.3/lib/nokogiri/ffi/xml/text.rb +18 -0
- data/vendor/gems/ruby/1.8/gems/nokogiri-1.3.3/lib/nokogiri/ffi/xml/xpath.rb +19 -0
- data/vendor/gems/ruby/1.8/gems/nokogiri-1.3.3/lib/nokogiri/ffi/xml/xpath_context.rb +135 -0
- data/vendor/gems/ruby/1.8/gems/nokogiri-1.3.3/lib/nokogiri/ffi/xslt/stylesheet.rb +47 -0
- data/vendor/gems/ruby/1.8/gems/nokogiri-1.3.3/lib/nokogiri/hpricot.rb +92 -0
- data/vendor/gems/ruby/1.8/gems/nokogiri-1.3.3/lib/nokogiri/html/builder.rb +35 -0
- data/vendor/gems/ruby/1.8/gems/nokogiri-1.3.3/lib/nokogiri/html/document.rb +73 -0
- data/vendor/gems/ruby/1.8/gems/nokogiri-1.3.3/lib/nokogiri/html/document_fragment.rb +15 -0
- data/vendor/gems/ruby/1.8/gems/nokogiri-1.3.3/lib/nokogiri/html/element_description.rb +23 -0
- data/vendor/gems/ruby/1.8/gems/nokogiri-1.3.3/lib/nokogiri/html/entity_lookup.rb +13 -0
- data/vendor/gems/ruby/1.8/gems/nokogiri-1.3.3/lib/nokogiri/html/sax/parser.rb +48 -0
- data/vendor/gems/ruby/1.8/gems/nokogiri-1.3.3/lib/nokogiri/html.rb +34 -0
- data/vendor/gems/ruby/1.8/gems/nokogiri-1.3.3/lib/nokogiri/nokogiri.bundle +0 -0
- data/vendor/gems/ruby/1.8/gems/nokogiri-1.3.3/lib/nokogiri/syntax_error.rb +4 -0
- data/vendor/gems/ruby/1.8/gems/nokogiri-1.3.3/lib/nokogiri/version.rb +33 -0
- data/vendor/gems/ruby/1.8/gems/nokogiri-1.3.3/lib/nokogiri/version_warning.rb +11 -0
- data/vendor/gems/ruby/1.8/gems/nokogiri-1.3.3/lib/nokogiri/xml/attr.rb +9 -0
- data/vendor/gems/ruby/1.8/gems/nokogiri-1.3.3/lib/nokogiri/xml/builder.rb +297 -0
- data/vendor/gems/ruby/1.8/gems/nokogiri-1.3.3/lib/nokogiri/xml/cdata.rb +11 -0
- data/vendor/gems/ruby/1.8/gems/nokogiri-1.3.3/lib/nokogiri/xml/document.rb +117 -0
- data/vendor/gems/ruby/1.8/gems/nokogiri-1.3.3/lib/nokogiri/xml/document_fragment.rb +49 -0
- data/vendor/gems/ruby/1.8/gems/nokogiri-1.3.3/lib/nokogiri/xml/dtd.rb +11 -0
- data/vendor/gems/ruby/1.8/gems/nokogiri-1.3.3/lib/nokogiri/xml/entity_declaration.rb +11 -0
- data/vendor/gems/ruby/1.8/gems/nokogiri-1.3.3/lib/nokogiri/xml/fragment_handler.rb +60 -0
- data/vendor/gems/ruby/1.8/gems/nokogiri-1.3.3/lib/nokogiri/xml/namespace.rb +7 -0
- data/vendor/gems/ruby/1.8/gems/nokogiri-1.3.3/lib/nokogiri/xml/node/save_options.rb +42 -0
- data/vendor/gems/ruby/1.8/gems/nokogiri-1.3.3/lib/nokogiri/xml/node.rb +647 -0
- data/vendor/gems/ruby/1.8/gems/nokogiri-1.3.3/lib/nokogiri/xml/node_set.rb +285 -0
- data/vendor/gems/ruby/1.8/gems/nokogiri-1.3.3/lib/nokogiri/xml/notation.rb +6 -0
- data/vendor/gems/ruby/1.8/gems/nokogiri-1.3.3/lib/nokogiri/xml/parse_options.rb +85 -0
- data/vendor/gems/ruby/1.8/gems/nokogiri-1.3.3/lib/nokogiri/xml/processing_instruction.rb +8 -0
- data/vendor/gems/ruby/1.8/gems/nokogiri-1.3.3/lib/nokogiri/xml/reader.rb +66 -0
- data/vendor/gems/ruby/1.8/gems/nokogiri-1.3.3/lib/nokogiri/xml/relax_ng.rb +32 -0
- data/vendor/gems/ruby/1.8/gems/nokogiri-1.3.3/lib/nokogiri/xml/sax/document.rb +143 -0
- data/vendor/gems/ruby/1.8/gems/nokogiri-1.3.3/lib/nokogiri/xml/sax/legacy_handlers.rb +65 -0
- data/vendor/gems/ruby/1.8/gems/nokogiri-1.3.3/lib/nokogiri/xml/sax/parser.rb +108 -0
- data/vendor/gems/ruby/1.8/gems/nokogiri-1.3.3/lib/nokogiri/xml/sax/push_parser.rb +63 -0
- data/vendor/gems/ruby/1.8/gems/nokogiri-1.3.3/lib/nokogiri/xml/sax.rb +4 -0
- data/vendor/gems/ruby/1.8/gems/nokogiri-1.3.3/lib/nokogiri/xml/schema.rb +61 -0
- data/vendor/gems/ruby/1.8/gems/nokogiri-1.3.3/lib/nokogiri/xml/syntax_error.rb +34 -0
- data/vendor/gems/ruby/1.8/gems/nokogiri-1.3.3/lib/nokogiri/xml/xpath/syntax_error.rb +8 -0
- data/vendor/gems/ruby/1.8/gems/nokogiri-1.3.3/lib/nokogiri/xml/xpath.rb +10 -0
- data/vendor/gems/ruby/1.8/gems/nokogiri-1.3.3/lib/nokogiri/xml/xpath_context.rb +16 -0
- data/vendor/gems/ruby/1.8/gems/nokogiri-1.3.3/lib/nokogiri/xml.rb +62 -0
- data/vendor/gems/ruby/1.8/gems/nokogiri-1.3.3/lib/nokogiri/xslt/stylesheet.rb +25 -0
- data/vendor/gems/ruby/1.8/gems/nokogiri-1.3.3/lib/nokogiri/xslt.rb +48 -0
- data/vendor/gems/ruby/1.8/gems/nokogiri-1.3.3/lib/nokogiri.rb +116 -0
- data/vendor/gems/ruby/1.8/gems/nokogiri-1.3.3/lib/xsd/xmlparser/nokogiri.rb +71 -0
- data/vendor/gems/ruby/1.8/gems/nokogiri-1.3.3/tasks/test.rb +100 -0
- data/vendor/gems/ruby/1.8/gems/nokogiri-1.3.3/test/css/test_nthiness.rb +159 -0
- data/vendor/gems/ruby/1.8/gems/nokogiri-1.3.3/test/css/test_parser.rb +277 -0
- data/vendor/gems/ruby/1.8/gems/nokogiri-1.3.3/test/css/test_tokenizer.rb +183 -0
- data/vendor/gems/ruby/1.8/gems/nokogiri-1.3.3/test/css/test_xpath_visitor.rb +76 -0
- data/vendor/gems/ruby/1.8/gems/nokogiri-1.3.3/test/ffi/test_document.rb +35 -0
- data/vendor/gems/ruby/1.8/gems/nokogiri-1.3.3/test/files/2ch.html +108 -0
- data/vendor/gems/ruby/1.8/gems/nokogiri-1.3.3/test/files/address_book.rlx +12 -0
- data/vendor/gems/ruby/1.8/gems/nokogiri-1.3.3/test/files/address_book.xml +10 -0
- data/vendor/gems/ruby/1.8/gems/nokogiri-1.3.3/test/files/bar/bar.xsd +4 -0
- data/vendor/gems/ruby/1.8/gems/nokogiri-1.3.3/test/files/dont_hurt_em_why.xml +422 -0
- data/vendor/gems/ruby/1.8/gems/nokogiri-1.3.3/test/files/exslt.xml +8 -0
- data/vendor/gems/ruby/1.8/gems/nokogiri-1.3.3/test/files/exslt.xslt +35 -0
- data/vendor/gems/ruby/1.8/gems/nokogiri-1.3.3/test/files/foo/foo.xsd +4 -0
- data/vendor/gems/ruby/1.8/gems/nokogiri-1.3.3/test/files/po.xml +32 -0
- data/vendor/gems/ruby/1.8/gems/nokogiri-1.3.3/test/files/po.xsd +66 -0
- data/vendor/gems/ruby/1.8/gems/nokogiri-1.3.3/test/files/shift_jis.xml +5 -0
- data/vendor/gems/ruby/1.8/gems/nokogiri-1.3.3/test/files/snuggles.xml +3 -0
- data/vendor/gems/ruby/1.8/gems/nokogiri-1.3.3/test/files/staff.xml +59 -0
- data/vendor/gems/ruby/1.8/gems/nokogiri-1.3.3/test/files/staff.xslt +32 -0
- data/vendor/gems/ruby/1.8/gems/nokogiri-1.3.3/test/files/tlm.html +850 -0
- data/vendor/gems/ruby/1.8/gems/nokogiri-1.3.3/test/files/valid_bar.xml +2 -0
- data/vendor/gems/ruby/1.8/gems/nokogiri-1.3.3/test/helper.rb +127 -0
- data/vendor/gems/ruby/1.8/gems/nokogiri-1.3.3/test/hpricot/files/basic.xhtml +17 -0
- data/vendor/gems/ruby/1.8/gems/nokogiri-1.3.3/test/hpricot/files/boingboing.html +2266 -0
- data/vendor/gems/ruby/1.8/gems/nokogiri-1.3.3/test/hpricot/files/cy0.html +3653 -0
- data/vendor/gems/ruby/1.8/gems/nokogiri-1.3.3/test/hpricot/files/immob.html +400 -0
- data/vendor/gems/ruby/1.8/gems/nokogiri-1.3.3/test/hpricot/files/pace_application.html +1320 -0
- data/vendor/gems/ruby/1.8/gems/nokogiri-1.3.3/test/hpricot/files/tenderlove.html +16 -0
- data/vendor/gems/ruby/1.8/gems/nokogiri-1.3.3/test/hpricot/files/uswebgen.html +220 -0
- data/vendor/gems/ruby/1.8/gems/nokogiri-1.3.3/test/hpricot/files/utf8.html +1054 -0
- data/vendor/gems/ruby/1.8/gems/nokogiri-1.3.3/test/hpricot/files/week9.html +1723 -0
- data/vendor/gems/ruby/1.8/gems/nokogiri-1.3.3/test/hpricot/files/why.xml +19 -0
- data/vendor/gems/ruby/1.8/gems/nokogiri-1.3.3/test/hpricot/load_files.rb +11 -0
- data/vendor/gems/ruby/1.8/gems/nokogiri-1.3.3/test/hpricot/test_alter.rb +68 -0
- data/vendor/gems/ruby/1.8/gems/nokogiri-1.3.3/test/hpricot/test_builder.rb +20 -0
- data/vendor/gems/ruby/1.8/gems/nokogiri-1.3.3/test/hpricot/test_parser.rb +350 -0
- data/vendor/gems/ruby/1.8/gems/nokogiri-1.3.3/test/hpricot/test_paths.rb +15 -0
- data/vendor/gems/ruby/1.8/gems/nokogiri-1.3.3/test/hpricot/test_preserved.rb +77 -0
- data/vendor/gems/ruby/1.8/gems/nokogiri-1.3.3/test/hpricot/test_xml.rb +30 -0
- data/vendor/gems/ruby/1.8/gems/nokogiri-1.3.3/test/html/sax/test_parser.rb +64 -0
- data/vendor/gems/ruby/1.8/gems/nokogiri-1.3.3/test/html/test_builder.rb +158 -0
- data/vendor/gems/ruby/1.8/gems/nokogiri-1.3.3/test/html/test_document.rb +368 -0
- data/vendor/gems/ruby/1.8/gems/nokogiri-1.3.3/test/html/test_document_encoding.rb +63 -0
- data/vendor/gems/ruby/1.8/gems/nokogiri-1.3.3/test/html/test_document_fragment.rb +123 -0
- data/vendor/gems/ruby/1.8/gems/nokogiri-1.3.3/test/html/test_element_description.rb +95 -0
- data/vendor/gems/ruby/1.8/gems/nokogiri-1.3.3/test/html/test_named_characters.rb +14 -0
- data/vendor/gems/ruby/1.8/gems/nokogiri-1.3.3/test/html/test_node.rb +168 -0
- data/vendor/gems/ruby/1.8/gems/nokogiri-1.3.3/test/test_convert_xpath.rb +137 -0
- data/vendor/gems/ruby/1.8/gems/nokogiri-1.3.3/test/test_css_cache.rb +45 -0
- data/vendor/gems/ruby/1.8/gems/nokogiri-1.3.3/test/test_gc.rb +15 -0
- data/vendor/gems/ruby/1.8/gems/nokogiri-1.3.3/test/test_memory_leak.rb +77 -0
- data/vendor/gems/ruby/1.8/gems/nokogiri-1.3.3/test/test_nokogiri.rb +134 -0
- data/vendor/gems/ruby/1.8/gems/nokogiri-1.3.3/test/test_reader.rb +330 -0
- data/vendor/gems/ruby/1.8/gems/nokogiri-1.3.3/test/test_xslt_transforms.rb +131 -0
- data/vendor/gems/ruby/1.8/gems/nokogiri-1.3.3/test/xml/node/test_save_options.rb +20 -0
- data/vendor/gems/ruby/1.8/gems/nokogiri-1.3.3/test/xml/node/test_subclass.rb +44 -0
- data/vendor/gems/ruby/1.8/gems/nokogiri-1.3.3/test/xml/sax/test_parser.rb +246 -0
- data/vendor/gems/ruby/1.8/gems/nokogiri-1.3.3/test/xml/sax/test_push_parser.rb +96 -0
- data/vendor/gems/ruby/1.8/gems/nokogiri-1.3.3/test/xml/test_attr.rb +38 -0
- data/vendor/gems/ruby/1.8/gems/nokogiri-1.3.3/test/xml/test_builder.rb +73 -0
- data/vendor/gems/ruby/1.8/gems/nokogiri-1.3.3/test/xml/test_cdata.rb +38 -0
- data/vendor/gems/ruby/1.8/gems/nokogiri-1.3.3/test/xml/test_comment.rb +23 -0
- data/vendor/gems/ruby/1.8/gems/nokogiri-1.3.3/test/xml/test_document.rb +466 -0
- data/vendor/gems/ruby/1.8/gems/nokogiri-1.3.3/test/xml/test_document_encoding.rb +26 -0
- data/vendor/gems/ruby/1.8/gems/nokogiri-1.3.3/test/xml/test_document_fragment.rb +88 -0
- data/vendor/gems/ruby/1.8/gems/nokogiri-1.3.3/test/xml/test_dtd.rb +47 -0
- data/vendor/gems/ruby/1.8/gems/nokogiri-1.3.3/test/xml/test_dtd_encoding.rb +31 -0
- data/vendor/gems/ruby/1.8/gems/nokogiri-1.3.3/test/xml/test_entity_reference.rb +21 -0
- data/vendor/gems/ruby/1.8/gems/nokogiri-1.3.3/test/xml/test_namespace.rb +48 -0
- data/vendor/gems/ruby/1.8/gems/nokogiri-1.3.3/test/xml/test_node.rb +823 -0
- data/vendor/gems/ruby/1.8/gems/nokogiri-1.3.3/test/xml/test_node_attributes.rb +34 -0
- data/vendor/gems/ruby/1.8/gems/nokogiri-1.3.3/test/xml/test_node_encoding.rb +107 -0
- data/vendor/gems/ruby/1.8/gems/nokogiri-1.3.3/test/xml/test_node_set.rb +397 -0
- data/vendor/gems/ruby/1.8/gems/nokogiri-1.3.3/test/xml/test_parse_options.rb +52 -0
- data/vendor/gems/ruby/1.8/gems/nokogiri-1.3.3/test/xml/test_processing_instruction.rb +30 -0
- data/vendor/gems/ruby/1.8/gems/nokogiri-1.3.3/test/xml/test_reader_encoding.rb +126 -0
- data/vendor/gems/ruby/1.8/gems/nokogiri-1.3.3/test/xml/test_relax_ng.rb +60 -0
- data/vendor/gems/ruby/1.8/gems/nokogiri-1.3.3/test/xml/test_schema.rb +89 -0
- data/vendor/gems/ruby/1.8/gems/nokogiri-1.3.3/test/xml/test_text.rb +18 -0
- data/vendor/gems/ruby/1.8/gems/nokogiri-1.3.3/test/xml/test_unparented_node.rb +381 -0
- data/vendor/gems/ruby/1.8/gems/nokogiri-1.3.3/test/xml/test_xpath.rb +106 -0
- data/vendor/gems/ruby/1.8/gems/rack-1.1.0/COPYING +18 -0
- data/vendor/gems/ruby/1.8/gems/rack-1.1.0/KNOWN-ISSUES +21 -0
- data/vendor/gems/ruby/1.8/gems/rack-1.1.0/RDOX +0 -0
- data/vendor/gems/ruby/1.8/gems/rack-1.1.0/README +399 -0
- data/vendor/gems/ruby/1.8/gems/rack-1.1.0/SPEC +171 -0
- data/vendor/gems/ruby/1.8/gems/rack-1.1.0/bin/rackup +4 -0
- data/vendor/gems/ruby/1.8/gems/rack-1.1.0/contrib/rack_logo.svg +111 -0
- data/vendor/gems/ruby/1.8/gems/rack-1.1.0/example/lobster.ru +4 -0
- data/vendor/gems/ruby/1.8/gems/rack-1.1.0/example/protectedlobster.rb +14 -0
- data/vendor/gems/ruby/1.8/gems/rack-1.1.0/example/protectedlobster.ru +8 -0
- data/vendor/gems/ruby/1.8/gems/rack-1.1.0/lib/rack/adapter/camping.rb +22 -0
- data/vendor/gems/ruby/1.8/gems/rack-1.1.0/lib/rack/auth/abstract/handler.rb +37 -0
- data/vendor/gems/ruby/1.8/gems/rack-1.1.0/lib/rack/auth/abstract/request.rb +37 -0
- data/vendor/gems/ruby/1.8/gems/rack-1.1.0/lib/rack/auth/basic.rb +58 -0
- data/vendor/gems/ruby/1.8/gems/rack-1.1.0/lib/rack/auth/digest/md5.rb +124 -0
- data/vendor/gems/ruby/1.8/gems/rack-1.1.0/lib/rack/auth/digest/nonce.rb +51 -0
- data/vendor/gems/ruby/1.8/gems/rack-1.1.0/lib/rack/auth/digest/params.rb +55 -0
- data/vendor/gems/ruby/1.8/gems/rack-1.1.0/lib/rack/auth/digest/request.rb +40 -0
- data/vendor/gems/ruby/1.8/gems/rack-1.1.0/lib/rack/builder.rb +80 -0
- data/vendor/gems/ruby/1.8/gems/rack-1.1.0/lib/rack/cascade.rb +41 -0
- data/vendor/gems/ruby/1.8/gems/rack-1.1.0/lib/rack/chunked.rb +49 -0
- data/vendor/gems/ruby/1.8/gems/rack-1.1.0/lib/rack/commonlogger.rb +49 -0
- data/vendor/gems/ruby/1.8/gems/rack-1.1.0/lib/rack/conditionalget.rb +47 -0
- data/vendor/gems/ruby/1.8/gems/rack-1.1.0/lib/rack/config.rb +15 -0
- data/vendor/gems/ruby/1.8/gems/rack-1.1.0/lib/rack/content_length.rb +29 -0
- data/vendor/gems/ruby/1.8/gems/rack-1.1.0/lib/rack/content_type.rb +23 -0
- data/vendor/gems/ruby/1.8/gems/rack-1.1.0/lib/rack/deflater.rb +96 -0
- data/vendor/gems/ruby/1.8/gems/rack-1.1.0/lib/rack/directory.rb +157 -0
- data/vendor/gems/ruby/1.8/gems/rack-1.1.0/lib/rack/etag.rb +23 -0
- data/vendor/gems/ruby/1.8/gems/rack-1.1.0/lib/rack/file.rb +90 -0
- data/vendor/gems/ruby/1.8/gems/rack-1.1.0/lib/rack/handler/cgi.rb +61 -0
- data/vendor/gems/ruby/1.8/gems/rack-1.1.0/lib/rack/handler/evented_mongrel.rb +8 -0
- data/vendor/gems/ruby/1.8/gems/rack-1.1.0/lib/rack/handler/fastcgi.rb +89 -0
- data/vendor/gems/ruby/1.8/gems/rack-1.1.0/lib/rack/handler/lsws.rb +63 -0
- data/vendor/gems/ruby/1.8/gems/rack-1.1.0/lib/rack/handler/mongrel.rb +90 -0
- data/vendor/gems/ruby/1.8/gems/rack-1.1.0/lib/rack/handler/scgi.rb +62 -0
- data/vendor/gems/ruby/1.8/gems/rack-1.1.0/lib/rack/handler/swiftiplied_mongrel.rb +8 -0
- data/vendor/gems/ruby/1.8/gems/rack-1.1.0/lib/rack/handler/thin.rb +18 -0
- data/vendor/gems/ruby/1.8/gems/rack-1.1.0/lib/rack/handler/webrick.rb +69 -0
- data/vendor/gems/ruby/1.8/gems/rack-1.1.0/lib/rack/handler.rb +88 -0
- data/vendor/gems/ruby/1.8/gems/rack-1.1.0/lib/rack/head.rb +19 -0
- data/vendor/gems/ruby/1.8/gems/rack-1.1.0/lib/rack/lint.rb +575 -0
- data/vendor/gems/ruby/1.8/gems/rack-1.1.0/lib/rack/lobster.rb +65 -0
- data/vendor/gems/ruby/1.8/gems/rack-1.1.0/lib/rack/lock.rb +16 -0
- data/vendor/gems/ruby/1.8/gems/rack-1.1.0/lib/rack/logger.rb +20 -0
- data/vendor/gems/ruby/1.8/gems/rack-1.1.0/lib/rack/methodoverride.rb +27 -0
- data/vendor/gems/ruby/1.8/gems/rack-1.1.0/lib/rack/mime.rb +206 -0
- data/vendor/gems/ruby/1.8/gems/rack-1.1.0/lib/rack/mock.rb +189 -0
- data/vendor/gems/ruby/1.8/gems/rack-1.1.0/lib/rack/nulllogger.rb +18 -0
- data/vendor/gems/ruby/1.8/gems/rack-1.1.0/lib/rack/recursive.rb +57 -0
- data/vendor/gems/ruby/1.8/gems/rack-1.1.0/lib/rack/reloader.rb +109 -0
- data/vendor/gems/ruby/1.8/gems/rack-1.1.0/lib/rack/request.rb +271 -0
- data/vendor/gems/ruby/1.8/gems/rack-1.1.0/lib/rack/response.rb +149 -0
- data/vendor/gems/ruby/1.8/gems/rack-1.1.0/lib/rack/rewindable_input.rb +100 -0
- data/vendor/gems/ruby/1.8/gems/rack-1.1.0/lib/rack/runtime.rb +27 -0
- data/vendor/gems/ruby/1.8/gems/rack-1.1.0/lib/rack/sendfile.rb +142 -0
- data/vendor/gems/ruby/1.8/gems/rack-1.1.0/lib/rack/server.rb +212 -0
- data/vendor/gems/ruby/1.8/gems/rack-1.1.0/lib/rack/session/abstract/id.rb +140 -0
- data/vendor/gems/ruby/1.8/gems/rack-1.1.0/lib/rack/session/cookie.rb +90 -0
- data/vendor/gems/ruby/1.8/gems/rack-1.1.0/lib/rack/session/memcache.rb +119 -0
- data/vendor/gems/ruby/1.8/gems/rack-1.1.0/lib/rack/session/pool.rb +100 -0
- data/vendor/gems/ruby/1.8/gems/rack-1.1.0/lib/rack/showexceptions.rb +349 -0
- data/vendor/gems/ruby/1.8/gems/rack-1.1.0/lib/rack/showstatus.rb +106 -0
- data/vendor/gems/ruby/1.8/gems/rack-1.1.0/lib/rack/static.rb +38 -0
- data/vendor/gems/ruby/1.8/gems/rack-1.1.0/lib/rack/urlmap.rb +56 -0
- data/vendor/gems/ruby/1.8/gems/rack-1.1.0/lib/rack/utils.rb +620 -0
- data/vendor/gems/ruby/1.8/gems/rack-1.1.0/lib/rack.rb +92 -0
- data/vendor/gems/ruby/1.8/gems/rack-1.1.0/rack.gemspec +38 -0
- data/vendor/gems/ruby/1.8/gems/rack-1.1.0/test/spec_rack_auth_basic.rb +73 -0
- data/vendor/gems/ruby/1.8/gems/rack-1.1.0/test/spec_rack_auth_digest.rb +226 -0
- data/vendor/gems/ruby/1.8/gems/rack-1.1.0/test/spec_rack_builder.rb +84 -0
- data/vendor/gems/ruby/1.8/gems/rack-1.1.0/test/spec_rack_camping.rb +51 -0
- data/vendor/gems/ruby/1.8/gems/rack-1.1.0/test/spec_rack_cascade.rb +48 -0
- data/vendor/gems/ruby/1.8/gems/rack-1.1.0/test/spec_rack_cgi.rb +89 -0
- data/vendor/gems/ruby/1.8/gems/rack-1.1.0/test/spec_rack_chunked.rb +62 -0
- data/vendor/gems/ruby/1.8/gems/rack-1.1.0/test/spec_rack_commonlogger.rb +61 -0
- data/vendor/gems/ruby/1.8/gems/rack-1.1.0/test/spec_rack_conditionalget.rb +41 -0
- data/vendor/gems/ruby/1.8/gems/rack-1.1.0/test/spec_rack_config.rb +24 -0
- data/vendor/gems/ruby/1.8/gems/rack-1.1.0/test/spec_rack_content_length.rb +43 -0
- data/vendor/gems/ruby/1.8/gems/rack-1.1.0/test/spec_rack_content_type.rb +30 -0
- data/vendor/gems/ruby/1.8/gems/rack-1.1.0/test/spec_rack_deflater.rb +127 -0
- data/vendor/gems/ruby/1.8/gems/rack-1.1.0/test/spec_rack_directory.rb +61 -0
- data/vendor/gems/ruby/1.8/gems/rack-1.1.0/test/spec_rack_etag.rb +17 -0
- data/vendor/gems/ruby/1.8/gems/rack-1.1.0/test/spec_rack_fastcgi.rb +89 -0
- data/vendor/gems/ruby/1.8/gems/rack-1.1.0/test/spec_rack_file.rb +75 -0
- data/vendor/gems/ruby/1.8/gems/rack-1.1.0/test/spec_rack_handler.rb +43 -0
- data/vendor/gems/ruby/1.8/gems/rack-1.1.0/test/spec_rack_head.rb +30 -0
- data/vendor/gems/ruby/1.8/gems/rack-1.1.0/test/spec_rack_lint.rb +528 -0
- data/vendor/gems/ruby/1.8/gems/rack-1.1.0/test/spec_rack_lobster.rb +45 -0
- data/vendor/gems/ruby/1.8/gems/rack-1.1.0/test/spec_rack_lock.rb +38 -0
- data/vendor/gems/ruby/1.8/gems/rack-1.1.0/test/spec_rack_logger.rb +21 -0
- data/vendor/gems/ruby/1.8/gems/rack-1.1.0/test/spec_rack_methodoverride.rb +60 -0
- data/vendor/gems/ruby/1.8/gems/rack-1.1.0/test/spec_rack_mock.rb +243 -0
- data/vendor/gems/ruby/1.8/gems/rack-1.1.0/test/spec_rack_mongrel.rb +189 -0
- data/vendor/gems/ruby/1.8/gems/rack-1.1.0/test/spec_rack_nulllogger.rb +13 -0
- data/vendor/gems/ruby/1.8/gems/rack-1.1.0/test/spec_rack_recursive.rb +77 -0
- data/vendor/gems/ruby/1.8/gems/rack-1.1.0/test/spec_rack_request.rb +545 -0
- data/vendor/gems/ruby/1.8/gems/rack-1.1.0/test/spec_rack_response.rb +221 -0
- data/vendor/gems/ruby/1.8/gems/rack-1.1.0/test/spec_rack_rewindable_input.rb +118 -0
- data/vendor/gems/ruby/1.8/gems/rack-1.1.0/test/spec_rack_runtime.rb +35 -0
- data/vendor/gems/ruby/1.8/gems/rack-1.1.0/test/spec_rack_sendfile.rb +86 -0
- data/vendor/gems/ruby/1.8/gems/rack-1.1.0/test/spec_rack_session_cookie.rb +73 -0
- data/vendor/gems/ruby/1.8/gems/rack-1.1.0/test/spec_rack_session_memcache.rb +273 -0
- data/vendor/gems/ruby/1.8/gems/rack-1.1.0/test/spec_rack_session_pool.rb +172 -0
- data/vendor/gems/ruby/1.8/gems/rack-1.1.0/test/spec_rack_showexceptions.rb +21 -0
- data/vendor/gems/ruby/1.8/gems/rack-1.1.0/test/spec_rack_showstatus.rb +72 -0
- data/vendor/gems/ruby/1.8/gems/rack-1.1.0/test/spec_rack_static.rb +37 -0
- data/vendor/gems/ruby/1.8/gems/rack-1.1.0/test/spec_rack_thin.rb +91 -0
- data/vendor/gems/ruby/1.8/gems/rack-1.1.0/test/spec_rack_urlmap.rb +215 -0
- data/vendor/gems/ruby/1.8/gems/rack-1.1.0/test/spec_rack_utils.rb +552 -0
- data/vendor/gems/ruby/1.8/gems/rack-1.1.0/test/spec_rack_webrick.rb +130 -0
- data/vendor/gems/ruby/1.8/gems/rack-1.1.0/test/spec_rackup.rb +154 -0
- data/vendor/gems/ruby/1.8/gems/sinatra-0.9.4/AUTHORS +41 -0
- data/vendor/gems/ruby/1.8/gems/sinatra-0.9.4/CHANGES +385 -0
- data/vendor/gems/ruby/1.8/gems/sinatra-0.9.4/LICENSE +22 -0
- data/vendor/gems/ruby/1.8/gems/sinatra-0.9.4/README.rdoc +573 -0
- data/vendor/gems/ruby/1.8/gems/sinatra-0.9.4/Rakefile +138 -0
- data/vendor/gems/ruby/1.8/gems/sinatra-0.9.4/compat/app_test.rb +282 -0
- data/vendor/gems/ruby/1.8/gems/sinatra-0.9.4/compat/application_test.rb +262 -0
- data/vendor/gems/ruby/1.8/gems/sinatra-0.9.4/compat/builder_test.rb +101 -0
- data/vendor/gems/ruby/1.8/gems/sinatra-0.9.4/compat/compat_test.rb +12 -0
- data/vendor/gems/ruby/1.8/gems/sinatra-0.9.4/compat/custom_error_test.rb +62 -0
- data/vendor/gems/ruby/1.8/gems/sinatra-0.9.4/compat/erb_test.rb +136 -0
- data/vendor/gems/ruby/1.8/gems/sinatra-0.9.4/compat/events_test.rb +78 -0
- data/vendor/gems/ruby/1.8/gems/sinatra-0.9.4/compat/filter_test.rb +30 -0
- data/vendor/gems/ruby/1.8/gems/sinatra-0.9.4/compat/haml_test.rb +236 -0
- data/vendor/gems/ruby/1.8/gems/sinatra-0.9.4/compat/helper.rb +33 -0
- data/vendor/gems/ruby/1.8/gems/sinatra-0.9.4/compat/mapped_error_test.rb +72 -0
- data/vendor/gems/ruby/1.8/gems/sinatra-0.9.4/compat/pipeline_test.rb +45 -0
- data/vendor/gems/ruby/1.8/gems/sinatra-0.9.4/compat/public/foo.xml +1 -0
- data/vendor/gems/ruby/1.8/gems/sinatra-0.9.4/compat/sass_test.rb +67 -0
- data/vendor/gems/ruby/1.8/gems/sinatra-0.9.4/compat/sessions_test.rb +42 -0
- data/vendor/gems/ruby/1.8/gems/sinatra-0.9.4/compat/streaming_test.rb +133 -0
- data/vendor/gems/ruby/1.8/gems/sinatra-0.9.4/compat/sym_params_test.rb +19 -0
- data/vendor/gems/ruby/1.8/gems/sinatra-0.9.4/compat/template_test.rb +30 -0
- data/vendor/gems/ruby/1.8/gems/sinatra-0.9.4/compat/use_in_file_templates_test.rb +47 -0
- data/vendor/gems/ruby/1.8/gems/sinatra-0.9.4/compat/views/foo.builder +1 -0
- data/vendor/gems/ruby/1.8/gems/sinatra-0.9.4/compat/views/foo.erb +1 -0
- data/vendor/gems/ruby/1.8/gems/sinatra-0.9.4/compat/views/foo.haml +1 -0
- data/vendor/gems/ruby/1.8/gems/sinatra-0.9.4/compat/views/foo.sass +2 -0
- data/vendor/gems/ruby/1.8/gems/sinatra-0.9.4/compat/views/foo_layout.erb +2 -0
- data/vendor/gems/ruby/1.8/gems/sinatra-0.9.4/compat/views/foo_layout.haml +2 -0
- data/vendor/gems/ruby/1.8/gems/sinatra-0.9.4/compat/views/layout_test/foo.builder +1 -0
- data/vendor/gems/ruby/1.8/gems/sinatra-0.9.4/compat/views/layout_test/foo.erb +1 -0
- data/vendor/gems/ruby/1.8/gems/sinatra-0.9.4/compat/views/layout_test/foo.haml +1 -0
- data/vendor/gems/ruby/1.8/gems/sinatra-0.9.4/compat/views/layout_test/foo.sass +2 -0
- data/vendor/gems/ruby/1.8/gems/sinatra-0.9.4/compat/views/layout_test/layout.builder +3 -0
- data/vendor/gems/ruby/1.8/gems/sinatra-0.9.4/compat/views/layout_test/layout.erb +1 -0
- data/vendor/gems/ruby/1.8/gems/sinatra-0.9.4/compat/views/layout_test/layout.haml +1 -0
- data/vendor/gems/ruby/1.8/gems/sinatra-0.9.4/compat/views/layout_test/layout.sass +2 -0
- data/vendor/gems/ruby/1.8/gems/sinatra-0.9.4/compat/views/no_layout/no_layout.builder +1 -0
- data/vendor/gems/ruby/1.8/gems/sinatra-0.9.4/compat/views/no_layout/no_layout.haml +1 -0
- data/vendor/gems/ruby/1.8/gems/sinatra-0.9.4/lib/sinatra/base.rb +1119 -0
- data/vendor/gems/ruby/1.8/gems/sinatra-0.9.4/lib/sinatra/compat.rb +266 -0
- data/vendor/gems/ruby/1.8/gems/sinatra-0.9.4/lib/sinatra/images/404.png +0 -0
- data/vendor/gems/ruby/1.8/gems/sinatra-0.9.4/lib/sinatra/images/500.png +0 -0
- data/vendor/gems/ruby/1.8/gems/sinatra-0.9.4/lib/sinatra/main.rb +35 -0
- data/vendor/gems/ruby/1.8/gems/sinatra-0.9.4/lib/sinatra/showexceptions.rb +303 -0
- data/vendor/gems/ruby/1.8/gems/sinatra-0.9.4/lib/sinatra/test/bacon.rb +19 -0
- data/vendor/gems/ruby/1.8/gems/sinatra-0.9.4/lib/sinatra/test/rspec.rb +13 -0
- data/vendor/gems/ruby/1.8/gems/sinatra-0.9.4/lib/sinatra/test/spec.rb +11 -0
- data/vendor/gems/ruby/1.8/gems/sinatra-0.9.4/lib/sinatra/test/unit.rb +13 -0
- data/vendor/gems/ruby/1.8/gems/sinatra-0.9.4/lib/sinatra/test.rb +128 -0
- data/vendor/gems/ruby/1.8/gems/sinatra-0.9.4/lib/sinatra.rb +8 -0
- data/vendor/gems/ruby/1.8/gems/sinatra-0.9.4/sinatra.gemspec +125 -0
- data/vendor/gems/ruby/1.8/gems/sinatra-0.9.4/test/base_test.rb +160 -0
- data/vendor/gems/ruby/1.8/gems/sinatra-0.9.4/test/builder_test.rb +65 -0
- data/vendor/gems/ruby/1.8/gems/sinatra-0.9.4/test/contest.rb +64 -0
- data/vendor/gems/ruby/1.8/gems/sinatra-0.9.4/test/data/reload_app_file.rb +3 -0
- data/vendor/gems/ruby/1.8/gems/sinatra-0.9.4/test/erb_test.rb +81 -0
- data/vendor/gems/ruby/1.8/gems/sinatra-0.9.4/test/extensions_test.rb +100 -0
- data/vendor/gems/ruby/1.8/gems/sinatra-0.9.4/test/filter_test.rb +99 -0
- data/vendor/gems/ruby/1.8/gems/sinatra-0.9.4/test/haml_test.rb +90 -0
- data/vendor/gems/ruby/1.8/gems/sinatra-0.9.4/test/helper.rb +76 -0
- data/vendor/gems/ruby/1.8/gems/sinatra-0.9.4/test/helpers_test.rb +503 -0
- data/vendor/gems/ruby/1.8/gems/sinatra-0.9.4/test/mapped_error_test.rb +155 -0
- data/vendor/gems/ruby/1.8/gems/sinatra-0.9.4/test/middleware_test.rb +68 -0
- data/vendor/gems/ruby/1.8/gems/sinatra-0.9.4/test/options_test.rb +372 -0
- data/vendor/gems/ruby/1.8/gems/sinatra-0.9.4/test/render_backtrace_test.rb +145 -0
- data/vendor/gems/ruby/1.8/gems/sinatra-0.9.4/test/request_test.rb +18 -0
- data/vendor/gems/ruby/1.8/gems/sinatra-0.9.4/test/response_test.rb +42 -0
- data/vendor/gems/ruby/1.8/gems/sinatra-0.9.4/test/result_test.rb +98 -0
- data/vendor/gems/ruby/1.8/gems/sinatra-0.9.4/test/route_added_hook_test.rb +59 -0
- data/vendor/gems/ruby/1.8/gems/sinatra-0.9.4/test/routing_test.rb +784 -0
- data/vendor/gems/ruby/1.8/gems/sinatra-0.9.4/test/sass_test.rb +79 -0
- data/vendor/gems/ruby/1.8/gems/sinatra-0.9.4/test/server_test.rb +47 -0
- data/vendor/gems/ruby/1.8/gems/sinatra-0.9.4/test/sinatra_test.rb +13 -0
- data/vendor/gems/ruby/1.8/gems/sinatra-0.9.4/test/static_test.rb +80 -0
- data/vendor/gems/ruby/1.8/gems/sinatra-0.9.4/test/templates_test.rb +122 -0
- data/vendor/gems/ruby/1.8/gems/sinatra-0.9.4/test/test_test.rb +152 -0
- data/vendor/gems/ruby/1.8/gems/sinatra-0.9.4/test/views/error.builder +3 -0
- data/vendor/gems/ruby/1.8/gems/sinatra-0.9.4/test/views/error.erb +3 -0
- data/vendor/gems/ruby/1.8/gems/sinatra-0.9.4/test/views/error.haml +3 -0
- data/vendor/gems/ruby/1.8/gems/sinatra-0.9.4/test/views/error.sass +2 -0
- data/vendor/gems/ruby/1.8/gems/sinatra-0.9.4/test/views/foo/hello.test +1 -0
- data/vendor/gems/ruby/1.8/gems/sinatra-0.9.4/test/views/hello.builder +1 -0
- data/vendor/gems/ruby/1.8/gems/sinatra-0.9.4/test/views/hello.erb +1 -0
- data/vendor/gems/ruby/1.8/gems/sinatra-0.9.4/test/views/hello.haml +1 -0
- data/vendor/gems/ruby/1.8/gems/sinatra-0.9.4/test/views/hello.sass +2 -0
- data/vendor/gems/ruby/1.8/gems/sinatra-0.9.4/test/views/hello.test +1 -0
- data/vendor/gems/ruby/1.8/gems/sinatra-0.9.4/test/views/layout2.builder +3 -0
- data/vendor/gems/ruby/1.8/gems/sinatra-0.9.4/test/views/layout2.erb +2 -0
- data/vendor/gems/ruby/1.8/gems/sinatra-0.9.4/test/views/layout2.haml +2 -0
- data/vendor/gems/ruby/1.8/gems/sinatra-0.9.4/test/views/layout2.test +1 -0
- data/vendor/gems/ruby/1.8/specifications/akamai-0.0.1.gemspec +33 -0
- data/vendor/gems/ruby/1.8/specifications/casrack_the_authenticator-1.6.0.gemspec +45 -0
- data/vendor/gems/ruby/1.8/specifications/nokogiri-1.3.3.gemspec +50 -0
- data/vendor/gems/ruby/1.8/specifications/rack-1.1.0.gemspec +57 -0
- data/vendor/gems/ruby/1.8/specifications/sinatra-0.9.4.gemspec +40 -0
- metadata +621 -0
@@ -0,0 +1,123 @@
|
|
1
|
+
require File.expand_path(File.join(File.dirname(__FILE__), '..', "helper"))
|
2
|
+
|
3
|
+
module Nokogiri
|
4
|
+
module HTML
|
5
|
+
class TestDocumentFragment < Nokogiri::TestCase
|
6
|
+
def setup
|
7
|
+
super
|
8
|
+
@html = Nokogiri::HTML.parse(File.read(HTML_FILE), HTML_FILE)
|
9
|
+
end
|
10
|
+
|
11
|
+
def test_new
|
12
|
+
fragment = Nokogiri::HTML::DocumentFragment.new(@html)
|
13
|
+
end
|
14
|
+
|
15
|
+
def test_fragment_should_have_document
|
16
|
+
fragment = Nokogiri::HTML::DocumentFragment.new(@html)
|
17
|
+
assert_equal @html, fragment.document
|
18
|
+
end
|
19
|
+
|
20
|
+
def test_name
|
21
|
+
fragment = Nokogiri::HTML::DocumentFragment.new(@html)
|
22
|
+
assert_equal '#document-fragment', fragment.name
|
23
|
+
end
|
24
|
+
|
25
|
+
def test_static_method
|
26
|
+
fragment = Nokogiri::HTML::DocumentFragment.parse("<div>a</div>")
|
27
|
+
assert_instance_of Nokogiri::HTML::DocumentFragment, fragment
|
28
|
+
end
|
29
|
+
|
30
|
+
def test_many_fragments
|
31
|
+
100.times { Nokogiri::HTML::DocumentFragment.new(@html) }
|
32
|
+
end
|
33
|
+
|
34
|
+
def test_subclass
|
35
|
+
klass = Class.new(Nokogiri::HTML::DocumentFragment)
|
36
|
+
fragment = klass.new(@html, "<div>a</div>")
|
37
|
+
assert_instance_of klass, fragment
|
38
|
+
end
|
39
|
+
|
40
|
+
def test_subclass_parse
|
41
|
+
klass = Class.new(Nokogiri::HTML::DocumentFragment)
|
42
|
+
doc = klass.parse("<div>a</div>")
|
43
|
+
assert_instance_of klass, doc
|
44
|
+
end
|
45
|
+
|
46
|
+
def test_html_fragment
|
47
|
+
fragment = Nokogiri::HTML.fragment("<div>a</div>")
|
48
|
+
assert_equal "<div>a</div>", fragment.to_s
|
49
|
+
end
|
50
|
+
|
51
|
+
def test_html_fragment_has_outer_text
|
52
|
+
doc = "a<div>b</div>c"
|
53
|
+
fragment = Nokogiri::HTML::Document.new.fragment(doc)
|
54
|
+
if Nokogiri::VERSION_INFO['libxml']['loaded'] <= "2.6.16"
|
55
|
+
assert_equal "a<div>b</div><p>c</p>", fragment.to_s
|
56
|
+
else
|
57
|
+
assert_equal "a<div>b</div>c", fragment.to_s
|
58
|
+
end
|
59
|
+
end
|
60
|
+
|
61
|
+
def test_html_fragment_case_insensitivity
|
62
|
+
doc = "<crazyDiv>b</crazyDiv>"
|
63
|
+
fragment = Nokogiri::HTML::Document.new.fragment(doc)
|
64
|
+
assert_equal "<crazydiv>b</crazydiv>", fragment.to_s
|
65
|
+
end
|
66
|
+
|
67
|
+
def test_html_fragment_with_leading_whitespace
|
68
|
+
doc = " <div>b</div> "
|
69
|
+
fragment = Nokogiri::HTML::Document.new.fragment(doc)
|
70
|
+
assert_equal "<div>b</div>", fragment.to_s
|
71
|
+
end
|
72
|
+
|
73
|
+
def test_html_fragment_with_leading_whitespace_and_newline
|
74
|
+
doc = " \n<div>b</div> "
|
75
|
+
fragment = Nokogiri::HTML::Document.new.fragment(doc)
|
76
|
+
assert_equal "<div>b</div>", fragment.to_s
|
77
|
+
end
|
78
|
+
|
79
|
+
def test_to_s
|
80
|
+
doc = "<span>foo<br></span><span>bar</span>"
|
81
|
+
fragment = Nokogiri::HTML::Document.new.fragment(doc)
|
82
|
+
assert_equal "<span>foo<br></span><span>bar</span>", fragment.to_s
|
83
|
+
end
|
84
|
+
|
85
|
+
def test_to_html
|
86
|
+
doc = "<span>foo<br></span><span>bar</span>"
|
87
|
+
fragment = Nokogiri::HTML::Document.new.fragment(doc)
|
88
|
+
assert_equal "<span>foo<br></span><span>bar</span>", fragment.to_html
|
89
|
+
end
|
90
|
+
|
91
|
+
def test_to_xhtml
|
92
|
+
doc = "<span>foo<br></span><span>bar</span>"
|
93
|
+
fragment = Nokogiri::HTML::Document.new.fragment(doc)
|
94
|
+
if Nokogiri::VERSION_INFO['libxml']['loaded'] >= "2.7.0"
|
95
|
+
assert_equal "<span>foo<br /></span><span>bar</span>", fragment.to_xhtml
|
96
|
+
else
|
97
|
+
assert_equal "<span>foo<br></span><span>bar</span>", fragment.to_xhtml
|
98
|
+
end
|
99
|
+
end
|
100
|
+
|
101
|
+
def test_to_xml
|
102
|
+
doc = "<span>foo<br></span><span>bar</span>"
|
103
|
+
fragment = Nokogiri::HTML::Document.new.fragment(doc)
|
104
|
+
assert_equal "<span>foo<br/></span><span>bar</span>", fragment.to_xml
|
105
|
+
end
|
106
|
+
|
107
|
+
def test_fragment_script_tag_with_cdata
|
108
|
+
doc = HTML::Document.new
|
109
|
+
fragment = doc.fragment("<script>var foo = 'bar';</script>")
|
110
|
+
assert_equal("<script>var foo = 'bar';</script>",
|
111
|
+
fragment.to_s)
|
112
|
+
end
|
113
|
+
|
114
|
+
def test_fragment_with_comment
|
115
|
+
doc = HTML::Document.new
|
116
|
+
fragment = doc.fragment("<p>hello<!-- your ad here --></p>")
|
117
|
+
assert_equal("<p>hello<!-- your ad here --></p>",
|
118
|
+
fragment.to_s)
|
119
|
+
end
|
120
|
+
|
121
|
+
end
|
122
|
+
end
|
123
|
+
end
|
@@ -0,0 +1,95 @@
|
|
1
|
+
require File.expand_path(File.join(File.dirname(__FILE__), '..', "helper"))
|
2
|
+
|
3
|
+
module Nokogiri
|
4
|
+
module HTML
|
5
|
+
class TestElementDescription < Nokogiri::TestCase
|
6
|
+
def test_fetch_nonexistent
|
7
|
+
assert_nil ElementDescription['foo']
|
8
|
+
end
|
9
|
+
|
10
|
+
def test_fetch_element_description
|
11
|
+
assert desc = ElementDescription['a']
|
12
|
+
assert_instance_of ElementDescription, desc
|
13
|
+
end
|
14
|
+
|
15
|
+
def test_name
|
16
|
+
assert_equal 'a', ElementDescription['a'].name
|
17
|
+
end
|
18
|
+
|
19
|
+
def test_implied_start_tag?
|
20
|
+
assert !ElementDescription['a'].implied_start_tag?
|
21
|
+
end
|
22
|
+
|
23
|
+
def test_implied_end_tag?
|
24
|
+
assert !ElementDescription['a'].implied_end_tag?
|
25
|
+
assert ElementDescription['p'].implied_end_tag?
|
26
|
+
end
|
27
|
+
|
28
|
+
def test_save_end_tag?
|
29
|
+
assert !ElementDescription['a'].save_end_tag?
|
30
|
+
assert ElementDescription['br'].save_end_tag?
|
31
|
+
end
|
32
|
+
|
33
|
+
def test_empty?
|
34
|
+
assert ElementDescription['br'].empty?
|
35
|
+
assert !ElementDescription['a'].empty?
|
36
|
+
end
|
37
|
+
|
38
|
+
def test_deprecated?
|
39
|
+
assert ElementDescription['applet'].deprecated?
|
40
|
+
assert !ElementDescription['br'].deprecated?
|
41
|
+
end
|
42
|
+
|
43
|
+
def test_inline?
|
44
|
+
assert ElementDescription['a'].inline?
|
45
|
+
assert !ElementDescription['div'].inline?
|
46
|
+
end
|
47
|
+
|
48
|
+
def test_block?
|
49
|
+
element = ElementDescription['a']
|
50
|
+
assert_equal(!element.inline?, element.block?)
|
51
|
+
end
|
52
|
+
|
53
|
+
def test_description
|
54
|
+
assert ElementDescription['a'].description
|
55
|
+
end
|
56
|
+
|
57
|
+
def test_subelements
|
58
|
+
sub_elements = ElementDescription['body'].sub_elements
|
59
|
+
assert_equal 61, sub_elements.length
|
60
|
+
end
|
61
|
+
|
62
|
+
def test_default_sub_element
|
63
|
+
assert_equal 'div', ElementDescription['body'].default_sub_element
|
64
|
+
end
|
65
|
+
|
66
|
+
def test_optional_attributes
|
67
|
+
attrs = ElementDescription['table'].optional_attributes
|
68
|
+
assert attrs
|
69
|
+
assert_equal 22, attrs.length
|
70
|
+
end
|
71
|
+
|
72
|
+
def test_deprecated_attributes
|
73
|
+
attrs = ElementDescription['table'].deprecated_attributes
|
74
|
+
assert attrs
|
75
|
+
assert_equal 2, attrs.length
|
76
|
+
end
|
77
|
+
|
78
|
+
def test_required_attributes
|
79
|
+
attrs = ElementDescription['table'].required_attributes
|
80
|
+
assert attrs
|
81
|
+
assert_equal 0, attrs.length
|
82
|
+
end
|
83
|
+
|
84
|
+
def test_inspect
|
85
|
+
desc = ElementDescription['input']
|
86
|
+
assert_match desc.name, desc.inspect
|
87
|
+
end
|
88
|
+
|
89
|
+
def test_to_s
|
90
|
+
desc = ElementDescription['input']
|
91
|
+
assert_match desc.name, desc.to_s
|
92
|
+
end
|
93
|
+
end
|
94
|
+
end
|
95
|
+
end
|
@@ -0,0 +1,14 @@
|
|
1
|
+
require File.expand_path(File.join(File.dirname(__FILE__), '..', "helper"))
|
2
|
+
|
3
|
+
module Nokogiri
|
4
|
+
module HTML
|
5
|
+
class TestNamedCharacters < Nokogiri::TestCase
|
6
|
+
def test_named_character
|
7
|
+
copy = NamedCharacters.get('copy')
|
8
|
+
assert_equal 169, NamedCharacters['copy']
|
9
|
+
assert_equal copy.value, NamedCharacters['copy']
|
10
|
+
assert copy.description
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
@@ -0,0 +1,168 @@
|
|
1
|
+
require File.expand_path(File.join(File.dirname(__FILE__), '..', "helper"))
|
2
|
+
|
3
|
+
require 'nkf'
|
4
|
+
|
5
|
+
module Nokogiri
|
6
|
+
module HTML
|
7
|
+
class TestNode < Nokogiri::TestCase
|
8
|
+
def setup
|
9
|
+
super
|
10
|
+
@html = Nokogiri::HTML(<<-eohtml)
|
11
|
+
<html>
|
12
|
+
<head></head>
|
13
|
+
<body>
|
14
|
+
<div class='baz'><a href="foo" class="bar">first</a></div>
|
15
|
+
</body>
|
16
|
+
</html>
|
17
|
+
eohtml
|
18
|
+
end
|
19
|
+
|
20
|
+
def test_description
|
21
|
+
assert desc = @html.at('a.bar').description
|
22
|
+
assert_equal 'a', desc.name
|
23
|
+
end
|
24
|
+
|
25
|
+
def test_add_next_sibling_with_empty_nodeset
|
26
|
+
assert_raises(ArgumentError) {
|
27
|
+
@html.at('a').add_next_sibling(@html.at('head').children)
|
28
|
+
}
|
29
|
+
end
|
30
|
+
|
31
|
+
def test_add_next_sibling_with_non_empty_nodeset
|
32
|
+
assert_raises(ArgumentError) {
|
33
|
+
@html.at('head').add_next_sibling(@html.at('div').children)
|
34
|
+
}
|
35
|
+
end
|
36
|
+
|
37
|
+
def test_ancestors_with_selector
|
38
|
+
assert node = @html.at('a.bar').child
|
39
|
+
assert list = node.ancestors('.baz')
|
40
|
+
assert_equal 1, list.length
|
41
|
+
assert_equal 'div', list.first.name
|
42
|
+
end
|
43
|
+
|
44
|
+
def test_css_matches?
|
45
|
+
assert node = @html.at('a.bar')
|
46
|
+
assert node.matches?('a.bar')
|
47
|
+
end
|
48
|
+
|
49
|
+
def test_xpath_matches?
|
50
|
+
assert node = @html.at('//a')
|
51
|
+
assert node.matches?('//a')
|
52
|
+
end
|
53
|
+
|
54
|
+
def test_swap
|
55
|
+
@html.at('div').swap('<a href="foo">bar</a>')
|
56
|
+
a_tag = @html.css('a').first
|
57
|
+
assert_equal 'body', a_tag.parent.name
|
58
|
+
assert_equal 0, @html.css('div').length
|
59
|
+
end
|
60
|
+
|
61
|
+
def test_swap_with_regex_characters
|
62
|
+
@html.at('div').swap('<a href="foo">ba)r</a>')
|
63
|
+
a_tag = @html.css('a').first
|
64
|
+
assert_equal 'ba)r', a_tag.text
|
65
|
+
end
|
66
|
+
|
67
|
+
def test_attribute_decodes_entities
|
68
|
+
node = @html.at('div')
|
69
|
+
node['href'] = 'foo&bar'
|
70
|
+
assert_equal 'foo&bar', node['href']
|
71
|
+
node['href'] += '&baz'
|
72
|
+
assert_equal 'foo&bar&baz', node['href']
|
73
|
+
end
|
74
|
+
|
75
|
+
|
76
|
+
def test_before_will_prepend_text_nodes
|
77
|
+
assert node = @html.at('//body').children.first
|
78
|
+
node.before "some text"
|
79
|
+
assert_equal 'some text', @html.at('//body').children[0].content.strip
|
80
|
+
end
|
81
|
+
|
82
|
+
def test_fragment_handler_does_not_regurge_on_invalid_attributes
|
83
|
+
iframe = %Q{<iframe style="width: 0%; height: 0px" src="http://someurl" allowtransparency></iframe>}
|
84
|
+
assert_nothing_raised { @html.at('div').before(iframe) }
|
85
|
+
assert_nothing_raised { @html.at('div').after(iframe) }
|
86
|
+
assert_nothing_raised { @html.at('div').inner_html=(iframe) }
|
87
|
+
end
|
88
|
+
|
89
|
+
def test_inner_html=
|
90
|
+
assert div = @html.at('//div')
|
91
|
+
div.inner_html = '1<span>2</span>3'
|
92
|
+
assert_equal '1', div.children[0].to_s
|
93
|
+
assert_equal 'span', div.children[1].name
|
94
|
+
assert_equal '2', div.children[1].inner_text
|
95
|
+
assert_equal '3', div.children[2].to_s
|
96
|
+
|
97
|
+
div.inner_html = 'testing'
|
98
|
+
assert_equal 'testing', div.content
|
99
|
+
end
|
100
|
+
|
101
|
+
def test_fragment
|
102
|
+
fragment = @html.fragment(<<-eohtml)
|
103
|
+
hello
|
104
|
+
<div class="foo">
|
105
|
+
<p>bar</p>
|
106
|
+
</div>
|
107
|
+
world
|
108
|
+
eohtml
|
109
|
+
assert_match(/^hello/, fragment.inner_html.strip)
|
110
|
+
assert_equal 3, fragment.children.length
|
111
|
+
assert p_tag = fragment.css('p').first
|
112
|
+
assert_equal 'div', p_tag.parent.name
|
113
|
+
assert_equal 'foo', p_tag.parent['class']
|
114
|
+
end
|
115
|
+
|
116
|
+
def test_fragment_serialization
|
117
|
+
fragment = Nokogiri::HTML.fragment("<div>foo</div>")
|
118
|
+
assert_equal "<div>foo</div>", fragment.serialize.chomp
|
119
|
+
assert_equal "<div>foo</div>", fragment.to_xml.chomp
|
120
|
+
assert_equal "<div>foo</div>", fragment.inner_html
|
121
|
+
assert_equal "<div>foo</div>", fragment.to_html
|
122
|
+
assert_equal "<div>foo</div>", fragment.to_s
|
123
|
+
end
|
124
|
+
|
125
|
+
def test_after_will_append_text_nodes
|
126
|
+
assert node = @html.at('//body/div')
|
127
|
+
node.after "some text"
|
128
|
+
assert_equal 'some text', node.next.text.strip
|
129
|
+
end
|
130
|
+
|
131
|
+
def test_replace
|
132
|
+
doc = Nokogiri::HTML(<<-eohtml)
|
133
|
+
<html>
|
134
|
+
<head></head>
|
135
|
+
<body>
|
136
|
+
<center><img src='logo.gif' /></center>
|
137
|
+
</body>
|
138
|
+
</html>
|
139
|
+
eohtml
|
140
|
+
center = doc.at("//center")
|
141
|
+
img = center.search("//img")
|
142
|
+
assert_raises ArgumentError do
|
143
|
+
center.replace img
|
144
|
+
end
|
145
|
+
end
|
146
|
+
|
147
|
+
def test_to_html_does_not_contain_entities
|
148
|
+
html = NKF.nkf("-e --msdos", <<-EOH)
|
149
|
+
<html><body>
|
150
|
+
<p> test paragraph
|
151
|
+
foo bar </p>
|
152
|
+
</body></html>
|
153
|
+
EOH
|
154
|
+
nokogiri = Nokogiri::HTML.parse(html)
|
155
|
+
|
156
|
+
if RUBY_PLATFORM =~ /java/
|
157
|
+
# NKF linebreak modes are not supported as of jruby 1.2
|
158
|
+
# see http://jira.codehaus.org/browse/JRUBY-3602 for status
|
159
|
+
assert_equal "<p>testparagraph\nfoobar</p>",
|
160
|
+
nokogiri.at("p").to_html.gsub(/ /, '')
|
161
|
+
else
|
162
|
+
assert_equal "<p>testparagraph\r\nfoobar</p>",
|
163
|
+
nokogiri.at("p").to_html.gsub(/ /, '')
|
164
|
+
end
|
165
|
+
end
|
166
|
+
end
|
167
|
+
end
|
168
|
+
end
|
@@ -0,0 +1,137 @@
|
|
1
|
+
require File.expand_path(File.join(File.dirname(__FILE__), "helper"))
|
2
|
+
|
3
|
+
require 'rubygems'
|
4
|
+
|
5
|
+
class TestConvertXPath < Nokogiri::TestCase
|
6
|
+
|
7
|
+
def setup
|
8
|
+
super
|
9
|
+
@N = Nokogiri(File.read(HTML_FILE))
|
10
|
+
end
|
11
|
+
|
12
|
+
def assert_syntactical_equivalence(hpath, xpath, match, &blk)
|
13
|
+
blk ||= lambda {|j| j.first}
|
14
|
+
assert_equal match, blk.call(@N.search(xpath)), "xpath result did not match"
|
15
|
+
end
|
16
|
+
|
17
|
+
def test_child_tag
|
18
|
+
assert_syntactical_equivalence("h1[a]", ".//h1[child::a]", "Tender Lovemaking") do |j|
|
19
|
+
j.inner_text
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
23
|
+
def test_child_tag_equals
|
24
|
+
assert_syntactical_equivalence("h1[a='Tender Lovemaking']", ".//h1[child::a = 'Tender Lovemaking']", "Tender Lovemaking") do |j|
|
25
|
+
j.inner_text
|
26
|
+
end
|
27
|
+
end
|
28
|
+
|
29
|
+
def test_filter_contains
|
30
|
+
assert_syntactical_equivalence("title:contains('Tender')", ".//title[contains(., 'Tender')]",
|
31
|
+
"Tender Lovemaking ") do |j|
|
32
|
+
j.inner_text
|
33
|
+
end
|
34
|
+
end
|
35
|
+
|
36
|
+
def test_filter_comment
|
37
|
+
assert_syntactical_equivalence("div comment()[2]", ".//div//comment()[position() = 2]", "<!-- end of header -->") do |j|
|
38
|
+
j.first.to_s
|
39
|
+
end
|
40
|
+
end
|
41
|
+
|
42
|
+
def test_filter_text
|
43
|
+
assert_syntactical_equivalence("a[text()]", ".//a[normalize-space(child::text())]", "<a href=\"http://tenderlovemaking.com\">Tender Lovemaking</a>") do |j|
|
44
|
+
j.first.to_s
|
45
|
+
end
|
46
|
+
assert_syntactical_equivalence("a[text()='Tender Lovemaking']", ".//a[normalize-space(child::text()) = 'Tender Lovemaking']", "<a href=\"http://tenderlovemaking.com\">Tender Lovemaking</a>") do |j|
|
47
|
+
j.first.to_s
|
48
|
+
end
|
49
|
+
assert_syntactical_equivalence("a/text()", ".//a/child::text()", "Tender Lovemaking") do |j|
|
50
|
+
j.first.to_s
|
51
|
+
end
|
52
|
+
assert_syntactical_equivalence("h2//a[text()!='Back Home!']", ".//h2//a[normalize-space(child::text()) != 'Back Home!']", "Meow meow meow meow meow") do |j|
|
53
|
+
j.first.inner_text
|
54
|
+
end
|
55
|
+
end
|
56
|
+
|
57
|
+
def test_filter_by_attr
|
58
|
+
assert_syntactical_equivalence("a[@href='http://blog.geminigeek.com/wordpress-theme']",
|
59
|
+
".//a[@href = 'http://blog.geminigeek.com/wordpress-theme']",
|
60
|
+
"http://blog.geminigeek.com/wordpress-theme") do |j|
|
61
|
+
j.first["href"]
|
62
|
+
end
|
63
|
+
end
|
64
|
+
|
65
|
+
def test_css_id
|
66
|
+
assert_syntactical_equivalence("#linkcat-7", ".//*[@id = 'linkcat-7']", "linkcat-7") do |j|
|
67
|
+
j.first["id"]
|
68
|
+
end
|
69
|
+
assert_syntactical_equivalence("li#linkcat-7", ".//li[@id = 'linkcat-7']", "linkcat-7") do |j|
|
70
|
+
j.first["id"]
|
71
|
+
end
|
72
|
+
end
|
73
|
+
|
74
|
+
def test_css_class
|
75
|
+
assert_syntactical_equivalence(".cat-item-15", ".//*[contains(concat(' ', @class, ' '), ' cat-item-15 ')]",
|
76
|
+
"cat-item cat-item-15") do |j|
|
77
|
+
j.first["class"]
|
78
|
+
end
|
79
|
+
assert_syntactical_equivalence("li.cat-item-15", ".//li[contains(concat(' ', @class, ' '), ' cat-item-15 ')]",
|
80
|
+
"cat-item cat-item-15") do |j|
|
81
|
+
j.first["class"]
|
82
|
+
end
|
83
|
+
end
|
84
|
+
|
85
|
+
def test_css_tags
|
86
|
+
assert_syntactical_equivalence("div li a", ".//div//li//a", "http://brobinius.org/") do |j|
|
87
|
+
j.first.inner_text
|
88
|
+
end
|
89
|
+
assert_syntactical_equivalence("div li > a", ".//div//li/a", "http://brobinius.org/") do |j|
|
90
|
+
j.first.inner_text
|
91
|
+
end
|
92
|
+
assert_syntactical_equivalence("h1 ~ small", ".//small[preceding-sibling::h1]", "The act of making love, tenderly.") do |j|
|
93
|
+
j.first.inner_text
|
94
|
+
end
|
95
|
+
assert_syntactical_equivalence("h1 ~ small", ".//small[preceding-sibling::h1]", "The act of making love, tenderly.") do |j|
|
96
|
+
j.first.inner_text
|
97
|
+
end
|
98
|
+
end
|
99
|
+
|
100
|
+
def test_positional
|
101
|
+
assert_syntactical_equivalence("div/div:first()", ".//div/div[position() = 1]", "\r\nTender Lovemaking\r\nThe act of making love, tenderly.\r\n".gsub(/[\r\n]/, '')) do |j|
|
102
|
+
j.first.inner_text.gsub(/[\r\n]/, '')
|
103
|
+
end
|
104
|
+
assert_syntactical_equivalence("div/div:first", ".//div/div[position() = 1]", "\r\nTender Lovemaking\r\nThe act of making love, tenderly.\r\n".gsub(/[\r\n]/, '')) do |j|
|
105
|
+
j.first.inner_text.gsub(/[\r\n]/, '')
|
106
|
+
end
|
107
|
+
assert_syntactical_equivalence("div//a:last()", ".//div//a[position() = last()]", "Wordpress") do |j|
|
108
|
+
j.last.inner_text
|
109
|
+
end
|
110
|
+
assert_syntactical_equivalence("div//a:last", ".//div//a[position() = last()]", "Wordpress") do |j|
|
111
|
+
j.last.inner_text
|
112
|
+
end
|
113
|
+
end
|
114
|
+
|
115
|
+
def test_multiple_filters
|
116
|
+
assert_syntactical_equivalence("a[@rel='bookmark'][1]", ".//a[@rel = 'bookmark' and position() = 1]", "Back Home!") do |j|
|
117
|
+
j.first.inner_text
|
118
|
+
end
|
119
|
+
end
|
120
|
+
|
121
|
+
# TODO:
|
122
|
+
# doc/'title ~ link' -> links that are siblings of title
|
123
|
+
# doc/'p[@class~="final"]' -> class includes string (whitespacy)
|
124
|
+
# doc/'p[text()*="final"]' -> class includes string (index) (broken: always returns true?)
|
125
|
+
# doc/'p[text()$="final"]' -> /final$/
|
126
|
+
# doc/'p[text()|="final"]' -> /^final$/
|
127
|
+
# doc/'p[text()^="final"]' -> string starts with 'final
|
128
|
+
# nth_first
|
129
|
+
# nth_last
|
130
|
+
# even
|
131
|
+
# odd
|
132
|
+
# first-child, nth-child, last-child, nth-last-child, nth-last-of-type
|
133
|
+
# only-of-type, only-child
|
134
|
+
# parent
|
135
|
+
# empty
|
136
|
+
# root
|
137
|
+
end
|
@@ -0,0 +1,45 @@
|
|
1
|
+
require File.expand_path(File.join(File.dirname(__FILE__), "helper"))
|
2
|
+
|
3
|
+
class TestCssCache < Nokogiri::TestCase
|
4
|
+
|
5
|
+
def setup
|
6
|
+
super
|
7
|
+
@css = "a1 > b2 > c3"
|
8
|
+
@parse_result = Nokogiri::CSS.parse(@css)
|
9
|
+
@to_xpath_result = @parse_result.map {|ast| ast.to_xpath}
|
10
|
+
Nokogiri::CSS::Parser.class_eval do
|
11
|
+
class << @cache
|
12
|
+
alias :old_bracket :[]
|
13
|
+
attr_reader :count
|
14
|
+
def [](key)
|
15
|
+
@count ||= 0
|
16
|
+
@count += 1
|
17
|
+
old_bracket(key)
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
assert Nokogiri::CSS::Parser.cache_on?
|
22
|
+
end
|
23
|
+
|
24
|
+
def teardown
|
25
|
+
Nokogiri::CSS::Parser.clear_cache
|
26
|
+
Nokogiri::CSS::Parser.set_cache true
|
27
|
+
end
|
28
|
+
|
29
|
+
[ false, true ].each do |cache_setting|
|
30
|
+
define_method "test_css_cache_#{cache_setting ? "true" : "false"}" do
|
31
|
+
times = cache_setting ? 4 : nil
|
32
|
+
|
33
|
+
Nokogiri::CSS::Parser.set_cache cache_setting
|
34
|
+
|
35
|
+
Nokogiri::CSS.xpath_for(@css)
|
36
|
+
Nokogiri::CSS.xpath_for(@css)
|
37
|
+
Nokogiri::CSS::Parser.new.xpath_for(@css)
|
38
|
+
Nokogiri::CSS::Parser.new.xpath_for(@css)
|
39
|
+
|
40
|
+
assert_equal(times, Nokogiri::CSS::Parser.class_eval { @cache.count })
|
41
|
+
end
|
42
|
+
end
|
43
|
+
|
44
|
+
|
45
|
+
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
require File.expand_path(File.join(File.dirname(__FILE__), "helper"))
|
2
|
+
|
3
|
+
class TestGc < Nokogiri::TestCase
|
4
|
+
|
5
|
+
def test_dont_hurt_em_why
|
6
|
+
content = File.open("#{File.dirname(__FILE__)}/files/dont_hurt_em_why.xml").read
|
7
|
+
ndoc = Nokogiri::XML(content)
|
8
|
+
2.times do
|
9
|
+
info = ndoc.search('status text').first.inner_text
|
10
|
+
url = ndoc.search('user name').first.inner_text
|
11
|
+
GC.start
|
12
|
+
end
|
13
|
+
end
|
14
|
+
|
15
|
+
end
|
@@ -0,0 +1,77 @@
|
|
1
|
+
require File.expand_path(File.join(File.dirname(__FILE__), "helper"))
|
2
|
+
|
3
|
+
class TestMemoryLeak < Nokogiri::TestCase
|
4
|
+
|
5
|
+
if ENV['NOKOGIRI_GC'] # turning these off by default for now
|
6
|
+
|
7
|
+
def test_for_memory_leak
|
8
|
+
begin
|
9
|
+
# we don't use Dike in any tests, but requiring it has side effects
|
10
|
+
# that can create memory leaks, and that's what we're testing for.
|
11
|
+
require 'rubygems'
|
12
|
+
require 'dike' # do not remove!
|
13
|
+
|
14
|
+
count_start = count_object_space_documents
|
15
|
+
xml_data = <<-EOS
|
16
|
+
<test>
|
17
|
+
<items>
|
18
|
+
<item>abc</item>
|
19
|
+
<item>1234</item>
|
20
|
+
<item>Zzz</item>
|
21
|
+
<items>
|
22
|
+
</test>
|
23
|
+
EOS
|
24
|
+
20.times do
|
25
|
+
doc = Nokogiri::XML(xml_data)
|
26
|
+
doc.xpath("//item")
|
27
|
+
end
|
28
|
+
2.times { GC.start }
|
29
|
+
count_end = count_object_space_documents
|
30
|
+
assert((count_end - count_start) <= 2, "memory leak detected")
|
31
|
+
rescue LoadError
|
32
|
+
puts "\ndike is not installed, skipping memory leak test"
|
33
|
+
end
|
34
|
+
end
|
35
|
+
|
36
|
+
if Nokogiri.ffi?
|
37
|
+
[ ['Node', 'p', nil],
|
38
|
+
['CDATA', nil, 'content'],
|
39
|
+
['Comment', nil, 'content'],
|
40
|
+
['DocumentFragment', nil],
|
41
|
+
['EntityReference', nil, 'p'],
|
42
|
+
['ProcessingInstruction', nil, 'p', 'content'] ].each do |klass, *args|
|
43
|
+
|
44
|
+
define_method "test_for_leaked_#{klass}_nodes" do
|
45
|
+
Nokogiri::LibXML.expects(:xmlAddChild).at_least(1) # more than once shows we're GCing properly
|
46
|
+
10.times {
|
47
|
+
xml = Nokogiri::XML("<root></root>")
|
48
|
+
2.times { Nokogiri::XML.const_get(klass).new(*(args.collect{|arg| arg || xml})) }
|
49
|
+
GC.start
|
50
|
+
}
|
51
|
+
GC.start
|
52
|
+
end
|
53
|
+
|
54
|
+
end
|
55
|
+
|
56
|
+
def test_for_leaked_attr_nodes
|
57
|
+
Nokogiri::LibXML.expects(:xmlFreePropList).at_least(1) # more than once shows we're GCing properly
|
58
|
+
10.times {
|
59
|
+
xml = Nokogiri::XML("<root></root>")
|
60
|
+
2.times { Nokogiri::XML::Attr.new(xml, "p") }
|
61
|
+
GC.start
|
62
|
+
}
|
63
|
+
GC.start
|
64
|
+
end
|
65
|
+
|
66
|
+
end # if ffi
|
67
|
+
|
68
|
+
end # if NOKOGIRI_GC
|
69
|
+
|
70
|
+
private
|
71
|
+
|
72
|
+
def count_object_space_documents
|
73
|
+
count = 0
|
74
|
+
ObjectSpace.each_object {|j| count += 1 if j.is_a?(Nokogiri::XML::Document) }
|
75
|
+
count
|
76
|
+
end
|
77
|
+
end
|