xml-motor 0.1.2 → 0.1.3
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/lib/xml-motor/version.rb +1 -1
 - data/lib/xml-motor/xml-chopper.rb +4 -0
 - data/xml-motor.gemspec +28 -31
 - metadata +19 -20
 
    
        data/lib/xml-motor/version.rb
    CHANGED
    
    
| 
         @@ -14,6 +14,7 @@ module XMLChopper 
     | 
|
| 
       14 
14 
     | 
    
         
             
                attribzone = attribzone.strip unless attribzone.nil?
         
     | 
| 
       15 
15 
     | 
    
         
             
                return nil if attribzone.nil? or attribzone==""
         
     | 
| 
       16 
16 
     | 
    
         
             
                attrs = {}
         
     | 
| 
      
 17 
     | 
    
         
            +
              begin
         
     | 
| 
       17 
18 
     | 
    
         
             
                broken_attrib = attribzone.split(/=/)
         
     | 
| 
       18 
19 
     | 
    
         
             
                attribs = broken_attrib.first.strip
         
     | 
| 
       19 
20 
     | 
    
         
             
                values = nil
         
     | 
| 
         @@ -25,6 +26,9 @@ module XMLChopper 
     | 
|
| 
       25 
26 
     | 
    
         
             
                end
         
     | 
| 
       26 
27 
     | 
    
         
             
                values = broken_attrib.last.strip
         
     | 
| 
       27 
28 
     | 
    
         
             
                attrs[attribs] = XMLUtils.dbqot_string values
         
     | 
| 
      
 29 
     | 
    
         
            +
              rescue
         
     | 
| 
      
 30 
     | 
    
         
            +
                return attrs
         
     | 
| 
      
 31 
     | 
    
         
            +
              end
         
     | 
| 
       28 
32 
     | 
    
         
             
                attrs
         
     | 
| 
       29 
33 
     | 
    
         
             
              end
         
     | 
| 
       30 
34 
     | 
    
         
             
            end
         
     | 
    
        data/xml-motor.gemspec
    CHANGED
    
    | 
         @@ -9,37 +9,34 @@ Gem::Specification.new do |s| 
     | 
|
| 
       9 
9 
     | 
    
         
             
              s.email       = ["abhikumar163@gmail.com"]
         
     | 
| 
       10 
10 
     | 
    
         
             
              s.homepage    = "http://github.com/abhishekkr/rubygem_xml_motor"
         
     | 
| 
       11 
11 
     | 
    
         
             
              s.summary     = %q{An easy-to-use XML Parser without any Native Dependencies}
         
     | 
