roxml 3.1.4 → 3.1.5
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/History.txt +6 -0
 - data/Rakefile +75 -0
 - data/VERSION +1 -1
 - data/lib/roxml.rb +1 -1
 - data/roxml.gemspec +3 -4
 - data/spec/xml/encoding_spec.rb +22 -0
 - metadata +3 -4
 - data/tasks/rdoc.rake +0 -13
 - data/tasks/rspec.rake +0 -25
 - data/tasks/test.rake +0 -33
 
    
        data/History.txt
    CHANGED
    
    
    
        data/Rakefile
    CHANGED
    
    | 
         @@ -40,3 +40,78 @@ task :default => [:test, :spec, 'test:load'] 
     | 
|
| 
       40 
40 
     | 
    
         
             
            task :all => [:libxml, :nokogiri, 'test:load']
         
     | 
| 
       41 
41 
     | 
    
         
             
            task :libxml => ['test:libxml', 'spec:libxml']
         
     | 
| 
       42 
42 
     | 
    
         
             
            task :nokogiri => ['test:nokogiri', 'spec:nokogiri']
         
     | 
| 
      
 43 
     | 
    
         
            +
             
     | 
| 
      
 44 
     | 
    
         
            +
             
     | 
| 
      
 45 
     | 
    
         
            +
            require 'rake/rdoctask'
         
     | 
| 
      
 46 
     | 
    
         
            +
            Rake::RDocTask.new do |rdoc|
         
     | 
| 
      
 47 
     | 
    
         
            +
              if File.exist?('VERSION')
         
     | 
| 
      
 48 
     | 
    
         
            +
                version = File.read('VERSION')
         
     | 
| 
      
 49 
     | 
    
         
            +
              else
         
     | 
| 
      
 50 
     | 
    
         
            +
                version = ""
         
     | 
| 
      
 51 
     | 
    
         
            +
              end
         
     | 
| 
      
 52 
     | 
    
         
            +
             
     | 
| 
      
 53 
     | 
    
         
            +
              rdoc.rdoc_dir = 'rdoc'
         
     | 
| 
      
 54 
     | 
    
         
            +
              rdoc.title = "roxml #{version}"
         
     | 
| 
      
 55 
     | 
    
         
            +
              rdoc.rdoc_files.include('README*')
         
     | 
| 
      
 56 
     | 
    
         
            +
              rdoc.rdoc_files.include('lib/**/*.rb')
         
     | 
| 
      
 57 
     | 
    
         
            +
            end
         
     | 
| 
      
 58 
     | 
    
         
            +
             
     | 
| 
      
 59 
     | 
    
         
            +
            require 'spec/rake/spectask'
         
     | 
| 
      
 60 
     | 
    
         
            +
            desc "Run specs"
         
     | 
| 
      
 61 
     | 
    
         
            +
            Spec::Rake::SpecTask.new(:spec) do |spec|
         
     | 
| 
      
 62 
     | 
    
         
            +
              spec.libs << 'lib' << 'spec' << 'examples'
         
     | 
| 
      
 63 
     | 
    
         
            +
              spec.spec_opts = ['--options', "spec/spec.opts"]
         
     | 
| 
      
 64 
     | 
    
         
            +
              spec.spec_files = FileList['spec/**/*_spec.rb']
         
     | 
| 
      
 65 
     | 
    
         
            +
            end
         
     | 
| 
      
 66 
     | 
    
         
            +
             
     | 
| 
      
 67 
     | 
    
         
            +
            namespace :spec do
         
     | 
| 
      
 68 
     | 
    
         
            +
              [:libxml, :nokogiri].each do |parser|
         
     | 
| 
      
 69 
     | 
    
         
            +
                desc "Spec ROXML under the #{parser} parser"
         
     | 
| 
      
 70 
     | 
    
         
            +
                Spec::Rake::SpecTask.new(parser) do |spec|
         
     | 
| 
      
 71 
     | 
    
         
            +
                  spec.libs << 'lib' << 'spec' << 'examples'
         
     | 
| 
      
 72 
     | 
    
         
            +
                  spec.spec_opts = ['--options=spec/spec.opts']
         
     | 
