nokogiri 1.6.5-x64-mingw32 → 1.6.6.1-x64-mingw32
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of nokogiri might be problematic. Click here for more details.
- checksums.yaml +4 -4
 - data/.cross_rubies +5 -0
 - data/.travis.yml +10 -20
 - data/CHANGELOG.ja.rdoc +28 -1
 - data/CHANGELOG.rdoc +28 -1
 - data/Gemfile +1 -1
 - data/Manifest.txt +5 -1
 - data/README.ja.rdoc +10 -9
 - data/README.rdoc +6 -9
 - data/ROADMAP.md +15 -3
 - data/Rakefile +1 -3
 - data/bin/nokogiri +48 -8
 - data/ext/nokogiri/extconf.rb +18 -3
 - data/ext/nokogiri/xml_comment.c +17 -2
 - data/ext/nokogiri/xml_node.c +66 -6
 - data/ext/nokogiri/xml_syntax_error.c +4 -0
 - data/ext/nokogiri/xml_syntax_error.h +1 -0
 - data/lib/nokogiri.rb +2 -2
 - data/lib/nokogiri/2.0/nokogiri.so +0 -0
 - data/lib/nokogiri/2.1/nokogiri.so +0 -0
 - data/lib/nokogiri/decorators/slop.rb +7 -8
 - data/lib/nokogiri/html/document_fragment.rb +0 -2
 - data/lib/nokogiri/html/sax/push_parser.rb +22 -2
 - data/lib/nokogiri/version.rb +1 -1
 - data/lib/nokogiri/xml.rb +1 -0
 - data/lib/nokogiri/xml/document.rb +4 -4
 - data/lib/nokogiri/xml/document_fragment.rb +39 -2
 - data/lib/nokogiri/xml/node.rb +11 -181
 - data/lib/nokogiri/xml/node_set.rb +41 -85
 - data/lib/nokogiri/xml/searchable.rb +221 -0
 - data/test/css/test_nthiness.rb +1 -1
 - data/test/html/sax/test_push_parser.rb +87 -0
 - data/test/html/test_document.rb +20 -5
 - data/test/html/test_document_fragment.rb +25 -0
 - data/test/xml/test_attr.rb +5 -2
 - data/test/xml/test_builder.rb +27 -1
 - data/test/xml/test_comment.rb +11 -0
 - data/test/xml/test_document.rb +34 -0
 - data/test/xml/test_document_fragment.rb +40 -9
 - data/test/xml/test_namespace.rb +1 -0
 - data/test/xml/test_node.rb +37 -1
 - data/test/xml/test_node_set.rb +56 -36
 - data/test/xml/test_xpath.rb +65 -19
 - data/test_all +11 -1
 - metadata +10 -7
 - data/tasks/nokogiri.org.rb +0 -24
 
    
        checksums.yaml
    CHANGED
    
    | 
         @@ -1,7 +1,7 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            ---
         
     | 
| 
       2 
2 
     | 
    
         
             
            SHA1:
         
     | 
| 
       3 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       4 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 3 
     | 
    
         
            +
              metadata.gz: 7a25692c8b1ceba84bd237a42083da992920e5df
         
     | 
| 
      
 4 
     | 
    
         
            +
              data.tar.gz: 003de117e19b29e8e75f2be2c39e15a3f3177a45
         
     | 
| 
       5 
5 
     | 
    
         
             
            SHA512:
         
     | 
| 
       6 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       7 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 6 
     | 
    
         
            +
              metadata.gz: 37b5fb59ca0cb46136f5615eecfcd94d48bb70412b26057eedb3bc4668b04ff0c713596f3a36f8a1b74f2b9bf3bdbf56b00b7b5d45f995ef27fda053a20f9f32
         
     | 
| 
      
 7 
     | 
    
         
            +
              data.tar.gz: edef9e10d9d8facc7d9c9307db056dc18bdd65de76d30bfa8e66d2e473ee8aed27abd4f3d04fea52421a226de332641f8d286de3db6b4f1c39e906cd03a123af
         
     | 
    
        data/.cross_rubies
    ADDED
    
    
    
        data/.travis.yml
    CHANGED
    
    | 
         @@ -1,12 +1,16 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            language: ruby
         
     | 
| 
      
 2 
     | 
    
         
            +
             
     | 
| 
       2 
3 
     | 
    
         
             
            rvm:
         
     | 
| 
       3 
     | 
    
         
            -
              - 1.9. 
     | 
| 
       4 
     | 
    
         
            -
              -  
     | 
| 
       5 
     | 
    
         
            -
              - 2. 
     | 
| 
       6 
     | 
    
         
            -
              - ruby- 
     | 
| 
      
 4 
     | 
    
         
            +
              - ruby-1.9.2
         
     | 
| 
      
 5 
     | 
    
         
            +
              - ruby-1.9.3
         
     | 
| 
      
 6 
     | 
    
         
            +
              - ruby-2.0
         
     | 
| 
      
 7 
     | 
    
         
            +
              - ruby-2.1
         
     | 
| 
      
 8 
     | 
    
         
            +
              - ruby-2.2
         
     | 
| 
       7 
9 
     | 
    
         
             
              - jruby-19mode
         
     | 
| 
       8 
     | 
    
         
            -
              - jruby- 
     | 
| 
      
 10 
     | 
    
         
            +
              - jruby-1.7.18
         
     | 
| 
      
 11 
     | 
    
         
            +
              - jruby-9.0.0.0.pre1
         
     | 
| 
       9 
12 
     | 
    
         
             
              - rbx-19mode
         
     | 
| 
      
 13 
     | 
    
         
            +
              - rbx-2
         
     | 
| 
       10 
14 
     | 
    
         | 
| 
       11 
15 
     | 
    
         
             
            os:
         
     | 
| 
       12 
16 
     | 
    
         
             
              - linux
         
     | 
| 
         @@ -14,22 +18,8 @@ os: 
     | 
|
| 
       14 
18 
     | 
    
         | 
| 
       15 
19 
     | 
    
         
             
            jdk:
         
     | 
