xpather 0.0.8 → 0.0.9
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.
- data/ext/xpather/xpather.c +3 -12
 - metadata +2 -2
 
    
        data/ext/xpather/xpather.c
    CHANGED
    
    | 
         @@ -85,20 +85,11 @@ VALUE search(VALUE self, VALUE xpathExpr) 
     | 
|
| 
       85 
85 
     | 
    
         
             
              nodes = xpathObj->nodesetval;
         
     | 
| 
       86 
86 
     | 
    
         
             
              size = (nodes) ? nodes->nodeNr : 0;
         
     | 
| 
       87 
87 
     | 
    
         | 
| 
       88 
     | 
    
         
            -
               
     | 
| 
      
 88 
     | 
    
         
            +
              for (i = 0; i < size; ++i) {
         
     | 
| 
       89 
89 
     | 
    
         
             
                nodeBuffer = xmlBufferCreate();
         
     | 
| 
       90 
     | 
    
         
            -
                xmlNodeDump(nodeBuffer, doc, nodes->nodeTab[ 
     | 
| 
       91 
     | 
    
         
            -
                results  
     | 
| 
      
 90 
     | 
    
         
            +
                xmlNodeDump(nodeBuffer, doc, nodes->nodeTab[i], 0, 1);
         
     | 
| 
      
 91 
     | 
    
         
            +
                rb_ary_push(results, rb_str_new2(nodeBuffer->content));
         
     | 
| 
       92 
92 
     | 
    
         
             
                xmlBufferFree(nodeBuffer);
         
     | 
| 
       93 
     | 
    
         
            -
              } else if (size > 1) {
         
     | 
| 
       94 
     | 
    
         
            -
                for (i = 0; i < size; ++i) {
         
     | 
| 
       95 
     | 
    
         
            -
                  nodeBuffer = xmlBufferCreate();
         
     | 
| 
       96 
     | 
    
         
            -
                  xmlNodeDump(nodeBuffer, doc, nodes->nodeTab[i], 0, 1);
         
     | 
| 
       97 
     | 
    
         
            -
                  rb_ary_push(results, rb_str_new2(nodeBuffer->content));
         
     | 
| 
       98 
     | 
    
         
            -
                  xmlBufferFree(nodeBuffer);
         
     | 
| 
       99 
     | 
    
         
            -
                }
         
     | 
| 
       100 
     | 
    
         
            -
              } else {
         
     | 
| 
       101 
     | 
    
         
            -
                return Qnil;
         
     | 
| 
       102 
93 
     | 
    
         
             
              }
         
     | 
| 
       103 
94 
     | 
    
         | 
| 
       104 
95 
     | 
    
         
             
              xmlXPathFreeObject(xpathObj);
         
     | 
    
        metadata
    CHANGED
    
    | 
         @@ -1,7 +1,7 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            --- !ruby/object:Gem::Specification
         
     | 
| 
       2 
2 
     | 
    
         
             
            name: xpather
         
     | 
| 
       3 
3 
     | 
    
         
             
            version: !ruby/object:Gem::Version
         
     | 
| 
       4 
     | 
    
         
            -
              version: 0.0. 
     | 
| 
      
 4 
     | 
    
         
            +
              version: 0.0.9
         
     | 
| 
       5 
5 
     | 
    
         
             
              prerelease: 
         
     | 
| 
       6 
6 
     | 
    
         
             
            platform: ruby
         
     | 
| 
       7 
7 
     | 
    
         
             
            authors:
         
     | 
| 
         @@ -9,7 +9,7 @@ authors: 
     | 
|
| 
       9 
9 
     | 
    
         
             
            autorequire: 
         
     | 
| 
       10 
10 
     | 
    
         
             
            bindir: bin
         
     | 
| 
       11 
11 
     | 
    
         
             
            cert_chain: []
         
     | 
| 
       12 
     | 
    
         
            -
            date: 2012-09- 
     | 
| 
      
 12 
     | 
    
         
            +
            date: 2012-09-16 00:00:00.000000000 Z
         
     | 
| 
       13 
13 
     | 
    
         
             
            dependencies: []
         
     | 
| 
       14 
14 
     | 
    
         
             
            description: Quick and painless XPath searching for Ruby using libxml2
         
     | 
| 
       15 
15 
     | 
    
         
             
            email:
         
     |