| 
      
 73 
     | 
    
         
            +
                  spec.spec_files = ["spec/support/#{parser}.rb"] + FileList['spec/**/*_spec.rb']
         
     | 
| 
      
 74 
     | 
    
         
            +
                end
         
     | 
| 
      
 75 
     | 
    
         
            +
              end
         
     | 
| 
      
 76 
     | 
    
         
            +
            end
         
     | 
| 
      
 77 
     | 
    
         
            +
             
     | 
| 
      
 78 
     | 
    
         
            +
            desc "Run specs with rcov"
         
     | 
| 
      
 79 
     | 
    
         
            +
            Spec::Rake::SpecTask.new(:rcov) do |spec|
         
     | 
| 
      
 80 
     | 
    
         
            +
              spec.libs << 'lib' << 'spec'
         
     | 
| 
      
 81 
     | 
    
         
            +
              spec.pattern = 'spec/**/*_spec.rb'
         
     | 
| 
      
 82 
     | 
    
         
            +
              spec.rcov = true
         
     | 
| 
      
 83 
     | 
    
         
            +
            end
         
     | 
| 
      
 84 
     | 
    
         
            +
             
     | 
| 
      
 85 
     | 
    
         
            +
            require 'rake/testtask'
         
     | 
| 
      
 86 
     | 
    
         
            +
            desc "Test ROXML using the default parser selection behavior"
         
     | 
| 
      
 87 
     | 
    
         
            +
            task :test do
         
     | 
| 
      
 88 
     | 
    
         
            +
              require 'rake/runtest'
         
     | 
| 
      
 89 
     | 
    
         
            +
              $LOAD_PATH << 'lib'
         
     | 
| 
      
 90 
     | 
    
         
            +
              Rake.run_tests 'test/unit/*_test.rb'
         
     | 
| 
      
 91 
     | 
    
         
            +
            end
         
     | 
| 
      
 92 
     | 
    
         
            +
             
     | 
| 
      
 93 
     | 
    
         
            +
            namespace :test do
         
     | 
| 
      
 94 
     | 
    
         
            +
              desc "Test ROXML under the Nokogiri parser"
         
     | 
| 
      
 95 
     | 
    
         
            +
              task :nokogiri do
         
     | 
| 
      
 96 
     | 
    
         
            +
                $LOAD_PATH << 'spec'
         
     | 
| 
      
 97 
     | 
    
         
            +
                require 'spec/support/nokogiri'
         
     | 
| 
      
 98 
     | 
    
         
            +
                Rake::Task["test"].invoke
         
     | 
| 
      
 99 
     | 
    
         
            +
              end
         
     | 
| 
      
 100 
     | 
    
         
            +
             
     | 
| 
      
 101 
     | 
    
         
            +
               desc "Test ROXML under the LibXML parser"
         
     | 
| 
      
 102 
     | 
    
         
            +
              task :libxml do
         
     | 
| 
      
 103 
     | 
    
         
            +
                $LOAD_PATH << 'spec'
         
     | 
| 
      
 104 
     | 
    
         
            +
                require 'spec/support/libxml'
         
     | 
| 
      
 105 
     | 
    
         
            +
                Rake::Task["test"].invoke
         
     | 
| 
      
 106 
     | 
    
         
            +
              end
         
     | 
| 
      
 107 
     | 
    
         
            +
             
     | 
| 
      
 108 
     | 
    
         
            +
              task :load do
         
     | 
| 
      
 109 
     | 
    
         
            +
                `ruby test/load_test.rb`
         
     | 
| 
      
 110 
     | 
    
         
            +
                puts "Load Success!" if $?.success?
         
     | 
| 
      
 111 
     | 
    
         
            +
              end
         
     | 
| 
      
 112 
     | 
    
         
            +
             
     | 
| 
      
 113 
     | 
    
         
            +
              desc "Runs tests under RCOV"
         
     | 
| 
      
 114 
     | 
    
         
            +
              task :rcov do
         
     | 
| 
      
 115 
     | 
    
         
            +
                system "rcov -T --no-html -x '^/'  #{FileList['test/unit/*_test.rb']}"
         
     | 
