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,823 @@
|
|
1
|
+
require File.expand_path(File.join(File.dirname(__FILE__), '..', "helper"))
|
2
|
+
|
3
|
+
require 'stringio'
|
4
|
+
|
5
|
+
module Nokogiri
|
6
|
+
module XML
|
7
|
+
class TestNode < Nokogiri::TestCase
|
8
|
+
def setup
|
9
|
+
super
|
10
|
+
@xml = Nokogiri::XML(File.read(XML_FILE), XML_FILE)
|
11
|
+
end
|
12
|
+
|
13
|
+
def test_namespace_nodes
|
14
|
+
xml = Nokogiri::XML <<-eoxml
|
15
|
+
<root xmlns="http://tenderlovemaking.com/" xmlns:foo="bar">
|
16
|
+
<awesome/>
|
17
|
+
</root>
|
18
|
+
eoxml
|
19
|
+
awesome = xml.root
|
20
|
+
namespaces = awesome.namespace_definitions
|
21
|
+
assert_equal 2, namespaces.length
|
22
|
+
end
|
23
|
+
|
24
|
+
def test_no_definitions
|
25
|
+
xml = Nokogiri::XML <<-eoxml
|
26
|
+
<root xmlns="http://tenderlovemaking.com/" xmlns:foo="bar">
|
27
|
+
<awesome/>
|
28
|
+
</root>
|
29
|
+
eoxml
|
30
|
+
awesome = xml.at('//xmlns:awesome')
|
31
|
+
namespaces = awesome.namespace_definitions
|
32
|
+
assert_equal 0, namespaces.length
|
33
|
+
end
|
34
|
+
|
35
|
+
def test_subclass_dup
|
36
|
+
subclass = Class.new(Nokogiri::XML::Node)
|
37
|
+
node = subclass.new('foo', @xml).dup
|
38
|
+
assert_instance_of subclass, node
|
39
|
+
end
|
40
|
+
|
41
|
+
def test_namespace_goes_to_children
|
42
|
+
fruits = Nokogiri::XML(<<-eoxml)
|
43
|
+
<Fruit xmlns='www.fruits.org'>
|
44
|
+
</Fruit>
|
45
|
+
eoxml
|
46
|
+
apple = Nokogiri::XML::Node.new('Apple', fruits)
|
47
|
+
orange = Nokogiri::XML::Node.new('Orange', fruits)
|
48
|
+
apple << orange
|
49
|
+
fruits.root << apple
|
50
|
+
assert fruits.at('//fruit:Orange',{'fruit'=>'www.fruits.org'})
|
51
|
+
assert fruits.at('//fruit:Apple',{'fruit'=>'www.fruits.org'})
|
52
|
+
end
|
53
|
+
|
54
|
+
def test_description
|
55
|
+
assert_nil @xml.at('employee').description
|
56
|
+
end
|
57
|
+
|
58
|
+
def test_add_namespace_add_child
|
59
|
+
doc = Nokogiri::XML::Document.new
|
60
|
+
item = Nokogiri::XML::Element.new('item', doc)
|
61
|
+
doc.root = item
|
62
|
+
|
63
|
+
entry = Nokogiri::XML::Element.new('entry', doc)
|
64
|
+
entry.add_namespace('tlm', 'http://tenderlovemaking.com')
|
65
|
+
assert_equal 'http://tenderlovemaking.com', entry.namespaces['xmlns:tlm']
|
66
|
+
item.add_child(entry)
|
67
|
+
assert_equal 'http://tenderlovemaking.com', entry.namespaces['xmlns:tlm']
|
68
|
+
end
|
69
|
+
|
70
|
+
def test_spaceship
|
71
|
+
nodes = @xml.xpath('//employee')
|
72
|
+
assert_equal(-1, (nodes.first <=> nodes.last))
|
73
|
+
list = [nodes.first, nodes.last].sort
|
74
|
+
assert_equal nodes.first, list.first
|
75
|
+
assert_equal nodes.last, list.last
|
76
|
+
end
|
77
|
+
|
78
|
+
def test_incorrect_spaceship
|
79
|
+
nodes = @xml.xpath('//employee')
|
80
|
+
assert_nil(nodes.first <=> 'asdf')
|
81
|
+
end
|
82
|
+
|
83
|
+
def test_document_compare
|
84
|
+
nodes = @xml.xpath('//employee')
|
85
|
+
assert_equal(-1, (nodes.first <=> @xml))
|
86
|
+
end
|
87
|
+
|
88
|
+
def test_different_document_compare
|
89
|
+
nodes = @xml.xpath('//employee')
|
90
|
+
doc = Nokogiri::XML('<a><b/></a>')
|
91
|
+
b = doc.at('b')
|
92
|
+
assert_nil(nodes.first <=> b)
|
93
|
+
end
|
94
|
+
|
95
|
+
def test_duplicate_node_removes_namespace
|
96
|
+
fruits = Nokogiri::XML(<<-eoxml)
|
97
|
+
<Fruit xmlns='www.fruits.org'>
|
98
|
+
<Apple></Apple>
|
99
|
+
</Fruit>
|
100
|
+
eoxml
|
101
|
+
apple = fruits.root.xpath('fruit:Apple', {'fruit'=>'www.fruits.org'})[0]
|
102
|
+
new_apple = apple.dup
|
103
|
+
fruits.root << new_apple
|
104
|
+
assert_equal 2, fruits.xpath('//xmlns:Apple').length
|
105
|
+
assert_equal 1, fruits.to_xml.scan('www.fruits.org').length
|
106
|
+
end
|
107
|
+
|
108
|
+
[:clone, :dup].each do |symbol|
|
109
|
+
define_method "test_#{symbol}" do
|
110
|
+
node = @xml.at('//employee')
|
111
|
+
other = node.send(symbol)
|
112
|
+
assert_equal "employee", other.name
|
113
|
+
assert_nil other.parent
|
114
|
+
end
|
115
|
+
end
|
116
|
+
|
117
|
+
def test_fragment_creates_elements
|
118
|
+
apple = @xml.fragment('<Apple/>')
|
119
|
+
apple.children.each do |child|
|
120
|
+
assert_equal Nokogiri::XML::Node::ELEMENT_NODE, child.type
|
121
|
+
assert_instance_of Nokogiri::XML::Element, child
|
122
|
+
end
|
123
|
+
end
|
124
|
+
|
125
|
+
def test_node_added_to_root_should_get_namespace
|
126
|
+
fruits = Nokogiri::XML(<<-eoxml)
|
127
|
+
<Fruit xmlns='http://www.fruits.org'>
|
128
|
+
</Fruit>
|
129
|
+
eoxml
|
130
|
+
apple = fruits.fragment('<Apple/>')
|
131
|
+
fruits.root << apple
|
132
|
+
assert_equal 1, fruits.xpath('//xmlns:Apple').length
|
133
|
+
end
|
134
|
+
|
135
|
+
def test_add_child_path_following_sequential_text_nodes
|
136
|
+
xml = Nokogiri::XML('<root>text</root>')
|
137
|
+
xml.root.add_child(Nokogiri::XML::Text.new('text', xml))
|
138
|
+
item = xml.root.add_child(Nokogiri::XML::Element.new('item', xml))
|
139
|
+
assert_equal '/root/item', item.path
|
140
|
+
end
|
141
|
+
|
142
|
+
def test_new_node_can_have_ancestors
|
143
|
+
xml = Nokogiri::XML('<root>text</root>')
|
144
|
+
item = Nokogiri::XML::Element.new('item', xml)
|
145
|
+
assert_equal 0, item.ancestors.length
|
146
|
+
end
|
147
|
+
|
148
|
+
def test_children
|
149
|
+
doc = Nokogiri::XML(<<-eoxml)
|
150
|
+
<root>#{'<a/>' * 9 }</root>
|
151
|
+
eoxml
|
152
|
+
assert_equal 9, doc.root.children.length
|
153
|
+
assert_equal 9, doc.root.children.to_a.length
|
154
|
+
|
155
|
+
doc = Nokogiri::XML(<<-eoxml)
|
156
|
+
<root>#{'<a/>' * 15 }</root>
|
157
|
+
eoxml
|
158
|
+
assert_equal 15, doc.root.children.length
|
159
|
+
assert_equal 15, doc.root.children.to_a.length
|
160
|
+
end
|
161
|
+
|
162
|
+
def test_add_namespace
|
163
|
+
node = @xml.at('address')
|
164
|
+
node.add_namespace('foo', 'http://tenderlovemaking.com')
|
165
|
+
assert_equal 'http://tenderlovemaking.com', node.namespaces['xmlns:foo']
|
166
|
+
end
|
167
|
+
|
168
|
+
def test_add_namespace_twice
|
169
|
+
node = @xml.at('address')
|
170
|
+
ns = node.add_namespace('foo', 'http://tenderlovemaking.com')
|
171
|
+
ns2 = node.add_namespace('foo', 'http://tenderlovemaking.com')
|
172
|
+
assert_equal ns, ns2
|
173
|
+
end
|
174
|
+
|
175
|
+
def test_add_default_ns
|
176
|
+
node = @xml.at('address')
|
177
|
+
node.add_namespace(nil, 'http://tenderlovemaking.com')
|
178
|
+
assert_equal 'http://tenderlovemaking.com', node.namespaces['xmlns']
|
179
|
+
end
|
180
|
+
|
181
|
+
def test_add_multiple_namespaces
|
182
|
+
node = @xml.at('address')
|
183
|
+
|
184
|
+
node.add_namespace(nil, 'http://tenderlovemaking.com')
|
185
|
+
assert_equal 'http://tenderlovemaking.com', node.namespaces['xmlns']
|
186
|
+
|
187
|
+
node.add_namespace('foo', 'http://tenderlovemaking.com')
|
188
|
+
assert_equal 'http://tenderlovemaking.com', node.namespaces['xmlns:foo']
|
189
|
+
end
|
190
|
+
|
191
|
+
def test_default_namespace=
|
192
|
+
node = @xml.at('address')
|
193
|
+
node.default_namespace = 'http://tenderlovemaking.com'
|
194
|
+
assert_equal 'http://tenderlovemaking.com', node.namespaces['xmlns']
|
195
|
+
end
|
196
|
+
|
197
|
+
def test_namespace=
|
198
|
+
node = @xml.at('address')
|
199
|
+
assert_nil node.namespace
|
200
|
+
definition = node.add_namespace_definition 'bar', 'http://tlm.com/'
|
201
|
+
|
202
|
+
node.namespace = definition
|
203
|
+
|
204
|
+
assert_equal definition, node.namespace
|
205
|
+
|
206
|
+
assert_equal node, @xml.at('//foo:address', {
|
207
|
+
'foo' => 'http://tlm.com/'
|
208
|
+
})
|
209
|
+
end
|
210
|
+
|
211
|
+
def test_add_namespace_with_nil_associates_node
|
212
|
+
node = @xml.at('address')
|
213
|
+
assert_nil node.namespace
|
214
|
+
definition = node.add_namespace_definition nil, 'http://tlm.com/'
|
215
|
+
assert_equal definition, node.namespace
|
216
|
+
end
|
217
|
+
|
218
|
+
def test_add_namespace_does_not_associate_node
|
219
|
+
node = @xml.at('address')
|
220
|
+
assert_nil node.namespace
|
221
|
+
definition = node.add_namespace_definition 'foo', 'http://tlm.com/'
|
222
|
+
assert_nil node.namespace
|
223
|
+
end
|
224
|
+
|
225
|
+
def test_set_namespace_from_different_doc
|
226
|
+
node = @xml.at('address')
|
227
|
+
doc = Nokogiri::XML(File.read(XML_FILE), XML_FILE)
|
228
|
+
decl = doc.root.add_namespace_definition 'foo', 'bar'
|
229
|
+
|
230
|
+
assert_raises(ArgumentError) do
|
231
|
+
node.namespace = decl
|
232
|
+
end
|
233
|
+
end
|
234
|
+
|
235
|
+
def test_set_namespace_must_only_take_a_namespace
|
236
|
+
node = @xml.at('address')
|
237
|
+
assert_raises(TypeError) do
|
238
|
+
node.namespace = node
|
239
|
+
end
|
240
|
+
end
|
241
|
+
|
242
|
+
def test_at
|
243
|
+
node = @xml.at('address')
|
244
|
+
assert_equal node, @xml.xpath('//address').first
|
245
|
+
end
|
246
|
+
|
247
|
+
def test_percent
|
248
|
+
node = @xml % ('address')
|
249
|
+
assert_equal node, @xml.xpath('//address').first
|
250
|
+
end
|
251
|
+
|
252
|
+
def test_accept
|
253
|
+
visitor = Class.new {
|
254
|
+
attr_accessor :visited
|
255
|
+
def accept target
|
256
|
+
target.accept(self)
|
257
|
+
end
|
258
|
+
|
259
|
+
def visit node
|
260
|
+
node.children.each { |c| c.accept(self) }
|
261
|
+
@visited = true
|
262
|
+
end
|
263
|
+
}.new
|
264
|
+
visitor.accept(@xml.root)
|
265
|
+
assert visitor.visited
|
266
|
+
end
|
267
|
+
|
268
|
+
def test_replace_with_default_namespaces
|
269
|
+
fruits = Nokogiri::XML(<<-eoxml)
|
270
|
+
<fruit xmlns="http://fruits.org">
|
271
|
+
<apple />
|
272
|
+
</fruit>
|
273
|
+
eoxml
|
274
|
+
|
275
|
+
apple = fruits.css('apple').first
|
276
|
+
|
277
|
+
orange = Nokogiri::XML::Node.new('orange', fruits)
|
278
|
+
apple.replace(orange)
|
279
|
+
|
280
|
+
assert_equal orange, fruits.css('orange').first
|
281
|
+
end
|
282
|
+
|
283
|
+
def test_add_child_should_inherit_namespace
|
284
|
+
doc = Nokogiri::XML(<<-eoxml)
|
285
|
+
<root xmlns="http://tenderlovemaking.com/">
|
286
|
+
<first>
|
287
|
+
</first>
|
288
|
+
</root>
|
289
|
+
eoxml
|
290
|
+
assert node = doc.at('//xmlns:first')
|
291
|
+
child = Nokogiri::XML::Node.new('second', doc)
|
292
|
+
node.add_child(child)
|
293
|
+
assert doc.at('//xmlns:second')
|
294
|
+
end
|
295
|
+
|
296
|
+
def test_write_to
|
297
|
+
io = StringIO.new
|
298
|
+
@xml.write_to io
|
299
|
+
io.rewind
|
300
|
+
assert_equal @xml.to_xml, io.read
|
301
|
+
end
|
302
|
+
|
303
|
+
def test_attribute_with_symbol
|
304
|
+
assert_equal 'Yes', @xml.css('address').first[:domestic]
|
305
|
+
end
|
306
|
+
|
307
|
+
def test_write_to_with_block
|
308
|
+
called = false
|
309
|
+
io = StringIO.new
|
310
|
+
conf = nil
|
311
|
+
@xml.write_to io do |config|
|
312
|
+
called = true
|
313
|
+
conf = config
|
314
|
+
config.format.as_html.no_empty_tags
|
315
|
+
end
|
316
|
+
io.rewind
|
317
|
+
assert called
|
318
|
+
assert_equal @xml.serialize(nil, conf.options), io.read
|
319
|
+
end
|
320
|
+
|
321
|
+
%w{ xml html xhtml }.each do |type|
|
322
|
+
define_method(:"test_write_#{type}_to") do
|
323
|
+
io = StringIO.new
|
324
|
+
assert @xml.send(:"write_#{type}_to", io)
|
325
|
+
io.rewind
|
326
|
+
assert_match @xml.send(:"to_#{type}"), io.read
|
327
|
+
end
|
328
|
+
end
|
329
|
+
|
330
|
+
def test_serialize_with_block
|
331
|
+
called = false
|
332
|
+
conf = nil
|
333
|
+
string = @xml.serialize do |config|
|
334
|
+
called = true
|
335
|
+
conf = config
|
336
|
+
config.format.as_html.no_empty_tags
|
337
|
+
end
|
338
|
+
assert called
|
339
|
+
assert_equal @xml.serialize(nil, conf.options), string
|
340
|
+
end
|
341
|
+
|
342
|
+
def test_hold_refence_to_subnode
|
343
|
+
doc = Nokogiri::XML(<<-eoxml)
|
344
|
+
<root>
|
345
|
+
<a>
|
346
|
+
<b />
|
347
|
+
</a>
|
348
|
+
</root>
|
349
|
+
eoxml
|
350
|
+
assert node_a = doc.css('a').first
|
351
|
+
assert node_b = node_a.css('b').first
|
352
|
+
node_a.unlink
|
353
|
+
assert_equal 'b', node_b.name
|
354
|
+
end
|
355
|
+
|
356
|
+
def test_values
|
357
|
+
assert_equal %w{ Yes Yes }, @xml.xpath('//address')[1].values
|
358
|
+
end
|
359
|
+
|
360
|
+
def test_keys
|
361
|
+
assert_equal %w{ domestic street }, @xml.xpath('//address')[1].keys
|
362
|
+
end
|
363
|
+
|
364
|
+
def test_each
|
365
|
+
attributes = []
|
366
|
+
@xml.xpath('//address')[1].each do |key, value|
|
367
|
+
attributes << [key, value]
|
368
|
+
end
|
369
|
+
assert_equal [['domestic', 'Yes'], ['street', 'Yes']], attributes
|
370
|
+
end
|
371
|
+
|
372
|
+
def test_new
|
373
|
+
assert node = Nokogiri::XML::Node.new('input', @xml)
|
374
|
+
assert_equal 1, node.node_type
|
375
|
+
assert_instance_of Nokogiri::XML::Element, node
|
376
|
+
end
|
377
|
+
|
378
|
+
def test_to_str
|
379
|
+
name = @xml.xpath('//name').first
|
380
|
+
assert_match(/Margaret/, '' + name)
|
381
|
+
assert_equal('Margaret Martin', '' + name.children.first)
|
382
|
+
end
|
383
|
+
|
384
|
+
def test_ancestors
|
385
|
+
address = @xml.xpath('//address').first
|
386
|
+
assert_equal 3, address.ancestors.length
|
387
|
+
assert_equal ['employee', 'staff', 'document'],
|
388
|
+
address.ancestors.map { |x| x.name }
|
389
|
+
end
|
390
|
+
|
391
|
+
def test_read_only?
|
392
|
+
assert entity_decl = @xml.internal_subset.children.find { |x|
|
393
|
+
x.type == Node::ENTITY_DECL
|
394
|
+
}
|
395
|
+
assert entity_decl.read_only?
|
396
|
+
end
|
397
|
+
|
398
|
+
def test_remove_attribute
|
399
|
+
address = @xml.xpath('/staff/employee/address').first
|
400
|
+
assert_equal 'Yes', address['domestic']
|
401
|
+
address.remove_attribute 'domestic'
|
402
|
+
assert_nil address['domestic']
|
403
|
+
end
|
404
|
+
|
405
|
+
def test_delete
|
406
|
+
address = @xml.xpath('/staff/employee/address').first
|
407
|
+
assert_equal 'Yes', address['domestic']
|
408
|
+
address.delete 'domestic'
|
409
|
+
assert_nil address['domestic']
|
410
|
+
end
|
411
|
+
|
412
|
+
def test_add_child_in_same_document
|
413
|
+
child = @xml.css('employee').first
|
414
|
+
|
415
|
+
assert previous_last_child = child.children.last
|
416
|
+
assert new_child = child.children.first
|
417
|
+
|
418
|
+
last = child.children.last
|
419
|
+
|
420
|
+
child.add_child(new_child)
|
421
|
+
assert_equal new_child, child.children.last
|
422
|
+
assert_equal last, child.children.last
|
423
|
+
end
|
424
|
+
|
425
|
+
def test_add_child_from_other_document
|
426
|
+
d1 = Nokogiri::XML("<root><item>1</item><item>2</item></root>")
|
427
|
+
d2 = Nokogiri::XML("<root><item>3</item><item>4</item></root>")
|
428
|
+
|
429
|
+
d2.at('root').search('item').each do |i|
|
430
|
+
d1.at('root').add_child i
|
431
|
+
end
|
432
|
+
|
433
|
+
assert_equal 0, d2.search('item').size
|
434
|
+
assert_equal 4, d1.search('item').size
|
435
|
+
end
|
436
|
+
|
437
|
+
def test_add_child
|
438
|
+
xml = Nokogiri::XML(<<-eoxml)
|
439
|
+
<root>
|
440
|
+
<a>Hello world</a>
|
441
|
+
</root>
|
442
|
+
eoxml
|
443
|
+
text_node = Nokogiri::XML::Text.new('hello', xml)
|
444
|
+
assert_equal Nokogiri::XML::Node::TEXT_NODE, text_node.type
|
445
|
+
xml.root.add_child text_node
|
446
|
+
assert_match 'hello', xml.to_s
|
447
|
+
end
|
448
|
+
|
449
|
+
def test_chevron_works_as_add_child
|
450
|
+
xml = Nokogiri::XML(<<-eoxml)
|
451
|
+
<root>
|
452
|
+
<a>Hello world</a>
|
453
|
+
</root>
|
454
|
+
eoxml
|
455
|
+
text_node = Nokogiri::XML::Text.new('hello', xml)
|
456
|
+
xml.root << text_node
|
457
|
+
assert_match 'hello', xml.to_s
|
458
|
+
end
|
459
|
+
|
460
|
+
def test_set_content_with_symbol
|
461
|
+
node = @xml.at('//name')
|
462
|
+
node.content = :foo
|
463
|
+
assert_equal 'foo', node.content
|
464
|
+
end
|
465
|
+
|
466
|
+
def test_add_previous_sibling
|
467
|
+
xml = Nokogiri::XML(<<-eoxml)
|
468
|
+
<root>
|
469
|
+
<a>Hello world</a>
|
470
|
+
</root>
|
471
|
+
eoxml
|
472
|
+
b_node = Nokogiri::XML::Node.new('a', xml)
|
473
|
+
assert_equal Nokogiri::XML::Node::ELEMENT_NODE, b_node.type
|
474
|
+
b_node.content = 'first'
|
475
|
+
a_node = xml.xpath('//a').first
|
476
|
+
a_node.add_previous_sibling(b_node)
|
477
|
+
assert_equal('first', xml.xpath('//a').first.text)
|
478
|
+
end
|
479
|
+
|
480
|
+
def test_add_previous_sibling_merge
|
481
|
+
xml = Nokogiri::XML(<<-eoxml)
|
482
|
+
<root>
|
483
|
+
<a>Hello world</a>
|
484
|
+
</root>
|
485
|
+
eoxml
|
486
|
+
|
487
|
+
assert a_tag = xml.css('a').first
|
488
|
+
|
489
|
+
left_space = a_tag.previous
|
490
|
+
right_space = a_tag.next
|
491
|
+
assert left_space.text?
|
492
|
+
assert right_space.text?
|
493
|
+
|
494
|
+
left_space.add_previous_sibling(right_space)
|
495
|
+
assert_equal left_space, right_space
|
496
|
+
end
|
497
|
+
|
498
|
+
def test_add_next_sibling_merge
|
499
|
+
xml = Nokogiri::XML(<<-eoxml)
|
500
|
+
<root>
|
501
|
+
<a>Hello world</a>
|
502
|
+
</root>
|
503
|
+
eoxml
|
504
|
+
|
505
|
+
assert a_tag = xml.css('a').first
|
506
|
+
|
507
|
+
left_space = a_tag.previous
|
508
|
+
right_space = a_tag.next
|
509
|
+
assert left_space.text?
|
510
|
+
assert right_space.text?
|
511
|
+
|
512
|
+
right_space.add_next_sibling(left_space)
|
513
|
+
assert_equal left_space, right_space
|
514
|
+
end
|
515
|
+
|
516
|
+
def test_find_by_css_with_tilde_eql
|
517
|
+
xml = Nokogiri::XML.parse(<<-eoxml)
|
518
|
+
<root>
|
519
|
+
<a>Hello world</a>
|
520
|
+
<a class='foo bar'>Bar</a>
|
521
|
+
<a class='bar foo'>Bar</a>
|
522
|
+
<a class='bar'>Bar</a>
|
523
|
+
<a class='baz bar foo'>Bar</a>
|
524
|
+
<a class='bazbarfoo'>Awesome</a>
|
525
|
+
<a class='bazbar'>Awesome</a>
|
526
|
+
</root>
|
527
|
+
eoxml
|
528
|
+
set = xml.css('a[@class~="bar"]')
|
529
|
+
assert_equal 4, set.length
|
530
|
+
assert_equal ['Bar'], set.map { |node| node.content }.uniq
|
531
|
+
end
|
532
|
+
|
533
|
+
def test_unlink
|
534
|
+
xml = Nokogiri::XML.parse(<<-eoxml)
|
535
|
+
<root>
|
536
|
+
<a class='foo bar'>Bar</a>
|
537
|
+
<a class='bar foo'>Bar</a>
|
538
|
+
<a class='bar'>Bar</a>
|
539
|
+
<a>Hello world</a>
|
540
|
+
<a class='baz bar foo'>Bar</a>
|
541
|
+
<a class='bazbarfoo'>Awesome</a>
|
542
|
+
<a class='bazbar'>Awesome</a>
|
543
|
+
</root>
|
544
|
+
eoxml
|
545
|
+
node = xml.xpath('//a')[3]
|
546
|
+
assert_equal('Hello world', node.text)
|
547
|
+
assert_match(/Hello world/, xml.to_s)
|
548
|
+
assert node.parent
|
549
|
+
assert node.document
|
550
|
+
assert node.previous_sibling
|
551
|
+
assert node.next_sibling
|
552
|
+
node.unlink
|
553
|
+
assert !node.parent
|
554
|
+
#assert !node.document
|
555
|
+
assert !node.previous_sibling
|
556
|
+
assert !node.next_sibling
|
557
|
+
assert_no_match(/Hello world/, xml.to_s)
|
558
|
+
end
|
559
|
+
|
560
|
+
def test_next_sibling
|
561
|
+
assert node = @xml.root
|
562
|
+
assert sibling = node.child.next_sibling
|
563
|
+
assert_equal('employee', sibling.name)
|
564
|
+
end
|
565
|
+
|
566
|
+
def test_previous_sibling
|
567
|
+
assert node = @xml.root
|
568
|
+
assert sibling = node.child.next_sibling
|
569
|
+
assert_equal('employee', sibling.name)
|
570
|
+
assert_equal(sibling.previous_sibling, node.child)
|
571
|
+
end
|
572
|
+
|
573
|
+
def test_name=
|
574
|
+
assert node = @xml.root
|
575
|
+
node.name = 'awesome'
|
576
|
+
assert_equal('awesome', node.name)
|
577
|
+
end
|
578
|
+
|
579
|
+
def test_child
|
580
|
+
assert node = @xml.root
|
581
|
+
assert child = node.child
|
582
|
+
assert_equal('text', child.name)
|
583
|
+
end
|
584
|
+
|
585
|
+
def test_key?
|
586
|
+
assert node = @xml.search('//address').first
|
587
|
+
assert(!node.key?('asdfasdf'))
|
588
|
+
end
|
589
|
+
|
590
|
+
def test_set_property
|
591
|
+
assert node = @xml.search('//address').first
|
592
|
+
node['foo'] = 'bar'
|
593
|
+
assert_equal('bar', node['foo'])
|
594
|
+
end
|
595
|
+
|
596
|
+
def test_attributes
|
597
|
+
assert node = @xml.search('//address').first
|
598
|
+
assert_nil(node['asdfasdfasdf'])
|
599
|
+
assert_equal('Yes', node['domestic'])
|
600
|
+
|
601
|
+
assert node = @xml.search('//address')[2]
|
602
|
+
attr = node.attributes
|
603
|
+
assert_equal 2, attr.size
|
604
|
+
assert_equal 'Yes', attr['domestic'].value
|
605
|
+
assert_equal 'Yes', attr['domestic'].to_s
|
606
|
+
assert_equal 'No', attr['street'].value
|
607
|
+
end
|
608
|
+
|
609
|
+
def test_path
|
610
|
+
assert set = @xml.search('//employee')
|
611
|
+
assert node = set.first
|
612
|
+
assert_equal('/staff/employee[1]', node.path)
|
613
|
+
end
|
614
|
+
|
615
|
+
def test_search_by_symbol
|
616
|
+
assert set = @xml.search(:employee)
|
617
|
+
assert 5, set.length
|
618
|
+
|
619
|
+
assert node = @xml.at(:employee)
|
620
|
+
assert node.text =~ /EMP0001/
|
621
|
+
end
|
622
|
+
|
623
|
+
def test_new_node
|
624
|
+
node = Nokogiri::XML::Node.new('form', @xml)
|
625
|
+
assert_equal('form', node.name)
|
626
|
+
assert(node.document)
|
627
|
+
end
|
628
|
+
|
629
|
+
def test_encode_special_chars
|
630
|
+
foo = @xml.css('employee').first.encode_special_chars('&')
|
631
|
+
assert_equal '&', foo
|
632
|
+
end
|
633
|
+
|
634
|
+
def test_content
|
635
|
+
node = Nokogiri::XML::Node.new('form', @xml)
|
636
|
+
assert_equal('', node.content)
|
637
|
+
|
638
|
+
node.content = 'hello world!'
|
639
|
+
assert_equal('hello world!', node.content)
|
640
|
+
end
|
641
|
+
|
642
|
+
def test_whitespace_nodes
|
643
|
+
doc = Nokogiri::XML.parse("<root><b>Foo</b>\n<i>Bar</i> <p>Bazz</p></root>")
|
644
|
+
children = doc.at('//root').children.collect{|j| j.to_s}
|
645
|
+
assert_equal "\n", children[1]
|
646
|
+
assert_equal " ", children[3]
|
647
|
+
end
|
648
|
+
|
649
|
+
def test_replace
|
650
|
+
set = @xml.search('//employee')
|
651
|
+
assert 5, set.length
|
652
|
+
assert 0, @xml.search('//form').length
|
653
|
+
|
654
|
+
first = set[0]
|
655
|
+
second = set[1]
|
656
|
+
|
657
|
+
node = Nokogiri::XML::Node.new('form', @xml)
|
658
|
+
first.replace(node)
|
659
|
+
|
660
|
+
assert set = @xml.search('//employee')
|
661
|
+
assert_equal 4, set.length
|
662
|
+
assert 1, @xml.search('//form').length
|
663
|
+
|
664
|
+
assert_equal set[0].to_xml, second.to_xml
|
665
|
+
end
|
666
|
+
|
667
|
+
def test_illegal_replace_of_node_with_doc
|
668
|
+
new_node = Nokogiri::XML.parse('<foo>bar</foo>')
|
669
|
+
old_node = @xml.at('//employee')
|
670
|
+
assert_raises(ArgumentError){ old_node.replace new_node }
|
671
|
+
end
|
672
|
+
|
673
|
+
def test_node_equality
|
674
|
+
doc1 = Nokogiri::XML.parse(File.read(XML_FILE), XML_FILE)
|
675
|
+
doc2 = Nokogiri::XML.parse(File.read(XML_FILE), XML_FILE)
|
676
|
+
|
677
|
+
address1_1 = doc1.xpath('//address').first
|
678
|
+
address1_2 = doc1.xpath('//address').first
|
679
|
+
|
680
|
+
address2 = doc2.xpath('//address').first
|
681
|
+
|
682
|
+
assert_not_equal address1_1, address2 # two references to very, very similar nodes
|
683
|
+
assert_equal address1_1, address1_2 # two references to the exact same node
|
684
|
+
end
|
685
|
+
|
686
|
+
def test_namespace_as_hash
|
687
|
+
xml = Nokogiri::XML.parse(<<-eoxml)
|
688
|
+
<root>
|
689
|
+
<car xmlns:part="http://general-motors.com/">
|
690
|
+
<part:tire>Michelin Model XGV</part:tire>
|
691
|
+
</car>
|
692
|
+
<bicycle xmlns:part="http://schwinn.com/">
|
693
|
+
<part:tire>I'm a bicycle tire!</part:tire>
|
694
|
+
</bicycle>
|
695
|
+
</root>
|
696
|
+
eoxml
|
697
|
+
|
698
|
+
tires = xml.xpath('//bike:tire', {'bike' => 'http://schwinn.com/'})
|
699
|
+
assert_equal 1, tires.length
|
700
|
+
end
|
701
|
+
|
702
|
+
def test_namespace_search_with_css
|
703
|
+
xml = Nokogiri::XML.parse(<<-eoxml)
|
704
|
+
<root>
|
705
|
+
<car xmlns:part="http://general-motors.com/">
|
706
|
+
<part:tire>Michelin Model XGV</part:tire>
|
707
|
+
</car>
|
708
|
+
<bicycle xmlns:part="http://schwinn.com/">
|
709
|
+
<part:tire>I'm a bicycle tire!</part:tire>
|
710
|
+
</bicycle>
|
711
|
+
</root>
|
712
|
+
eoxml
|
713
|
+
|
714
|
+
tires = xml.css('bike|tire', 'bike' => 'http://schwinn.com/')
|
715
|
+
assert_equal 1, tires.length
|
716
|
+
end
|
717
|
+
|
718
|
+
def test_namespaces
|
719
|
+
xml = Nokogiri::XML.parse(<<-EOF)
|
720
|
+
<x xmlns:a='http://foo.com/' xmlns:b='http://bar.com/'>
|
721
|
+
<y xmlns:c='http://bazz.com/'>
|
722
|
+
<a:div>hello a</a:div>
|
723
|
+
<b:div>hello b</b:div>
|
724
|
+
<c:div>hello c</c:div>
|
725
|
+
</y>
|
726
|
+
</x>
|
727
|
+
EOF
|
728
|
+
assert namespaces = xml.root.namespaces
|
729
|
+
assert namespaces.key?('xmlns:a')
|
730
|
+
assert_equal 'http://foo.com/', namespaces['xmlns:a']
|
731
|
+
assert namespaces.key?('xmlns:b')
|
732
|
+
assert_equal 'http://bar.com/', namespaces['xmlns:b']
|
733
|
+
assert ! namespaces.key?('xmlns:c')
|
734
|
+
|
735
|
+
assert namespaces = xml.namespaces
|
736
|
+
assert namespaces.key?('xmlns:a')
|
737
|
+
assert_equal 'http://foo.com/', namespaces['xmlns:a']
|
738
|
+
assert namespaces.key?('xmlns:b')
|
739
|
+
assert_equal 'http://bar.com/', namespaces['xmlns:b']
|
740
|
+
assert namespaces.key?('xmlns:c')
|
741
|
+
assert_equal 'http://bazz.com/', namespaces['xmlns:c']
|
742
|
+
|
743
|
+
assert_equal "hello a", xml.search("//a:div", xml.namespaces).first.inner_text
|
744
|
+
assert_equal "hello b", xml.search("//b:div", xml.namespaces).first.inner_text
|
745
|
+
assert_equal "hello c", xml.search("//c:div", xml.namespaces).first.inner_text
|
746
|
+
end
|
747
|
+
|
748
|
+
def test_namespace
|
749
|
+
xml = Nokogiri::XML.parse(<<-EOF)
|
750
|
+
<x xmlns:a='http://foo.com/' xmlns:b='http://bar.com/'>
|
751
|
+
<y xmlns:c='http://bazz.com/'>
|
752
|
+
<a:div>hello a</a:div>
|
753
|
+
<b:div>hello b</b:div>
|
754
|
+
<c:div>hello c</c:div>
|
755
|
+
<div>hello moon</div>
|
756
|
+
</y>
|
757
|
+
</x>
|
758
|
+
EOF
|
759
|
+
set = xml.search("//y/*")
|
760
|
+
assert_equal "a", set[0].namespace.prefix
|
761
|
+
assert_equal "b", set[1].namespace.prefix
|
762
|
+
assert_equal "c", set[2].namespace.prefix
|
763
|
+
assert_equal nil, set[3].namespace
|
764
|
+
end
|
765
|
+
|
766
|
+
def test_namespace_without_an_href_on_html_node
|
767
|
+
# because microsoft word's HTML formatting does this. ick.
|
768
|
+
xml = Nokogiri::HTML.parse <<-EOF
|
769
|
+
<div><o:p>foo</o:p></div>
|
770
|
+
EOF
|
771
|
+
|
772
|
+
assert_not_nil(node = xml.at('p'))
|
773
|
+
|
774
|
+
assert_equal 1, node.namespaces.keys.size
|
775
|
+
assert node.namespaces.has_key?('xmlns:o')
|
776
|
+
assert_equal nil, node.namespaces['xmlns:o']
|
777
|
+
end
|
778
|
+
|
779
|
+
def test_line
|
780
|
+
xml = Nokogiri::XML(<<-eoxml)
|
781
|
+
<root>
|
782
|
+
<a>
|
783
|
+
Hello world
|
784
|
+
</a>
|
785
|
+
</root>
|
786
|
+
eoxml
|
787
|
+
|
788
|
+
set = xml.search("//a")
|
789
|
+
node = set.first
|
790
|
+
assert_equal 2, node.line
|
791
|
+
end
|
792
|
+
|
793
|
+
def test_unlink_then_reparent
|
794
|
+
# see http://github.com/tenderlove/nokogiri/issues#issue/22
|
795
|
+
10.times do
|
796
|
+
STDOUT.putc "."
|
797
|
+
STDOUT.flush
|
798
|
+
begin
|
799
|
+
doc = Nokogiri::XML <<-EOHTML
|
800
|
+
<root>
|
801
|
+
<a>
|
802
|
+
<b/>
|
803
|
+
<c/>
|
804
|
+
</a>
|
805
|
+
</root>
|
806
|
+
EOHTML
|
807
|
+
|
808
|
+
root = doc.at("root")
|
809
|
+
a = root.at("a")
|
810
|
+
b = a.at("b")
|
811
|
+
c = a.at("c")
|
812
|
+
a.add_next_sibling(b.unlink)
|
813
|
+
c.unlink
|
814
|
+
end
|
815
|
+
|
816
|
+
GC.start
|
817
|
+
end
|
818
|
+
|
819
|
+
end
|
820
|
+
|
821
|
+
end
|
822
|
+
end
|
823
|
+
end
|