| 
       16 
20 
     | 
    
         
             
              - openjdk7
         
     | 
| 
       17 
     | 
    
         
            -
              - openjdk6
         
     | 
| 
       18 
21 
     | 
    
         | 
| 
       19 
22 
     | 
    
         
             
            matrix:
         
     | 
| 
       20 
23 
     | 
    
         
             
              allow_failures:
         
     | 
| 
       21 
24 
     | 
    
         
             
                - os: osx
         
     | 
| 
       22 
     | 
    
         
            -
                - rvm:  
     | 
| 
       23 
     | 
    
         
            -
                # currently broken on Travis CI
         
     | 
| 
       24 
     | 
    
         
            -
                - rvm: jruby-20mode
         
     | 
| 
       25 
     | 
    
         
            -
              exclude:
         
     | 
| 
       26 
     | 
    
         
            -
                - rvm: 1.9.3
         
     | 
| 
       27 
     | 
    
         
            -
                  jdk: openjdk7
         
     | 
| 
       28 
     | 
    
         
            -
                - rvm: 2.0.0
         
     | 
| 
       29 
     | 
    
         
            -
                  jdk: openjdk7
         
     | 
| 
       30 
     | 
    
         
            -
                - rvm: 2.1.3
         
     | 
| 
       31 
     | 
    
         
            -
                  jdk: openjdk7
         
     | 
| 
       32 
     | 
    
         
            -
                - rvm: ruby-head
         
     | 
| 
       33 
     | 
    
         
            -
                  jdk: openjdk7
         
     | 
| 
       34 
     | 
    
         
            -
                - rvm: rbx-19mode
         
     | 
| 
       35 
     | 
    
         
            -
                  jdk: openjdk7
         
     | 
| 
      
 25 
     | 
    
         
            +
                - rvm: jruby-9.0.0.0.pre1
         
     | 
    
        data/CHANGELOG.ja.rdoc
    CHANGED
    
    | 
         @@ -1,4 +1,31 @@ 
     | 
|
| 
       1 
     | 
    
         
            -
            === 1.6. 
     | 
| 
      
 1 
     | 
    
         
            +
            === 1.6.6.1 / 2015年01月22日
         
     | 
| 
      
 2 
     | 
    
         
            +
             
     | 
| 
      
 3 
     | 
    
         
            +
            Note that 1.6.6.0 was not released.
         
     | 
| 
      
 4 
     | 
    
         
            +
             
     | 
| 
      
 5 
     | 
    
         
            +
            ==== 機能
         
     | 
| 
      
 6 
     | 
    
         
            +
             
     | 
| 
      
 7 
     | 
    
         
            +
            * Unified Node and NodeSet implementations of #search, #xpath and #css.
         
     | 
| 
      
 8 
     | 
    
         
            +
            * Added Node#lang and Node#lang=.
         
     | 
| 
      
 9 
     | 
    
         
            +
            * bin/nokogiri passes the URI to parse() if an HTTP URL is given.
         
     | 
| 
      
 10 
     | 
    
         
            +
            * bin/nokogiri now loads ~/.nokogirirc so user can define helper methods, etc.
         
     | 