| 
      
 116 
     | 
    
         
            +
              end
         
     | 
| 
      
 117 
     | 
    
         
            +
            end
         
     | 
    
        data/VERSION
    CHANGED
    
    | 
         @@ -1 +1 @@ 
     | 
|
| 
       1 
     | 
    
         
            -
            3.1. 
     | 
| 
      
 1 
     | 
    
         
            +
            3.1.5
         
     | 
    
        data/lib/roxml.rb
    CHANGED
    
    
    
        data/roxml.gemspec
    CHANGED
    
    | 
         @@ -5,7 +5,7 @@ 
     | 
|
| 
       5 
5 
     | 
    
         | 
| 
       6 
6 
     | 
    
         
             
            Gem::Specification.new do |s|
         
     | 
| 
       7 
7 
     | 
    
         
             
              s.name = %q{roxml}
         
     | 
| 
       8 
     | 
    
         
            -
              s.version = "3.1. 
     | 
| 
      
 8 
     | 
    
         
            +
              s.version = "3.1.5"
         
     | 
| 
       9 
9 
     | 
    
         | 
| 
       10 
10 
     | 
    
         
             
              s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
         
     | 
| 
       11 
11 
     | 
    
         
             
              s.authors = ["Ben Woosley", "Zak Mandhro", "Anders Engstrom", "Russ Olsen"]
         
     | 
| 
         @@ -66,14 +66,12 @@ RESTful applications, Web Services, and XML-RPC. 
     | 
|
| 
       66 
66 
     | 
    
         
             
                 "spec/support/libxml.rb",
         
     | 
| 
       67 
67 
     | 
    
         
             
                 "spec/support/nokogiri.rb",
         
     | 
| 
       68 
68 
     | 
    
         
             
                 "spec/xml/attributes_spec.rb",
         
     | 
| 
      
 69 
     | 
    
         
            +
                 "spec/xml/encoding_spec.rb",
         
     | 
| 
       69 
70 
     | 
    
         
             
                 "spec/xml/namespace_spec.rb",
         
     | 
| 
       70 
71 
     | 
    
         
             
                 "spec/xml/namespaces_spec.rb",
         
     | 
| 
       71 
72 
     | 
    
         
             
                 "spec/xml/object_spec.rb",
         
     | 
| 
       72 
73 
     | 
    
         
             
                 "spec/xml/parser_spec.rb",
         
     | 
| 
       73 
74 
     | 
    
         
             
                 "spec/xml/text_spec.rb",
         
     | 
| 
       74 
     | 
    
         
            -
                 "tasks/rdoc.rake",
         
     | 
| 
       75 
     | 
    
         
            -
                 "tasks/rspec.rake",
         
     | 
| 
       76 
     | 
    
         
            -
                 "tasks/test.rake",
         
     | 
| 
       77 
75 
     | 
    
         
             
                 "test/fixtures/book_malformed.xml",
         
     | 
| 
       78 
76 
     | 
    
         
             
                 "test/fixtures/book_pair.xml",
         
     | 
| 
       79 
77 
     | 
    
         
             
                 "test/fixtures/book_text_with_attribute.xml",
         
     | 
| 
         @@ -146,6 +144,7 @@ RESTful applications, Web Services, and XML-RPC. 
     | 
|
| 
       146 
144 
     | 
    
         
             
                 "spec/support/libxml.rb",
         
     | 
| 
       147 
145 
     | 
    
         
             
                 "spec/support/nokogiri.rb",
         
     | 
| 
       148 
146 
     | 
    
         
             
                 "spec/xml/attributes_spec.rb",
         
     | 
| 
      
 147 
     | 
    
         
            +
                 "spec/xml/encoding_spec.rb",
         
     | 
| 
       149 
148 
     | 
    
         
             
                 "spec/xml/namespace_spec.rb",
         
     | 
| 
       150 
149 
     | 
    
         
             
                 "spec/xml/namespaces_spec.rb",
         
     | 
| 
       151 
150 
     | 
    
         
             
                 "spec/xml/object_spec.rb",
         
     | 
| 
         @@ -0,0 +1,22 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            require 'spec/spec_helper'
         
     | 