| 
       12 
     | 
    
         
            -
              s.description = %q{ 
     | 
| 
       13 
     | 
    
         
            -
             
     | 
| 
       14 
     | 
    
         
            -
             
     | 
| 
       15 
     | 
    
         
            -
             
     | 
| 
       16 
     | 
    
         
            -
             
     | 
| 
       17 
     | 
    
         
            -
             
     | 
| 
       18 
     | 
    
         
            -
             
     | 
| 
       19 
     | 
    
         
            -
             
     | 
| 
       20 
     | 
    
         
            -
             
     | 
| 
       21 
     | 
    
         
            -
             
     | 
| 
       22 
     | 
    
         
            -
             
     | 
| 
       23 
     | 
    
         
            -
             
     | 
| 
       24 
     | 
    
         
            -
             
     | 
| 
       25 
     | 
    
         
            -
             
     | 
| 
       26 
     | 
    
         
            -
                        
     | 
| 
       27 
     | 
    
         
            -
             
     | 
| 
       28 
     | 
    
         
            -
             
     | 
| 
       29 
     | 
    
         
            -
             
     | 
| 
       30 
     | 
    
         
            -
             
     | 
| 
       31 
     | 
    
         
            -
             
     | 
| 
       32 
     | 
    
         
            -
             
     | 
| 
       33 
     | 
    
         
            -
             
     | 
| 
       34 
     | 
    
         
            -
             
     | 
| 
       35 
     | 
    
         
            -
             
     | 
| 
       36 
     | 
    
         
            -
                      
     | 
| 
       37 
     | 
    
         
            -
             
     | 
| 
       38 
     | 
    
         
            -
                      
     | 
| 
       39 
     | 
    
         
            -
             
     | 
| 
       40 
     | 
    
         
            -
                     * XMLMotor.get_node_from_content "<A i='1'>a</A><B><A i='2'>ba</A></B>", "A", "i='1'"
         
     | 
| 
       41 
     | 
    
         
            -
                        -- RETURNS: ["a"]
         
     | 
| 
       42 
     | 
    
         
            -
            =end
         
     | 
| 
      
 12 
     | 
    
         
            +
              s.description = %q{A new short XML Parsing Algorithm implemented directly in >500 lines. An easy-to-use XML Parser without any Native Dependencies.
         
     | 
| 
      
 13 
     | 
    
         
            +
                  
         
     | 
| 
      
 14 
     | 
    
         
            +
                   [How To Use]: https://github.com/abhishekkr/rubygem_xml_motor/raw/master/README  
         
     | 
| 
      
 15 
     | 
    
         
            +
             
     | 
| 
      
 16 
     | 
    
         
            +
                    Loading:
         
     | 
| 
      
 17 
     | 
    
         
            +
                     + $ gem install xml-motor
         
     | 
| 
      
 18 
     | 
    
         
            +
                     + 'require' the 'xml-motor'
         
     | 
| 
      
 19 
     | 
    
         
            +
             
     | 
| 
      
 20 
     | 
    
         
            +
                    Usage:
         
     | 
| 
      
 21 
     | 
    
         
            +
                       [[ To Search Just One QUERY ]]
         
     | 
| 
      
 22 
     | 
    
         
            +
                         nodes_array = XMLMotor.get_node_from_file "_XML_FILE_"
         
     | 
| 
      
 23 
     | 
    
         
            +
                         nodes_array = XMLMotor.get_node_from_file "_XML_FILE_", "ATTRIB_KEY=ATTRIB_VALUE"
         
     | 
| 
      
 24 
     | 
    
         
            +
                         nodes_array = XMLMotor.get_node_from_content "_XML_DATA_"
         
     | 
| 
      
 25 
     | 
    
         
            +
                         nodes_array = XMLMotor.get_node_from_content "_XML_DATA_", "ATTRIB_KEY=ATTRIB_VALUE"
         
     | 
| 
      
 26 
     | 
    
         
            +
                       [[ To Search More Than One QUERIES ]]
         
     | 
| 
      
 27 
     | 
    
         
            +
                         str = {XML_DATA}
         
     | 
| 
      
 28 
     | 
    
         
            +
                         nodes_ = XMLMotor.splitter str
         
     | 
| 
      
 29 
     | 
    
         
            +
                         tags_ = XMLMotor.indexify nodes_
         
     | 
| 
      
 30 
     | 
    
         
            +
                         nodes_array = XMLMotor.xmldata nodes_, tags_, "_TAG_"
         
     | 
| 
      
 31 
     | 
    
         
            +
                         nodes_array = XMLMotor.xmldata nodes_, tags_, "_TAG_", "ATTRIB_KEY=ATTRIB_VALUE"
         
     | 
| 
      
 32 
     | 
    
         
            +
             
     | 
| 
      
 33 
     | 
    
         
            +
                    Example Calls As Code:
         
     | 
| 
      
 34 
     | 
    
         
            +
                     + XMLMotor.get_node_from_content "<A>a</A><B><A>ba</A></B>", "A"
         
     | 
| 
      
 35 
     | 
    
         
            +
                         RETURNS: ["a", "ba"]
         
     | 
| 
      
 36 
     | 
    
         
            +
                     + XMLMotor.get_node_from_content "<A>a</A><B><A>ba</A></B>", "B.A"
         
     | 
| 
      
 37 
     | 
    
         
            +
                         RETURNS: ["ba"]
         
     | 
| 
      
 38 
     | 
    
         
            +
                     + XMLMotor.get_node_from_content "<A i='1'>a</A><B><A i='2'>ba</A></B>", "A", "i='1'"
         
     | 
| 
      
 39 
     | 
    
         
            +
                         RETURNS: ["a"]
         
     | 
| 
       43 
40 
     | 
    
         
             
              }
         
     | 
| 
       44 
41 
     | 
    
         | 
| 
       45 
42 
     | 
    
         
             
              s.rubyforge_project = "xml-motor"
         
     | 
    
        metadata
    CHANGED
    
    | 
         @@ -1,7 +1,7 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            --- !ruby/object:Gem::Specification
         
     | 
| 
       2 
2 
     | 
    
         
             
            name: xml-motor
         
     | 
| 
       3 
3 
     | 
    
         
             
            version: !ruby/object:Gem::Version
         
     | 
| 
       4 
     | 
    
         
            -
              version: 0.1. 
     | 
| 
      
 4 
     | 
    
         
            +
              version: 0.1.3
         
     | 
| 
       5 
5 
     | 
    
         
             
              prerelease: 
         
     | 
| 
       6 
6 
     | 
    
         
             
            platform: ruby
         
     | 
| 
       7 
7 
     | 
    
         
             
            authors:
         
     | 
| 
         @@ -9,26 +9,25 @@ authors: 
     | 
|
| 
       9 
9 
     | 
    
         
             
            autorequire: 
         
     | 
| 
       10 
10 
     | 
    
         
             
            bindir: bin
         
     | 
| 
       11 
11 
     | 
    
         
             
            cert_chain: []
         
     | 
| 
       12 
     | 
    
         
            -
            date: 2012-04- 
     | 
| 
      
 12 
     | 
    
         
            +
            date: 2012-04-13 00:00:00.000000000 Z
         
     | 
| 
       13 
13 
     | 
    
         
             
            dependencies: []
         
     | 
| 
       14 
     | 
    
         
            -
            description: ! " 
     | 
| 
       15 
     | 
    
         
            -
               
     | 
| 
       16 
     | 
    
         
            -
               
     | 
| 
       17 
     | 
    
         
            -
              \ 
     | 
| 
       18 
     | 
    
         
            -
               
     | 
| 
       19 
     | 
    
         
            -
               
     | 
| 
       20 
     | 
    
         
            -
              \ 
     | 
| 
       21 
     | 
    
         
            -
              \ 
     | 
| 
       22 
     | 
    
         
            -
              \ 
     | 
| 
       23 
     | 
    
         
            -
              \ 
     | 
| 
       24 
     | 
    
         
            -
               
     | 
| 
       25 
     | 
    
         
            -
               
     | 
| 
       26 
     | 
    
         
            -
              \ 
     | 
| 
       27 
     | 
    
         
            -
              \ 
     | 
| 
       28 
     | 
    
         
            -
              \"A 
     | 
| 
       29 
     | 
    
         
            -
              \"<A>a</A><B><A>ba</A></B>\", 
     | 
| 
       30 
     | 
    
         
            -
               
     | 
| 
       31 
     | 
    
         
            -
              \"i='1'\"\n            -- RETURNS: [\"a\"]\n=end\n  "
         
     | 
| 
      
 14 
     | 
    
         
            +
            description: ! "A new short XML Parsing Algorithm implemented directly in >500 lines.
         
     | 
| 
      
 15 
     | 
    
         
            +
              An easy-to-use XML Parser without any Native Dependencies.\n      \n       [How
         
     | 
| 
      
 16 
     | 
    
         
            +
              To Use]: https://github.com/abhishekkr/rubygem_xml_motor/raw/master/README  \n\n
         
     | 
| 
      
 17 
     | 
    
         
            +
              \       Loading:\n         + $ gem install xml-motor\n         + 'require' the 'xml-motor'\n\n
         
     | 
| 
      
 18 
     | 
    
         
            +
              \       Usage:\n           [[ To Search Just One QUERY ]]\n             nodes_array
         
     | 
| 
      
 19 
     | 
    
         
            +
              = XMLMotor.get_node_from_file \"_XML_FILE_\"\n             nodes_array = XMLMotor.get_node_from_file
         
     | 
| 
      
 20 
     | 
    
         
            +
              \"_XML_FILE_\", \"ATTRIB_KEY=ATTRIB_VALUE\"\n             nodes_array = XMLMotor.get_node_from_content
         
     | 
| 
      
 21 
     | 
    
         
            +
              \"_XML_DATA_\"\n             nodes_array = XMLMotor.get_node_from_content \"_XML_DATA_\",
         
     | 
| 
      
 22 
     | 
    
         
            +
              \"ATTRIB_KEY=ATTRIB_VALUE\"\n           [[ To Search More Than One QUERIES ]]\n
         
     | 
| 
      
 23 
     | 
    
         
            +
              \            str = {XML_DATA}\n             nodes_ = XMLMotor.splitter str\n             tags_
         
     | 
| 
      
 24 
     | 
    
         
            +
              = XMLMotor.indexify nodes_\n             nodes_array = XMLMotor.xmldata nodes_,
         
     | 
| 
      
 25 
     | 
    
         
            +
              tags_, \"_TAG_\"\n             nodes_array = XMLMotor.xmldata nodes_, tags_, \"_TAG_\",
         
     | 
| 
      
 26 
     | 
    
         
            +
              \"ATTRIB_KEY=ATTRIB_VALUE\"\n\n        Example Calls As Code:\n         + XMLMotor.get_node_from_content
         
     | 
| 
      
 27 
     | 
    
         
            +
              \"<A>a</A><B><A>ba</A></B>\", \"A\"\n             RETURNS: [\"a\", \"ba\"]\n         +
         
     | 
| 
      
 28 
     | 
    
         
            +
              XMLMotor.get_node_from_content \"<A>a</A><B><A>ba</A></B>\", \"B.A\"\n             RETURNS:
         
     | 
| 
      
 29 
     | 
    
         
            +
              [\"ba\"]\n         + XMLMotor.get_node_from_content \"<A i='1'>a</A><B><A i='2'>ba</A></B>\",
         
     | 
| 
      
 30 
     | 
    
         
            +
              \"A\", \"i='1'\"\n             RETURNS: [\"a\"]\n  "
         
     | 
| 
       32 
31 
     | 
    
         
             
            email:
         
     | 
| 
       33 
32 
     | 
    
         
             
            - abhikumar163@gmail.com
         
     | 
| 
       34 
33 
     | 
    
         
             
            executables: []
         
     |