| 
      
 11 
     | 
    
         
            +
            * bin/nokogiri can be configured to use Pry instead of IRB by adding a couple of lines to ~/.nokogirirc. (#1198)
         
     | 
| 
      
 12 
     | 
    
         
            +
            * bin/nokogiri can better handle urls from STDIN (aiding use of xargs). (#1065)
         
     | 
| 
      
 13 
     | 
    
         
            +
            * JRuby 9K support.
         
     | 
| 
      
 14 
     | 
    
         
            +
             
     | 
| 
      
 15 
     | 
    
         
            +
             
     | 
| 
      
 16 
     | 
    
         
            +
            ==== バグ修正
         
     | 
| 
      
 17 
     | 
    
         
            +
             
     | 
| 
      
 18 
     | 
    
         
            +
            * DocumentFragment#search now matches against root nodes. (#1205)
         
     | 
| 
      
 19 
     | 
    
         
            +
            * (MRI) More fixes related to handling libxml2 parse errors during DocumentFragment#dup. (#1196)
         
     | 
| 
      
 20 
     | 
    
         
            +
            * (JRuby) Builder now handles namespace hrefs properly when there is a default ns. (#1039)
         
     | 
| 
      
 21 
     | 
    
         
            +
            * (JRuby) Clear the XPath cache on attr removal. (#1109)
         
     | 
| 
      
 22 
     | 
    
         
            +
            * `XML::Comment.new` argument types are now consistent and safe (and documented) across MRI and JRuby. (#1224)
         
     | 
| 
      
 23 
     | 
    
         
            +
            * (MRI) Restoring support for Ruby 1.9.2 that was broken in v1.6.4.1 and v1.6.5. (#1207)
         
     | 
| 
      
 24 
     | 
    
         
            +
            * Check if `zlib` is available before building `libxml2`. (#1188)
         
     | 
| 
      
 25 
     | 
    
         
            +
            * (JRuby) HtmlSaxPushParser now exists. (#1147) (Thanks, Piotr Szmielew!)
         
     | 
| 
      
 26 
     | 
    
         
            +
             
     | 
| 
      
 27 
     | 
    
         
            +
             
     | 
| 
      
 28 
     | 
    
         
            +
            === 1.6.5 / 2014年11月26日
         
     | 
| 
       2 
29 
     | 
    
         | 
| 
       3 
30 
     | 
    
         
             
            ==== 機能
         
     | 
| 
       4 
31 
     | 
    
         | 
    
        data/CHANGELOG.rdoc
    CHANGED
    
    | 
         @@ -1,4 +1,31 @@ 
     | 
|
| 
       1 
     | 
    
         
            -
            === 1.6. 
     | 
| 
      
 1 
     | 
    
         
            +
            === 1.6.6.1 / 2015-01-22
         
     | 
| 
      
 2 
     | 
    
         
            +
             
     | 
| 
      
 3 
     | 
    
         
            +
            Note that 1.6.6.0 was not released.
         
     | 
| 
      
 4 
     | 
    
         
            +
             
     | 
| 
      
 5 
     | 
    
         
            +
            ==== Features
         
     | 
| 
      
 6 
     | 
    
         
            +
             
     | 
| 
      
 7 
     | 
    
         
            +
            * Unified Node and NodeSet implementations of #search, #xpath and #css.
         
     | 
| 
      
 8 
     | 
    
         
            +
            * Added Node#lang and Node#lang=.
         
     | 
| 
      
 9 
     | 
    
         
            +
            * bin/nokogiri passes the URI to parse() if an HTTP URL is given.
         
     | 
| 
      
 10 
     | 
    
         
            +
            * bin/nokogiri now loads ~/.nokogirirc so user can define helper methods, etc.
         
     | 
| 
      
 11 
     | 
    
         
            +
            * bin/nokogiri can be configured to use Pry instead of IRB by adding a couple of lines to ~/.nokogirirc. (#1198)
         
     | 
| 
      
 12 
     | 
    
         
            +
            * bin/nokogiri can better handle urls from STDIN (aiding use of xargs). (#1065)
         
     | 
| 
      
 13 
     | 
    
         
            +
            * JRuby 9K support.
         
     | 
| 
      
 14 
     | 
    
         
            +
             
     | 
| 
      
 15 
     | 
    
         
            +
             
     | 
| 
      
 16 
     | 
    
         
            +
            ==== Bug fixes
         
     | 
| 
      
 17 
     | 
    
         
            +
             
     | 
| 
      
 18 
     | 
    
         
            +
            * DocumentFragment#search now matches against root nodes. (#1205)
         
     | 
| 
      
 19 
     | 
    
         
            +
            * (MRI) More fixes related to handling libxml2 parse errors during DocumentFragment#dup. (#1196)
         
     | 
| 
      
 20 
     | 
    
         
            +
            * (JRuby) Builder now handles namespace hrefs properly when there is a default ns. (#1039)
         
     | 
| 
      
 21 
     | 
    
         
            +
            * (JRuby) Clear the XPath cache on attr removal. (#1109)
         
     | 
| 
      
 22 
     | 
    
         
            +
            * `XML::Comment.new` argument types are now consistent and safe (and documented) across MRI and JRuby. (#1224)
         
     | 
| 
      
 23 
     | 
    
         
            +
            * (MRI) Restoring support for Ruby 1.9.2 that was broken in v1.6.4.1 and v1.6.5. (#1207)
         
     | 
| 
      
 24 
     | 
    
         
            +
            * Check if `zlib` is available before building `libxml2`. (#1188)
         
     | 
| 
      
 25 
     | 
    
         
            +
            * (JRuby) HtmlSaxPushParser now exists. (#1147) (Thanks, Piotr Szmielew!)
         
     | 
| 
      
 26 
     | 
    
         
            +
             
     | 
| 
      
 27 
     | 
    
         
            +
             
     | 
| 
      
 28 
     | 
    
         
            +
            === 1.6.5 / 2014-11-26
         
     | 
| 
       2 
29 
     | 
    
         | 
| 
       3 
30 
     | 
    
         
             
            ==== Features
         
     | 
| 
       4 
31 
     | 
    
         | 
    
        data/Gemfile
    CHANGED
    
    | 
         @@ -8,7 +8,7 @@ gem "mini_portile", "~>0.6.0" 
     | 
|
| 
       8 
8 
     | 
    
         | 
| 
       9 
9 
     | 
    
         
             
            gem "rdoc", "~>4.0", :group => [:development, :test]
         
     | 
| 
       10 
10 
     | 
    
         
             
            gem "hoe-bundler", ">=1.1", :group => [:development, :test]
         
     | 
| 
       11 
     | 
    
         
            -
            gem "hoe-debugging", " 
     | 
| 
      
 11 
     | 
    
         
            +
            gem "hoe-debugging", "~>1.2.0", :group => [:development, :test]
         
     | 
| 
       12 
12 
     | 
    
         
             
            gem "hoe-gemspec", ">=1.0", :group => [:development, :test]
         
     | 
| 
       13 
13 
     | 
    
         
             
            gem "hoe-git", ">=1.4", :group => [:development, :test]
         
     | 
| 
       14 
14 
     | 
    
         
             
            gem "minitest", "~>2.2.2", :group => [:development, :test]
         
     | 
    
        data/Manifest.txt
    CHANGED
    
    | 
         @@ -1,4 +1,5 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            .autotest
         
     | 
| 
      
 2 
     | 
    
         
            +
            .cross_rubies
         
     | 
| 
       2 
3 
     | 
    
         
             
            .editorconfig
         
     | 
| 
       3 
4 
     | 
    
         
             
            .gemtest
         
     | 
| 
       4 
5 
     | 
    
         
             
            .travis.yml
         
     | 
| 
         @@ -21,6 +22,7 @@ ext/java/nokogiri/HtmlDocument.java 
     | 
|
| 
       21 
22 
     | 
    
         
             
            ext/java/nokogiri/HtmlElementDescription.java
         
     | 
| 
       22 
23 
     | 
    
         
             
            ext/java/nokogiri/HtmlEntityLookup.java
         
     | 
| 
       23 
24 
     | 
    
         
             
            ext/java/nokogiri/HtmlSaxParserContext.java
         
     | 
| 
      
 25 
     | 
    
         
            +
            ext/java/nokogiri/HtmlSaxPushParser.java
         
     | 
| 
       24 
26 
     | 
    
         
             
            ext/java/nokogiri/NokogiriService.java
         
     | 
| 
       25 
27 
     | 
    
         
             
            ext/java/nokogiri/XmlAttr.java
         
     | 
| 
       26 
28 
     | 
    
         
             
            ext/java/nokogiri/XmlAttributeDecl.java
         
     | 
| 
         @@ -230,6 +232,7 @@ lib/nokogiri/xml/sax/parser.rb 
     | 
|
| 
       230 
232 
     | 
    
         
             
            lib/nokogiri/xml/sax/parser_context.rb
         
     | 
| 
       231 
233 
     | 
    
         
             
            lib/nokogiri/xml/sax/push_parser.rb
         
     | 
| 
       232 
234 
     | 
    
         
             
            lib/nokogiri/xml/schema.rb
         
     | 
| 
      
 235 
     | 
    
         
            +
            lib/nokogiri/xml/searchable.rb
         
     | 
| 
       233 
236 
     | 
    
         
             
            lib/nokogiri/xml/syntax_error.rb
         
     | 
| 
       234 
237 
     | 
    
         
             
            lib/nokogiri/xml/text.rb
         
     | 
| 
       235 
238 
     | 
    
         
             
            lib/nokogiri/xml/xpath.rb
         
     | 
| 
         @@ -253,12 +256,12 @@ ports/patches/libxslt/0010-Fix-handling-of-UTF-8-strings-in-EXSLT-crypto-module. 
     | 
|
| 
       253 
256 
     | 
    
         
             
            ports/patches/libxslt/0013-Memory-leak-in-xsltCompileIdKeyPattern-error-path.patch
         
     | 
| 
       254 
257 
     | 
    
         
             
            ports/patches/libxslt/0014-Fix-for-bug-436589.patch
         
     | 
| 
       255 
258 
     | 
    
         
             
            ports/patches/libxslt/0015-Fix-mkdir-for-mingw.patch
         
     | 
| 
      
 259 
     | 
    
         
            +
            ports/patches/sort-patches-by-date
         
     | 
| 
       256 
260 
     | 
    
         
             
            suppressions/README.txt
         
     | 
| 
       257 
261 
     | 
    
         
             
            suppressions/nokogiri_ree-1.8.7.358.supp
         
     | 
| 
       258 
262 
     | 
    
         
             
            suppressions/nokogiri_ruby-1.8.7.370.supp
         
     | 
| 
       259 
263 
     | 
    
         
             
            suppressions/nokogiri_ruby-1.9.2.320.supp
         
     | 
| 
       260 
264 
     | 
    
         
             
            suppressions/nokogiri_ruby-1.9.3.327.supp
         
     | 
| 
       261 
     | 
    
         
            -
            tasks/nokogiri.org.rb
         
     | 
| 
       262 
265 
     | 
    
         
             
            tasks/test.rb
         
     | 
| 
       263 
266 
     | 
    
         
             
            test/css/test_nthiness.rb
         
     | 
| 
       264 
267 
     | 
    
         
             
            test/css/test_parser.rb
         
     | 
| 
         @@ -303,6 +306,7 @@ test/files/xinclude.xml 
     | 
|
| 
       303 
306 
     | 
    
         
             
            test/helper.rb
         
     | 
| 
       304 
307 
     | 
    
         
             
            test/html/sax/test_parser.rb
         
     | 
| 
       305 
308 
     | 
    
         
             
            test/html/sax/test_parser_context.rb
         
     | 
| 
      
 309 
     | 
    
         
            +
            test/html/sax/test_push_parser.rb
         
     | 
| 
       306 
310 
     | 
    
         
             
            test/html/test_builder.rb
         
     | 
| 
       307 
311 
     | 
    
         
             
            test/html/test_document.rb
         
     | 
| 
       308 
312 
     | 
    
         
             
            test/html/test_document_encoding.rb
         
     | 
    
        data/README.ja.rdoc
    CHANGED
    
    | 
         @@ -38,24 +38,25 @@ IRCのチャンネルはfreenodeの #nokogiri です。 
     | 
|
| 
       38 
38 
     | 
    
         | 
| 
       39 
39 
     | 
    
         
             
              require 'nokogiri'
         
     | 
| 
       40 
40 
     | 
    
         
             
              require 'open-uri'
         
     | 
| 
       41 
     | 
    
         
            -
             
     | 
| 
       42 
     | 
    
         
            -
               
     | 
| 
       43 
     | 
    
         
            -
              
         
     | 
| 
      
 41 
     | 
    
         
            +
             
     | 
| 
      
 42 
     | 
    
         
            +
              # Fetch and parse HTML document
         
     | 
| 
      
 43 
     | 
    
         
            +
              doc = Nokogiri::HTML(open('http://www.nokogiri.org/tutorials/installing_nokogiri.html'))
         
     | 
| 
      
 44 
     | 
    
         
            +
             
     | 
| 
       44 
45 
     | 
    
         
             
              ####
         
     | 
| 
       45 
46 
     | 
    
         
             
              # Search for nodes by css
         
     | 
| 
       46 
     | 
    
         
            -
              doc.css(' 
     | 
| 
      
 47 
     | 
    
         
            +
              doc.css('nav ul.menu li a').each do |link|
         
     | 
| 
       47 
48 
     | 
    
         
             
                puts link.content
         
     | 
| 
       48 
49 
     | 
    
         
             
              end
         
     | 
| 
       49 
     | 
    
         
            -
             
     | 
| 
      
 50 
     | 
    
         
            +
             
     | 
| 
       50 
51 
     | 
    
         
             
              ####
         
     | 
| 
       51 
52 
     | 
    
         
             
              # Search for nodes by xpath
         
     | 
| 
       52 
     | 
    
         
            -
              doc.xpath('//h3 
     | 
| 
      
 53 
     | 
    
         
            +
              doc.xpath('//h2 | //h3').each do |link|
         
     | 
| 
       53 
54 
     | 
    
         
             
                puts link.content
         
     | 
| 
       54 
55 
     | 
    
         
             
              end
         
     | 
| 
       55 
     | 
    
         
            -
             
     | 
| 
      
 56 
     | 
    
         
            +
             
     | 
| 
       56 
57 
     | 
    
         
             
              ####
         
     | 
| 
       57 
58 
     | 
    
         
             
              # Or mix and match.
         
     | 
| 
       58 
     | 
    
         
            -
              doc.search(' 
     | 
| 
      
 59 
     | 
    
         
            +
              doc.search('code.sh', '//h2').each do |link|
         
     | 
| 
       59 
60 
     | 
    
         
             
                puts link.content
         
     | 
| 
       60 
61 
     | 
    
         
             
              end
         
     | 
| 
       61 
62 
     | 
    
         | 
| 
         @@ -81,7 +82,7 @@ IRCのチャンネルはfreenodeの #nokogiri です。 
     | 
|
| 
       81 
82 
     | 
    
         | 
| 
       82 
83 
     | 
    
         
             
            (The MIT License)
         
     | 
| 
       83 
84 
     | 
    
         | 
| 
       84 
     | 
    
         
            -
            Copyright (c) 2008 -  
     | 
| 
      
 85 
     | 
    
         
            +
            Copyright (c) 2008 - 2015:
         
     | 
| 
       85 
86 
     | 
    
         | 
| 
       86 
87 
     | 
    
         
             
            * {Aaron Patterson}[http://tenderlovemaking.com]
         
     | 
| 
       87 
88 
     | 
    
         
             
            * {Mike Dalessio}[http://mike.daless.io]
         
     | 
    
        data/README.rdoc
    CHANGED
    
    | 
         @@ -45,27 +45,24 @@ The IRC channel is #nokogiri on freenode. 
     | 
|
| 
       45 
45 
     | 
    
         
             
              require 'nokogiri'
         
     | 
| 
       46 
46 
     | 
    
         
             
              require 'open-uri'
         
     | 
| 
       47 
47 
     | 
    
         | 
| 
       48 
     | 
    
         
            -
              #  
     | 
| 
       49 
     | 
    
         
            -
             
     | 
| 
       50 
     | 
    
         
            -
              doc = Nokogiri::HTML(open('http://www.google.com/search?q=sparklemotion'))
         
     | 
| 
       51 
     | 
    
         
            -
             
     | 
| 
       52 
     | 
    
         
            -
              # Do funky things with it using Nokogiri::XML::Node methods...
         
     | 
| 
      
 48 
     | 
    
         
            +
              # Fetch and parse HTML document
         
     | 
| 
      
 49 
     | 
    
         
            +
              doc = Nokogiri::HTML(open('http://www.nokogiri.org/tutorials/installing_nokogiri.html'))
         
     | 
| 
       53 
50 
     | 
    
         | 
| 
       54 
51 
     | 
    
         
             
              ####
         
     | 
| 
       55 
52 
     | 
    
         
             
              # Search for nodes by css
         
     | 
| 
       56 
     | 
    
         
            -
              doc.css(' 
     | 
| 
      
 53 
     | 
    
         
            +
              doc.css('nav ul.menu li a').each do |link|
         
     | 
| 
       57 
54 
     | 
    
         
             
                puts link.content
         
     | 
| 
       58 
55 
     | 
    
         
             
              end
         
     | 
| 
       59 
56 
     | 
    
         | 
| 
       60 
57 
     | 
    
         
             
              ####
         
     | 
| 
       61 
58 
     | 
    
         
             
              # Search for nodes by xpath
         
     | 
| 
       62 
     | 
    
         
            -
              doc.xpath('//h3 
     | 
| 
      
 59 
     | 
    
         
            +
              doc.xpath('//h2 | //h3').each do |link|
         
     | 
| 
       63 
60 
     | 
    
         
             
                puts link.content
         
     | 
| 
       64 
61 
     | 
    
         
             
              end
         
     | 
| 
       65 
62 
     | 
    
         | 
| 
       66 
63 
     | 
    
         
             
              ####
         
     | 
| 
       67 
64 
     | 
    
         
             
              # Or mix and match.
         
     | 
| 
       68 
     | 
    
         
            -
              doc.search(' 
     | 
| 
      
 65 
     | 
    
         
            +
              doc.search('code.sh', '//h2').each do |link|
         
     | 
| 
       69 
66 
     | 
    
         
             
                puts link.content
         
     | 
| 
       70 
67 
     | 
    
         
             
              end
         
     | 
| 
       71 
68 
     | 
    
         | 
| 
         @@ -150,7 +147,7 @@ Then run rake: 
     | 
|
| 
       150 
147 
     | 
    
         | 
| 
       151 
148 
     | 
    
         
             
            (The MIT License)
         
     | 
| 
       152 
149 
     | 
    
         | 
| 
       153 
     | 
    
         
            -
            Copyright (c) 2008 -  
     | 
| 
      
 150 
     | 
    
         
            +
            Copyright (c) 2008 - 2015:
         
     | 
| 
       154 
151 
     | 
    
         | 
| 
       155 
152 
     | 
    
         
             
            * {Aaron Patterson}[http://tenderlovemaking.com]
         
     | 
| 
       156 
153 
     | 
    
         
             
            * {Mike Dalessio}[http://mike.daless.io]
         
     | 
    
        data/ROADMAP.md
    CHANGED
    
    | 
         @@ -57,6 +57,7 @@ 
     | 
|
| 
       57 
57 
     | 
    
         
             
              - https://github.com/sparklemotion/nokogiri/issues/370
         
     | 
| 
       58 
58 
     | 
    
         
             
              - https://github.com/sparklemotion/nokogiri/issues/454
         
     | 
| 
       59 
59 
     | 
    
         
             
              - https://github.com/sparklemotion/nokogiri/issues/572
         
     | 
| 
      
 60 
     | 
    
         
            +
              could we fix this by making DocumentFragment be a subclass of NodeSet?
         
     | 
| 
       60 
61 
     | 
    
         | 
| 
       61 
62 
     | 
    
         | 
| 
       62 
63 
     | 
    
         
             
            ## Better Syntax for custom XPath function handler
         
     | 
| 
         @@ -70,9 +71,6 @@ 
     | 
|
| 
       70 
71 
     | 
    
         
             
              * we should standardize on a hash of options for these and other calls
         
     | 
| 
       71 
72 
     | 
    
         
             
            * what should NodeSet#xpath return?
         
     | 
| 
       72 
73 
     | 
    
         
             
              * https://github.com/sparklemotion/nokogiri/issues/656
         
     | 
| 
       73 
     | 
    
         
            -
            * also, clean up or unify the implementations of #xpath-and-friends in Node and NodeSet
         
     | 
| 
       74 
     | 
    
         
            -
              * implementations are very similar, but no shared code :(
         
     | 
| 
       75 
     | 
    
         
            -
              * decorate nodes in a consistent manner
         
     | 
| 
       76 
74 
     | 
    
         | 
| 
       77 
75 
     | 
    
         
             
            ## Encoding
         
     | 
| 
       78 
76 
     | 
    
         | 
| 
         @@ -87,3 +85,17 @@ Somebody who knows encoding well should head this up. 
     | 
|
| 
       87 
85 
     | 
    
         | 
| 
       88 
86 
     | 
    
         
             
            It's fundamentally broken, in that we can't stop people from crashing
         
     | 
| 
       89 
87 
     | 
    
         
             
            their application if they want to use object reference unsafely.
         
     | 
| 
      
 88 
     | 
    
         
            +
             
     | 
| 
      
 89 
     | 
    
         
            +
             
     | 
| 
      
 90 
     | 
    
         
            +
            ## Class methods that require Document
         
     | 
| 
      
 91 
     | 
    
         
            +
             
     | 
| 
      
 92 
     | 
    
         
            +
            There are a few methods, like `Nokogiri::XML::Comment.new` that
         
     | 
| 
      
 93 
     | 
    
         
            +
            require a Document object.
         
     | 
| 
      
 94 
     | 
    
         
            +
             
     | 
| 
      
 95 
     | 
    
         
            +
            We should probably make Document instance methods to wrap this, since
         
     | 
| 
      
 96 
     | 
    
         
            +
            it's a non-obvious expectation and thus fails as a convention.
         
     | 
| 
      
 97 
     | 
    
         
            +
             
     | 
| 
      
 98 
     | 
    
         
            +
            So, instead, let's make alternative methods like
         
     | 
| 
      
 99 
     | 
    
         
            +
            `Nokogiri::XML::Document#new_comment`, and recommend those as the
         
     | 
| 
      
 100 
     | 
    
         
            +
            proper convention.
         
     | 
| 
      
 101 
     | 
    
         
            +
             
     | 
    
        data/Rakefile
    CHANGED
    
    | 
         @@ -101,8 +101,6 @@ CROSS_RUBIES = File.read('.cross_rubies').lines.flat_map { |line| 
     | 
|
| 
       101 
101 
     | 
    
         | 
| 
       102 
102 
     | 
    
         
             
            ENV['RUBY_CC_VERSION'] ||= CROSS_RUBIES.map(&:ver).uniq.join(":")
         
     | 
| 
       103 
103 
     | 
    
         | 
| 
       104 
     | 
    
         
            -
            require 'tasks/nokogiri.org'
         
     | 
| 
       105 
     | 
    
         
            -
             
     | 
| 
       106 
104 
     | 
    
         
             
            HOE = Hoe.spec 'nokogiri' do
         
     | 
| 
       107 
105 
     | 
    
         
             
              developer 'Aaron Patterson', 'aaronp@rubyforge.org'
         
     | 
| 
       108 
106 
     | 
    
         
             
              developer 'Mike Dalessio',   'mike.dalessio@gmail.com'
         
     | 
| 
         @@ -142,7 +140,7 @@ HOE = Hoe.spec 'nokogiri' do 
     | 
|
| 
       142 
140 
     | 
    
         | 
| 
       143 
141 
     | 
    
         
             
              self.extra_dev_deps += [
         
     | 
| 
       144 
142 
     | 
    
         
             
                ["hoe-bundler",     ">= 1.1"],
         
     | 
| 
       145 
     | 
    
         
            -
                ["hoe-debugging",   " 
     | 
| 
      
 143 
     | 
    
         
            +
                ["hoe-debugging",   "~> 1.2.0"],
         
     | 
| 
       146 
144 
     | 
    
         
             
                ["hoe-gemspec",     ">= 1.0"],
         
     | 
| 
       147 
145 
     | 
    
         
             
                ["hoe-git",         ">= 1.4"],
         
     | 
| 
       148 
146 
     | 
    
         
             
                ["minitest",        "~> 2.2.2"],
         
     | 
    
        data/bin/nokogiri
    CHANGED
    
    | 
         @@ -1,14 +1,41 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            #!/usr/bin/env ruby
         
     | 
| 
       2 
2 
     | 
    
         
             
            require 'optparse'
         
     | 
| 
       3 
3 
     | 
    
         
             
            require 'open-uri'
         
     | 
| 
       4 
     | 
    
         
            -
            require 'irb'
         
     | 
| 
       5 
4 
     | 
    
         
             
            require 'uri'
         
     | 
| 
       6 
5 
     | 
    
         
             
            require 'rubygems'
         
     | 
| 
       7 
6 
     | 
    
         
             
            require 'nokogiri'
         
     | 
| 
      
 7 
     | 
    
         
            +
            autoload :IRB, 'irb'
         
     | 
| 
       8 
8 
     | 
    
         | 
| 
       9 
9 
     | 
    
         
             
            parse_class = Nokogiri
         
     | 
| 
       10 
10 
     | 
    
         
             
            encoding = nil
         
     | 
| 
       11 
11 
     | 
    
         | 
| 
      
 12 
     | 
    
         
            +
            # This module provides some tunables with the nokogiri CLI for use in
         
     | 
| 
      
 13 
     | 
    
         
            +
            # your ~/.nokogirirc.
         
     | 
| 
      
 14 
     | 
    
         
            +
            module Nokogiri::CLI
         
     | 
| 
      
 15 
     | 
    
         
            +
              class << self
         
     | 
| 
      
 16 
     | 
    
         
            +
                # Specify the console engine, defaulted to IRB.
         
     | 
| 
      
 17 
     | 
    
         
            +
                #
         
     | 
| 
      
 18 
     | 
    
         
            +
                # call-seq:
         
     | 
| 
      
 19 
     | 
    
         
            +
                #   require 'pry'
         
     | 
| 
      
 20 
     | 
    
         
            +
                #   Nokogiri::CLI.console = Pry
         
     | 
| 
      
 21 
     | 
    
         
            +
                attr_writer :console
         
     | 
| 
      
 22 
     | 
    
         
            +
             
     | 
| 
      
 23 
     | 
    
         
            +
                def console
         
     | 
| 
      
 24 
     | 
    
         
            +
                  case @console
         
     | 
| 
      
 25 
     | 
    
         
            +
                  when Symbol
         
     | 
| 
      
 26 
     | 
    
         
            +
                    Kernel.const_get(@console)
         
     | 
| 
      
 27 
     | 
    
         
            +
                  else
         
     | 
| 
      
 28 
     | 
    
         
            +
                    @console
         
     | 
| 
      
 29 
     | 
    
         
            +
                  end
         
     | 
| 
      
 30 
     | 
    
         
            +
                end
         
     | 
| 
      
 31 
     | 
    
         
            +
             
     | 
| 
      
 32 
     | 
    
         
            +
                attr_accessor :rcfile
         
     | 
| 
      
 33 
     | 
    
         
            +
              end
         
     | 
| 
      
 34 
     | 
    
         
            +
             
     | 
| 
      
 35 
     | 
    
         
            +
              self.rcfile  = File.expand_path('~/.nokogirirc')
         
     | 
| 
      
 36 
     | 
    
         
            +
              self.console = :IRB
         
     | 
| 
      
 37 
     | 
    
         
            +
            end
         
     | 
| 
      
 38 
     | 
    
         
            +
             
     | 
| 
       12 
39 
     | 
    
         
             
            opts = OptionParser.new do |opts|
         
     | 
| 
       13 
40 
     | 
    
         
             
              opts.banner = "Nokogiri: an HTML, XML, SAX, and Reader parser"
         
     | 
| 
       14 
41 
     | 
    
         
             
              opts.define_head "Usage: nokogiri <uri|path> [options]"
         
     | 
| 
         @@ -20,11 +47,15 @@ opts = OptionParser.new do |opts| 
     | 
|
| 
       20 
47 
     | 
    
         
             
              opts.separator ""
         
     | 
| 
       21 
48 
     | 
    
         
             
              opts.separator "Options:"
         
     | 
| 
       22 
49 
     | 
    
         | 
| 
       23 
     | 
    
         
            -
              opts.on("--type  
     | 
| 
      
 50 
     | 
    
         
            +
              opts.on("--type type", "Parse as type: xml or html (default: auto)", [:xml, :html]) do |v|
         
     | 
| 
       24 
51 
     | 
    
         
             
                parse_class = {:xml => Nokogiri::XML, :html => Nokogiri::HTML}[v]
         
     | 
| 
       25 
52 
     | 
    
         
             
              end
         
     | 
| 
       26 
53 
     | 
    
         | 
| 
       27 
     | 
    
         
            -
              opts.on("- 
     | 
| 
      
 54 
     | 
    
         
            +
              opts.on("-C file", "Specifies initialization file to load (default #{Nokogiri::CLI.rcfile})") do |v|
         
     | 
| 
      
 55 
     | 
    
         
            +
                Nokogiri::CLI.rcfile = v
         
     | 
| 
      
 56 
     | 
    
         
            +
              end
         
     | 
| 
      
 57 
     | 
    
         
            +
             
     | 
| 
      
 58 
     | 
    
         
            +
              opts.on("-E", "--encoding encoding", "Read as encoding (default: #{encoding || 'none'})") do |v|
         
     | 
| 
       28 
59 
     | 
    
         
             
                encoding = v
         
     | 
| 
       29 
60 
     | 
    
         
             
              end
         
     | 
| 
       30 
61 
     | 
    
         | 
| 
         @@ -48,15 +79,24 @@ opts = OptionParser.new do |opts| 
     | 
|
| 
       48 
79 
     | 
    
         
             
            end
         
     | 
| 
       49 
80 
     | 
    
         
             
            opts.parse!
         
     | 
| 
       50 
81 
     | 
    
         | 
| 
       51 
     | 
    
         
            -
             
     | 
| 
      
 82 
     | 
    
         
            +
            url = ARGV.shift
         
     | 
| 
       52 
83 
     | 
    
         | 
| 
       53 
     | 
    
         
            -
            if  
     | 
| 
      
 84 
     | 
    
         
            +
            if url.to_s.strip.empty? && $stdin.tty?
         
     | 
| 
       54 
85 
     | 
    
         
             
              puts opts
         
     | 
| 
       55 
86 
     | 
    
         
             
              exit 1
         
     | 
| 
       56 
87 
     | 
    
         
             
            end
         
     | 
| 
       57 
88 
     | 
    
         | 
| 
       58 
     | 
    
         
            -
            if  
     | 
| 
       59 
     | 
    
         
            -
               
     | 
| 
      
 89 
     | 
    
         
            +
            if File.file?(Nokogiri::CLI.rcfile)
         
     | 
| 
      
 90 
     | 
    
         
            +
              load Nokogiri::CLI.rcfile
         
     | 
| 
      
 91 
     | 
    
         
            +
            end
         
     | 
| 
      
 92 
     | 
    
         
            +
             
     | 
| 
      
 93 
     | 
    
         
            +
            if url || $stdin.tty?
         
     | 
| 
      
 94 
     | 
    
         
            +
              case uri = (URI(url) rescue url)
         
     | 
| 
      
 95 
     | 
    
         
            +
              when URI::HTTP
         
     | 
| 
      
 96 
     | 
    
         
            +
                @doc = parse_class.parse(uri.read, url, encoding)
         
     | 
| 
      
 97 
     | 
    
         
            +
              else
         
     | 
| 
      
 98 
     | 
    
         
            +
                @doc = parse_class.parse(open(url).read, nil, encoding)
         
     | 
| 
      
 99 
     | 
    
         
            +
              end
         
     | 
| 
       60 
100 
     | 
    
         
             
            else
         
     | 
| 
       61 
101 
     | 
    
         
             
              @doc = parse_class.parse($stdin, nil, encoding)
         
     | 
| 
       62 
102 
     | 
    
         
             
            end
         
     | 
| 
         @@ -72,7 +112,7 @@ else 
     | 
|
| 
       72 
112 
     | 
    
         
             
                eval @script, binding, '<main>'
         
     | 
| 
       73 
113 
     | 
    
         
             
              else
         
     | 
| 
       74 
114 
     | 
    
         
             
                puts "Your document is stored in @doc..."
         
     | 
| 
       75 
     | 
    
         
            -
                 
     | 
| 
      
 115 
     | 
    
         
            +
                Nokogiri::CLI.console.start
         
     | 
| 
       76 
116 
     | 
    
         
             
              end
         
     | 
| 
       77 
117 
     | 
    
         
             
            end
         
     | 
| 
       78 
118 
     | 
    
         | 
    
        data/ext/nokogiri/extconf.rb
    CHANGED
    
    | 
         @@ -71,10 +71,19 @@ def do_clean 
     | 
|
| 
       71 
71 
     | 
    
         
             
              exit! 0
         
     | 
| 
       72 
72 
     | 
    
         
             
            end
         
     | 
| 
       73 
73 
     | 
    
         | 
| 
      
 74 
     | 
    
         
            +
            def nokogiri_try_compile
         
     | 
| 
      
 75 
     | 
    
         
            +
              args = if defined?(RUBY_VERSION) && RUBY_VERSION <= "1.9.2"
         
     | 
| 
      
 76 
     | 
    
         
            +
                       ["int main() {return 0;}"]
         
     | 
| 
      
 77 
     | 
    
         
            +
                     else
         
     | 
| 
      
 78 
     | 
    
         
            +
                       ["int main() {return 0;}", "", {werror: true}]
         
     | 
| 
      
 79 
     | 
    
         
            +
                     end
         
     | 
| 
      
 80 
     | 
    
         
            +
            end
         
     | 
| 
      
 81 
     | 
    
         
            +
             
     | 
| 
      
 82 
     | 
    
         
            +
             
     | 
| 
       74 
83 
     | 
    
         
             
            def add_cflags(flags)
         
     | 
| 
       75 
84 
     | 
    
         
             
              print "checking if the C compiler accepts #{flags}... "
         
     | 
| 
       76 
85 
     | 
    
         
             
              with_cflags("#{$CFLAGS} #{flags}") do
         
     | 
| 
       77 
     | 
    
         
            -
                if  
     | 
| 
      
 86 
     | 
    
         
            +
                if nokogiri_try_compile
         
     | 
| 
       78 
87 
     | 
    
         
             
                  puts 'yes'
         
     | 
| 
       79 
88 
     | 
    
         
             
                  true
         
     | 
| 
       80 
89 
     | 
    
         
             
                else
         
     | 
| 
         @@ -225,7 +234,7 @@ def process_recipe(name, version, static_p, cross_p) 
     | 
|
| 
       225 
234 
     | 
    
         
             
            ************************************************************************
         
     | 
| 
       226 
235 
     | 
    
         
             
            IMPORTANT NOTICE:
         
     | 
| 
       227 
236 
     | 
    
         | 
| 
       228 
     | 
    
         
            -
             
     | 
| 
      
 237 
     | 
    
         
            +
            Building Nokogiri with a packaged version of #{name}-#{version}#{'.' if recipe.patch_files.empty?}
         
     | 
| 
       229 
238 
     | 
    
         
             
                EOS
         
     | 
| 
       230 
239 
     | 
    
         | 
| 
       231 
240 
     | 
    
         
             
                unless recipe.patch_files.empty?
         
     | 
| 
         @@ -294,7 +303,7 @@ def monkey_patch_mini_portile 
     | 
|
| 
       294 
303 
     | 
    
         
             
                  @patch_files.each do |full_path|
         
     | 
| 
       295 
304 
     | 
    
         
             
                    next unless File.exists?(full_path)
         
     | 
| 
       296 
305 
     | 
    
         
             
                    output "Running patch with #{full_path}..."
         
     | 
| 
       297 
     | 
    
         
            -
                    execute('patch', %Q(patch -p1 < #{full_path}))
         
     | 
| 
      
 306 
     | 
    
         
            +
                    execute('patch', %Q(patch -p1 < "#{full_path}"))
         
     | 
| 
       298 
307 
     | 
    
         
             
                  end
         
     | 
| 
       299 
308 
     | 
    
         
             
                end
         
     | 
| 
       300 
309 
     | 
    
         
             
              end
         
     | 
| 
         @@ -452,6 +461,12 @@ EOM 
     | 
|
| 
       452 
461 
     | 
    
         
             
                end
         
     | 
| 
       453 
462 
     | 
    
         
             
              end
         
     | 
| 
       454 
463 
     | 
    
         | 
| 
      
 464 
     | 
    
         
            +
              unless windows_p
         
     | 
| 
      
 465 
     | 
    
         
            +
                preserving_globals {
         
     | 
| 
      
 466 
     | 
    
         
            +
                  have_library('z', 'gzdopen', 'zlib.h')
         
     | 
| 
      
 467 
     | 
    
         
            +
                } or abort 'zlib is missing; necessary for building libxml2'
         
     | 
| 
      
 468 
     | 
    
         
            +
              end
         
     | 
| 
      
 469 
     | 
    
         
            +
             
     | 
| 
       455 
470 
     | 
    
         
             
              libxml2_recipe = process_recipe("libxml2", dependencies["libxml2"], static_p, cross_build_p) do |recipe|
         
     | 
| 
       456 
471 
     | 
    
         
             
                recipe.files = ["ftp://ftp.xmlsoft.org/libxml2/#{recipe.name}-#{recipe.version}.tar.gz"]
         
     | 
| 
       457 
472 
     | 
    
         
             
                recipe.configure_options += [
         
     |