| 
      
 2 
     | 
    
         
            +
             
     | 
| 
      
 3 
     | 
    
         
            +
            describe ROXML, "encoding" do
         
     | 
| 
      
 4 
     | 
    
         
            +
              class TestResult
         
     | 
| 
      
 5 
     | 
    
         
            +
                include ROXML
         
     | 
| 
      
 6 
     | 
    
         
            +
                xml_accessor :message
         
     | 
| 
      
 7 
     | 
    
         
            +
              end
         
     | 
| 
      
 8 
     | 
    
         
            +
             
     | 
| 
      
 9 
     | 
    
         
            +
              context "when provided non-latin characters" do
         
     | 
| 
      
 10 
     | 
    
         
            +
                it "should output those characters as input via methods" do
         
     | 
| 
      
 11 
     | 
    
         
            +
                  res = TestResult.new
         
     | 
| 
      
 12 
     | 
    
         
            +
                  res.message = "sadfk одловыа jjklsd " #random russian  and english charecters
         
     | 
| 
      
 13 
     | 
    
         
            +
                  res.to_xml.at('message').inner_text.should == "sadfk одловыа jjklsd "
         
     | 
| 
      
 14 
     | 
    
         
            +
                end
         
     | 
| 
      
 15 
     | 
    
         
            +
             
     | 
| 
      
 16 
     | 
    
         
            +
                it "should output those characters as input via xml" do
         
     | 
| 
      
 17 
     | 
    
         
            +
                  res = TestResult.from_xml("<test_result><message>sadfk одловыа jjklsd </message></test_result>")
         
     | 
| 
      
 18 
     | 
    
         
            +
                  res.to_xml.at('message').inner_text.should == "sadfk одловыа jjklsd "
         
     | 
| 
      
 19 
     | 
    
         
            +
                end
         
     | 
| 
      
 20 
     | 
    
         
            +
              end
         
     | 
| 
      
 21 
     | 
    
         
            +
             
     | 
| 
      
 22 
     | 
    
         
            +
            end
         
     | 
    
        metadata
    CHANGED
    
    | 
         @@ -1,7 +1,7 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            --- !ruby/object:Gem::Specification 
         
     | 
| 
       2 
2 
     | 
    
         
             
            name: roxml
         
     | 
| 
       3 
3 
     | 
    
         
             
            version: !ruby/object:Gem::Version 
         
     | 
| 
       4 
     | 
    
         
            -
              version: 3.1. 
     | 
| 
      
 4 
     | 
    
         
            +
              version: 3.1.5
         
     | 
| 
       5 
5 
     | 
    
         
             
            platform: ruby
         
     | 
| 
       6 
6 
     | 
    
         
             
            authors: 
         
     | 
| 
       7 
7 
     | 
    
         
             
            - Ben Woosley
         
     | 
| 
         @@ -125,14 +125,12 @@ files: 
     | 
|
| 
       125 
125 
     | 
    
         
             
            - spec/support/libxml.rb
         
     | 
| 
       126 
126 
     | 
    
         
             
            - spec/support/nokogiri.rb
         
     | 
| 
       127 
127 
     | 
    
         
             
            - spec/xml/attributes_spec.rb
         
     | 
| 
      
 128 
     | 
    
         
            +
            - spec/xml/encoding_spec.rb
         
     | 
| 
       128 
129 
     | 
    
         
             
            - spec/xml/namespace_spec.rb
         
     | 
| 
       129 
130 
     | 
    
         
             
            - spec/xml/namespaces_spec.rb
         
     | 
| 
       130 
131 
     | 
    
         
             
            - spec/xml/object_spec.rb
         
     | 
| 
       131 
132 
     | 
    
         
             
            - spec/xml/parser_spec.rb
         
     | 
| 
       132 
133 
     | 
    
         
             
            - spec/xml/text_spec.rb
         
     | 
| 
       133 
     | 
    
         
            -
            - tasks/rdoc.rake
         
     | 
| 
       134 
     | 
    
         
            -
            - tasks/rspec.rake
         
     | 
| 
       135 
     | 
    
         
            -
            - tasks/test.rake
         
     | 
| 
       136 
134 
     | 
    
         
             
            - test/fixtures/book_malformed.xml
         
     | 
| 
       137 
135 
     | 
    
         
             
            - test/fixtures/book_pair.xml
         
     | 
| 
       138 
136 
     | 
    
         
             
            - test/fixtures/book_text_with_attribute.xml
         
     | 
| 
         @@ -226,6 +224,7 @@ test_files: 
     | 
|
| 
       226 
224 
     | 
    
         
             
            - spec/support/libxml.rb
         
     | 
| 
       227 
225 
     | 
    
         
             
            - spec/support/nokogiri.rb
         
     | 
| 
       228 
226 
     | 
    
         
             
            - spec/xml/attributes_spec.rb
         
     | 
| 
      
 227 
     | 
    
         
            +
            - spec/xml/encoding_spec.rb
         
     | 
| 
       229 
228 
     | 
    
         
             
            - spec/xml/namespace_spec.rb
         
     | 
| 
       230 
229 
     | 
    
         
             
            - spec/xml/namespaces_spec.rb
         
     | 
| 
       231 
230 
     | 
    
         
             
            - spec/xml/object_spec.rb
         
     | 
    
        data/tasks/rdoc.rake
    DELETED
    
    | 
         @@ -1,13 +0,0 @@ 
     | 
|
| 
       1 
     | 
    
         
            -
            require 'rake/rdoctask'
         
     | 
| 
       2 
     | 
    
         
            -
            Rake::RDocTask.new do |rdoc|
         
     | 
| 
       3 
     | 
    
         
            -
              if File.exist?('VERSION')
         
     | 
| 
       4 
     | 
    
         
            -
                version = File.read('VERSION')
         
     | 
| 
       5 
     | 
    
         
            -
              else
         
     | 
| 
       6 
     | 
    
         
            -
                version = ""
         
     | 
| 
       7 
     | 
    
         
            -
              end
         
     | 
| 
       8 
     | 
    
         
            -
             
     | 
| 
       9 
     | 
    
         
            -
              rdoc.rdoc_dir = 'rdoc'
         
     | 
| 
       10 
     | 
    
         
            -
              rdoc.title = "roxml #{version}"
         
     | 
| 
       11 
     | 
    
         
            -
              rdoc.rdoc_files.include('README*')
         
     | 
| 
       12 
     | 
    
         
            -
              rdoc.rdoc_files.include('lib/**/*.rb')
         
     | 
| 
       13 
     | 
    
         
            -
            end
         
     | 
    
        data/tasks/rspec.rake
    DELETED
    
    | 
         @@ -1,25 +0,0 @@ 
     | 
|
| 
       1 
     | 
    
         
            -
            require 'spec/rake/spectask'
         
     | 
| 
       2 
     | 
    
         
            -
            desc "Run specs"
         
     | 
| 
       3 
     | 
    
         
            -
            Spec::Rake::SpecTask.new(:spec) do |spec|
         
     | 
| 
       4 
     | 
    
         
            -
              spec.libs << 'lib' << 'spec' << 'examples'
         
     | 
| 
       5 
     | 
    
         
            -
              spec.spec_opts = ['--options', "spec/spec.opts"]
         
     | 
| 
       6 
     | 
    
         
            -
              spec.spec_files = FileList['spec/**/*_spec.rb']
         
     | 
| 
       7 
     | 
    
         
            -
            end
         
     | 
| 
       8 
     | 
    
         
            -
             
     | 
| 
       9 
     | 
    
         
            -
            namespace :spec do
         
     | 
| 
       10 
     | 
    
         
            -
              [:libxml, :nokogiri].each do |parser|
         
     | 
| 
       11 
     | 
    
         
            -
                desc "Spec ROXML under the #{parser} parser"
         
     | 
| 
       12 
     | 
    
         
            -
                Spec::Rake::SpecTask.new(parser) do |spec|
         
     | 
| 
       13 
     | 
    
         
            -
                  spec.libs << 'lib' << 'spec' << 'examples'
         
     | 
| 
       14 
     | 
    
         
            -
                  spec.spec_opts = ['--options=spec/spec.opts']
         
     | 
| 
       15 
     | 
    
         
            -
                  spec.spec_files = ["spec/support/#{parser}.rb"] + FileList['spec/**/*_spec.rb']
         
     | 
| 
       16 
     | 
    
         
            -
                end
         
     | 
| 
       17 
     | 
    
         
            -
              end
         
     | 
| 
       18 
     | 
    
         
            -
            end
         
     | 
| 
       19 
     | 
    
         
            -
             
     | 
| 
       20 
     | 
    
         
            -
            desc "Run specs with rcov"
         
     | 
| 
       21 
     | 
    
         
            -
            Spec::Rake::SpecTask.new(:rcov) do |spec|
         
     | 
| 
       22 
     | 
    
         
            -
              spec.libs << 'lib' << 'spec'
         
     | 
| 
       23 
     | 
    
         
            -
              spec.pattern = 'spec/**/*_spec.rb'
         
     | 
| 
       24 
     | 
    
         
            -
              spec.rcov = true
         
     | 
| 
       25 
     | 
    
         
            -
            end
         
     | 
    
        data/tasks/test.rake
    DELETED
    
    | 
         @@ -1,33 +0,0 @@ 
     | 
|
| 
       1 
     | 
    
         
            -
            require 'rake/testtask'
         
     | 
| 
       2 
     | 
    
         
            -
            desc "Test ROXML using the default parser selection behavior"
         
     | 
| 
       3 
     | 
    
         
            -
            task :test do
         
     | 
| 
       4 
     | 
    
         
            -
              require 'rake/runtest'
         
     | 
| 
       5 
     | 
    
         
            -
              $LOAD_PATH << 'lib'
         
     | 
| 
       6 
     | 
    
         
            -
              Rake.run_tests 'test/unit/*_test.rb'
         
     | 
| 
       7 
     | 
    
         
            -
            end
         
     | 
| 
       8 
     | 
    
         
            -
             
     | 
| 
       9 
     | 
    
         
            -
            namespace :test do
         
     | 
| 
       10 
     | 
    
         
            -
              desc "Test ROXML under the Nokogiri parser"
         
     | 
| 
       11 
     | 
    
         
            -
              task :nokogiri do
         
     | 
| 
       12 
     | 
    
         
            -
                $LOAD_PATH << 'spec'
         
     | 
| 
       13 
     | 
    
         
            -
                require 'spec/support/nokogiri'
         
     | 
| 
       14 
     | 
    
         
            -
                Rake::Task["test"].invoke
         
     | 
| 
       15 
     | 
    
         
            -
              end
         
     | 
| 
       16 
     | 
    
         
            -
             
     | 
| 
       17 
     | 
    
         
            -
               desc "Test ROXML under the LibXML parser"
         
     | 
| 
       18 
     | 
    
         
            -
              task :libxml do
         
     | 
| 
       19 
     | 
    
         
            -
                $LOAD_PATH << 'spec'
         
     | 
| 
       20 
     | 
    
         
            -
                require 'spec/support/libxml'
         
     | 
| 
       21 
     | 
    
         
            -
                Rake::Task["test"].invoke
         
     | 
| 
       22 
     | 
    
         
            -
              end
         
     | 
| 
       23 
     | 
    
         
            -
             
     | 
| 
       24 
     | 
    
         
            -
              task :load do
         
     | 
| 
       25 
     | 
    
         
            -
                `ruby test/load_test.rb`
         
     | 
| 
       26 
     | 
    
         
            -
                puts "Load Success!" if $?.success?
         
     | 
| 
       27 
     | 
    
         
            -
              end
         
     | 
| 
       28 
     | 
    
         
            -
             
     | 
| 
       29 
     | 
    
         
            -
              desc "Runs tests under RCOV"
         
     | 
| 
       30 
     | 
    
         
            -
              task :rcov do
         
     | 
| 
       31 
     | 
    
         
            -
                system "rcov -T --no-html -x '^/'  #{FileList['test/unit/*_test.rb']}"
         
     | 
| 
       32 
     | 
    
         
            -
              end
         
     | 
| 
       33 
     | 
    
         
            -
            end
         
     |