RedCloth 4.2.4-x86-mingw32 → 4.2.5-x86-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 RedCloth might be problematic. Click here for more details.
- data/CHANGELOG +5 -0
- data/Gemfile +2 -2
- data/{README → README.rdoc} +0 -0
- data/Rakefile +5 -3
- data/ext/redcloth_scan/redcloth_attributes.c +649 -0
- data/ext/redcloth_scan/redcloth_inline.c +7987 -0
- data/ext/redcloth_scan/redcloth_scan.c +24406 -0
- data/lib/1.8/redcloth_scan.so +0 -0
- data/lib/1.9/redcloth_scan.so +0 -0
- data/lib/redcloth/version.rb +1 -1
- data/lib/redcloth_scan.jar +0 -0
- data/redcloth.gemspec +13 -8
- data/spec/benchmark_spec.rb +1 -1
- data/tasks/rvm.rake +2 -1
- metadata +102 -24
- data/.gitignore +0 -26
- data/test/ragel_profiler.rb +0 -73
- data/test/validate_fixtures.rb +0 -74
| Binary file | 
| Binary file | 
    
        data/lib/redcloth/version.rb
    CHANGED
    
    
| Binary file | 
    
        data/redcloth.gemspec
    CHANGED
    
    | @@ -16,16 +16,13 @@ Gem::Specification.new do |s| | |
| 16 16 | 
             
              s.rubygems_version   = "1.3.7"
         | 
| 17 17 | 
             
              s.default_executable = "redcloth"
         | 
| 18 18 |  | 
| 19 | 
            -
              s.files            =  | 
| 20 | 
            -
              s.test_files       =  | 
| 21 | 
            -
              s.executables      =  | 
| 22 | 
            -
              s.extra_rdoc_files = ["COPYING", "README", "CHANGELOG"]
         | 
| 19 | 
            +
              s.files            = Dir['.gemtest', '.rspec', 'CHANGELOG', 'COPYING', 'Gemfile', 'README.rdoc', 'Rakefile', 'doc/**/*', 'bin/**/*', 'lib/**/*', 'redcloth.gemspec', 'spec/**/*', 'tasks/**/*']
         | 
| 20 | 
            +
              s.test_files       = Dir['spec/**/*']
         | 
| 21 | 
            +
              s.executables      = ['redcloth']
         | 
| 22 | 
            +
              s.extra_rdoc_files = ["COPYING", "README.rdoc", "CHANGELOG"]
         | 
| 23 23 | 
             
              s.rdoc_options     = ["--charset=UTF-8"]
         | 
| 24 24 | 
             
              s.require_path     = "lib"
         | 
| 25 25 |  | 
| 26 | 
            -
              s.files -= ['.rvmrc']
         | 
| 27 | 
            -
              s.files -= Dir['ext/**/*']
         | 
| 28 | 
            -
              s.files -= Dir['ragel/*']
         | 
| 29 26 | 
             
              s.files -= Dir['lib/redcloth.jar']
         | 
| 30 27 | 
             
              s.files -= Dir['lib/**/*.dll']
         | 
| 31 28 | 
             
              s.files -= Dir['lib/**/*.bundle']
         | 
| @@ -41,7 +38,15 @@ Gem::Specification.new do |s| | |
| 41 38 | 
             
                s.extensions = Dir['ext/**/extconf.rb']
         | 
| 42 39 | 
             
              end
         | 
| 43 40 |  | 
| 41 | 
            +
              s.add_development_dependency('bundler', '~> 1.0.10')
         | 
| 44 42 | 
             
              s.add_development_dependency('rake', '~> 0.8.7')
         | 
| 45 43 | 
             
              s.add_development_dependency('rspec', '~> 2.4')
         | 
| 46 | 
            -
              s.add_development_dependency('diff-lcs')
         | 
| 44 | 
            +
              s.add_development_dependency('diff-lcs', '~> 1.1.2')
         | 
| 45 | 
            +
              
         | 
| 46 | 
            +
              # Have to load these even though they're only needed for
         | 
| 47 | 
            +
              # gem packaging. Otherwise, Bundler complains that they're
         | 
| 48 | 
            +
              # not installed even though they're not required.
         | 
| 49 | 
            +
              # See https://github.com/carlhuda/bundler/issues/issue/1021
         | 
| 50 | 
            +
              s.add_development_dependency('rvm', '~> 1.2.6')
         | 
| 51 | 
            +
              s.add_development_dependency('rake-compiler', '~> 0.7.1')
         | 
| 47 52 | 
             
            end
         | 
    
        data/spec/benchmark_spec.rb
    CHANGED
    
    | @@ -5,7 +5,7 @@ describe "Benchmarking", :type => :formatter do | |
| 5 5 | 
             
              platform = RedCloth.const_defined?(:EXTENSION_LANGUAGE) ? RedCloth::EXTENSION_LANGUAGE : (version < "4.0.0" ? "ruby-regex" : "C")
         | 
| 6 6 |  | 
| 7 7 | 
             
              it "should not be too slow" do
         | 
| 8 | 
            -
                puts "Benchmarking version #{version} compiled in #{platform}..."
         | 
| 8 | 
            +
                # puts "Benchmarking version #{version} compiled in #{platform}..."
         | 
| 9 9 | 
             
                fixtures.each do |name, doc|
         | 
| 10 10 | 
             
                  if doc['html']
         | 
| 11 11 | 
             
                    RedCloth.new(doc['in']).to_html
         | 
    
        data/tasks/rvm.rake
    CHANGED
    
    | @@ -1,6 +1,6 @@ | |
| 1 1 | 
             
            namespace :rvm do
         | 
| 2 2 |  | 
| 3 | 
            -
              RVM_RUBIES = ['jruby-1.5. | 
| 3 | 
            +
              RVM_RUBIES = ['jruby-1.5.6' , 'ruby-1.8.6-p398', 'ruby-1.9.1-p243', 'ruby-1.9.2-p136', 'ree-1.8.7-2010.02']
         | 
| 4 4 | 
             
              RVM_GEMSET_NAME = 'redcloth'
         | 
| 5 5 |  | 
| 6 6 | 
             
              task :setup do
         | 
| @@ -22,6 +22,7 @@ namespace :rvm do | |
| 22 22 | 
             
                  STDERR << RVM.run('bundle update').stderr 
         | 
| 23 23 |  | 
| 24 24 | 
             
                  result = RVM.perform_set_operation(:rake)
         | 
| 25 | 
            +
                  STDOUT << result.stdout
         | 
| 25 26 | 
             
                  STDERR << result.stderr
         | 
| 26 27 | 
             
                end
         | 
| 27 28 | 
             
              end
         | 
    
        metadata
    CHANGED
    
    | @@ -1,13 +1,13 @@ | |
| 1 1 | 
             
            --- !ruby/object:Gem::Specification 
         | 
| 2 2 | 
             
            name: RedCloth
         | 
| 3 3 | 
             
            version: !ruby/object:Gem::Version 
         | 
| 4 | 
            -
              hash:  | 
| 4 | 
            +
              hash: 61
         | 
| 5 5 | 
             
              prerelease: 
         | 
| 6 6 | 
             
              segments: 
         | 
| 7 7 | 
             
              - 4
         | 
| 8 8 | 
             
              - 2
         | 
| 9 | 
            -
              -  | 
| 10 | 
            -
              version: 4.2. | 
| 9 | 
            +
              - 5
         | 
| 10 | 
            +
              version: 4.2.5
         | 
| 11 11 | 
             
            platform: x86-mingw32
         | 
| 12 12 | 
             
            authors: 
         | 
| 13 13 | 
             
            - Jason Garber
         | 
| @@ -21,8 +21,23 @@ date: 2011-02-07 00:00:00 -06:00 | |
| 21 21 | 
             
            default_executable: redcloth
         | 
| 22 22 | 
             
            dependencies: 
         | 
| 23 23 | 
             
            - !ruby/object:Gem::Dependency 
         | 
| 24 | 
            -
              name: rake
         | 
| 25 24 | 
             
              version_requirements: &id001 !ruby/object:Gem::Requirement 
         | 
| 25 | 
            +
                none: false
         | 
| 26 | 
            +
                requirements: 
         | 
| 27 | 
            +
                - - ~>
         | 
| 28 | 
            +
                  - !ruby/object:Gem::Version 
         | 
| 29 | 
            +
                    hash: 3
         | 
| 30 | 
            +
                    segments: 
         | 
| 31 | 
            +
                    - 1
         | 
| 32 | 
            +
                    - 0
         | 
| 33 | 
            +
                    - 10
         | 
| 34 | 
            +
                    version: 1.0.10
         | 
| 35 | 
            +
              prerelease: false
         | 
| 36 | 
            +
              type: :development
         | 
| 37 | 
            +
              requirement: *id001
         | 
| 38 | 
            +
              name: bundler
         | 
| 39 | 
            +
            - !ruby/object:Gem::Dependency 
         | 
| 40 | 
            +
              version_requirements: &id002 !ruby/object:Gem::Requirement 
         | 
| 26 41 | 
             
                none: false
         | 
| 27 42 | 
             
                requirements: 
         | 
| 28 43 | 
             
                - - ~>
         | 
| @@ -35,10 +50,10 @@ dependencies: | |
| 35 50 | 
             
                    version: 0.8.7
         | 
| 36 51 | 
             
              prerelease: false
         | 
| 37 52 | 
             
              type: :development
         | 
| 38 | 
            -
              requirement: * | 
| 53 | 
            +
              requirement: *id002
         | 
| 54 | 
            +
              name: rake
         | 
| 39 55 | 
             
            - !ruby/object:Gem::Dependency 
         | 
| 40 | 
            -
               | 
| 41 | 
            -
              version_requirements: &id002 !ruby/object:Gem::Requirement 
         | 
| 56 | 
            +
              version_requirements: &id003 !ruby/object:Gem::Requirement 
         | 
| 42 57 | 
             
                none: false
         | 
| 43 58 | 
             
                requirements: 
         | 
| 44 59 | 
             
                - - ~>
         | 
| @@ -50,21 +65,56 @@ dependencies: | |
| 50 65 | 
             
                    version: "2.4"
         | 
| 51 66 | 
             
              prerelease: false
         | 
| 52 67 | 
             
              type: :development
         | 
| 53 | 
            -
              requirement: * | 
| 68 | 
            +
              requirement: *id003
         | 
| 69 | 
            +
              name: rspec
         | 
| 54 70 | 
             
            - !ruby/object:Gem::Dependency 
         | 
| 71 | 
            +
              version_requirements: &id004 !ruby/object:Gem::Requirement 
         | 
| 72 | 
            +
                none: false
         | 
| 73 | 
            +
                requirements: 
         | 
| 74 | 
            +
                - - ~>
         | 
| 75 | 
            +
                  - !ruby/object:Gem::Version 
         | 
| 76 | 
            +
                    hash: 23
         | 
| 77 | 
            +
                    segments: 
         | 
| 78 | 
            +
                    - 1
         | 
| 79 | 
            +
                    - 1
         | 
| 80 | 
            +
                    - 2
         | 
| 81 | 
            +
                    version: 1.1.2
         | 
| 82 | 
            +
              prerelease: false
         | 
| 83 | 
            +
              type: :development
         | 
| 84 | 
            +
              requirement: *id004
         | 
| 55 85 | 
             
              name: diff-lcs
         | 
| 56 | 
            -
             | 
| 86 | 
            +
            - !ruby/object:Gem::Dependency 
         | 
| 87 | 
            +
              version_requirements: &id005 !ruby/object:Gem::Requirement 
         | 
| 57 88 | 
             
                none: false
         | 
| 58 89 | 
             
                requirements: 
         | 
| 59 | 
            -
                - -  | 
| 90 | 
            +
                - - ~>
         | 
| 60 91 | 
             
                  - !ruby/object:Gem::Version 
         | 
| 61 | 
            -
                    hash:  | 
| 92 | 
            +
                    hash: 19
         | 
| 93 | 
            +
                    segments: 
         | 
| 94 | 
            +
                    - 1
         | 
| 95 | 
            +
                    - 2
         | 
| 96 | 
            +
                    - 6
         | 
| 97 | 
            +
                    version: 1.2.6
         | 
| 98 | 
            +
              prerelease: false
         | 
| 99 | 
            +
              type: :development
         | 
| 100 | 
            +
              requirement: *id005
         | 
| 101 | 
            +
              name: rvm
         | 
| 102 | 
            +
            - !ruby/object:Gem::Dependency 
         | 
| 103 | 
            +
              version_requirements: &id006 !ruby/object:Gem::Requirement 
         | 
| 104 | 
            +
                none: false
         | 
| 105 | 
            +
                requirements: 
         | 
| 106 | 
            +
                - - ~>
         | 
| 107 | 
            +
                  - !ruby/object:Gem::Version 
         | 
| 108 | 
            +
                    hash: 1
         | 
| 62 109 | 
             
                    segments: 
         | 
| 63 110 | 
             
                    - 0
         | 
| 64 | 
            -
                     | 
| 111 | 
            +
                    - 7
         | 
| 112 | 
            +
                    - 1
         | 
| 113 | 
            +
                    version: 0.7.1
         | 
| 65 114 | 
             
              prerelease: false
         | 
| 66 115 | 
             
              type: :development
         | 
| 67 | 
            -
              requirement: * | 
| 116 | 
            +
              requirement: *id006
         | 
| 117 | 
            +
              name: rake-compiler
         | 
| 68 118 | 
             
            description: Textile parser for Ruby.
         | 
| 69 119 | 
             
            email: redcloth-upwards@rubyforge.org
         | 
| 70 120 | 
             
            executables: 
         | 
| @@ -73,22 +123,19 @@ extensions: [] | |
| 73 123 |  | 
| 74 124 | 
             
            extra_rdoc_files: 
         | 
| 75 125 | 
             
            - COPYING
         | 
| 76 | 
            -
            - README
         | 
| 126 | 
            +
            - README.rdoc
         | 
| 77 127 | 
             
            - CHANGELOG
         | 
| 78 128 | 
             
            files: 
         | 
| 79 | 
            -
            - .bundle/config
         | 
| 80 129 | 
             
            - .gemtest
         | 
| 81 | 
            -
            - .gitignore
         | 
| 82 130 | 
             
            - .rspec
         | 
| 83 131 | 
             
            - CHANGELOG
         | 
| 84 132 | 
             
            - COPYING
         | 
| 85 133 | 
             
            - Gemfile
         | 
| 86 | 
            -
            - README
         | 
| 134 | 
            +
            - README.rdoc
         | 
| 87 135 | 
             
            - Rakefile
         | 
| 88 | 
            -
            - bin/redcloth
         | 
| 89 136 | 
             
            - doc/textile_reference.html
         | 
| 137 | 
            +
            - bin/redcloth
         | 
| 90 138 | 
             
            - lib/case_sensitive_require/RedCloth.rb
         | 
| 91 | 
            -
            - lib/redcloth.rb
         | 
| 92 139 | 
             
            - lib/redcloth/erb_extension.rb
         | 
| 93 140 | 
             
            - lib/redcloth/formatters/base.rb
         | 
| 94 141 | 
             
            - lib/redcloth/formatters/html.rb
         | 
| @@ -96,6 +143,8 @@ files: | |
| 96 143 | 
             
            - lib/redcloth/formatters/latex_entities.yml
         | 
| 97 144 | 
             
            - lib/redcloth/textile_doc.rb
         | 
| 98 145 | 
             
            - lib/redcloth/version.rb
         | 
| 146 | 
            +
            - lib/redcloth.rb
         | 
| 147 | 
            +
            - lib/redcloth_scan.jar
         | 
| 99 148 | 
             
            - lib/tasks/pureruby.rake
         | 
| 100 149 | 
             
            - redcloth.gemspec
         | 
| 101 150 | 
             
            - spec/benchmark_spec.rb
         | 
| @@ -136,8 +185,6 @@ files: | |
| 136 185 | 
             
            - tasks/release.rake
         | 
| 137 186 | 
             
            - tasks/rspec.rake
         | 
| 138 187 | 
             
            - tasks/rvm.rake
         | 
| 139 | 
            -
            - test/ragel_profiler.rb
         | 
| 140 | 
            -
            - test/validate_fixtures.rb
         | 
| 141 188 | 
             
            - ext/redcloth_scan/redcloth_attributes.c
         | 
| 142 189 | 
             
            - ext/redcloth_scan/redcloth_inline.c
         | 
| 143 190 | 
             
            - ext/redcloth_scan/redcloth_scan.c
         | 
| @@ -177,6 +224,37 @@ rubyforge_project: redcloth | |
| 177 224 | 
             
            rubygems_version: 1.5.0
         | 
| 178 225 | 
             
            signing_key: 
         | 
| 179 226 | 
             
            specification_version: 3
         | 
| 180 | 
            -
            summary: RedCloth-4.2. | 
| 181 | 
            -
            test_files:  | 
| 182 | 
            -
             | 
| 227 | 
            +
            summary: RedCloth-4.2.5
         | 
| 228 | 
            +
            test_files: 
         | 
| 229 | 
            +
            - spec/benchmark_spec.rb
         | 
| 230 | 
            +
            - spec/custom_tags_spec.rb
         | 
| 231 | 
            +
            - spec/erb_spec.rb
         | 
| 232 | 
            +
            - spec/extension_spec.rb
         | 
| 233 | 
            +
            - spec/fixtures/basic.yml
         | 
| 234 | 
            +
            - spec/fixtures/code.yml
         | 
| 235 | 
            +
            - spec/fixtures/definitions.yml
         | 
| 236 | 
            +
            - spec/fixtures/extra_whitespace.yml
         | 
| 237 | 
            +
            - spec/fixtures/filter_html.yml
         | 
| 238 | 
            +
            - spec/fixtures/filter_pba.yml
         | 
| 239 | 
            +
            - spec/fixtures/html.yml
         | 
| 240 | 
            +
            - spec/fixtures/images.yml
         | 
| 241 | 
            +
            - spec/fixtures/instiki.yml
         | 
| 242 | 
            +
            - spec/fixtures/links.yml
         | 
| 243 | 
            +
            - spec/fixtures/lists.yml
         | 
| 244 | 
            +
            - spec/fixtures/poignant.yml
         | 
| 245 | 
            +
            - spec/fixtures/sanitize_html.yml
         | 
| 246 | 
            +
            - spec/fixtures/table.yml
         | 
| 247 | 
            +
            - spec/fixtures/textism.yml
         | 
| 248 | 
            +
            - spec/fixtures/threshold.yml
         | 
| 249 | 
            +
            - spec/formatters/class_filtered_html_spec.rb
         | 
| 250 | 
            +
            - spec/formatters/filtered_html_spec.rb
         | 
| 251 | 
            +
            - spec/formatters/html_no_breaks_spec.rb
         | 
| 252 | 
            +
            - spec/formatters/html_spec.rb
         | 
| 253 | 
            +
            - spec/formatters/id_filtered_html_spec.rb
         | 
| 254 | 
            +
            - spec/formatters/latex_spec.rb
         | 
| 255 | 
            +
            - spec/formatters/lite_mode_html_spec.rb
         | 
| 256 | 
            +
            - spec/formatters/no_span_caps_html_spec.rb
         | 
| 257 | 
            +
            - spec/formatters/sanitized_html_spec.rb
         | 
| 258 | 
            +
            - spec/formatters/style_filtered_html_spec.rb
         | 
| 259 | 
            +
            - spec/parser_spec.rb
         | 
| 260 | 
            +
            - spec/spec_helper.rb
         | 
    
        data/.gitignore
    DELETED
    
    | @@ -1,26 +0,0 @@ | |
| 1 | 
            -
            *.log
         | 
| 2 | 
            -
            *.rbc
         | 
| 3 | 
            -
            *.sw?
         | 
| 4 | 
            -
            .bundle
         | 
| 5 | 
            -
            .DS_Store
         | 
| 6 | 
            -
            coverage
         | 
| 7 | 
            -
            doc/rdoc/*
         | 
| 8 | 
            -
            ext/redcloth_scan/*.bundle
         | 
| 9 | 
            -
            ext/redcloth_scan/*.class
         | 
| 10 | 
            -
            ext/redcloth_scan/*.jar
         | 
| 11 | 
            -
            ext/redcloth_scan/*.java
         | 
| 12 | 
            -
            ext/redcloth_scan/*.so
         | 
| 13 | 
            -
            ext/redcloth_scan/*.[co]
         | 
| 14 | 
            -
            ext/redcloth_scan/extconf.rb
         | 
| 15 | 
            -
            ext/redcloth_scan/Makefile
         | 
| 16 | 
            -
            ext/redcloth_scan/redcloth_*.rb
         | 
| 17 | 
            -
            lib/*.bundle
         | 
| 18 | 
            -
            lib/*.jar
         | 
| 19 | 
            -
            lib/*.so
         | 
| 20 | 
            -
            lib/**/*.so
         | 
| 21 | 
            -
            lib/redcloth_scan.rb
         | 
| 22 | 
            -
            pkg
         | 
| 23 | 
            -
            rdoc
         | 
| 24 | 
            -
            release
         | 
| 25 | 
            -
            tmp
         | 
| 26 | 
            -
            Gemfile.lock
         | 
    
        data/test/ragel_profiler.rb
    DELETED
    
    | @@ -1,73 +0,0 @@ | |
| 1 | 
            -
            class RagelProfiler
         | 
| 2 | 
            -
              MEM_CONVERSION = 1024
         | 
| 3 | 
            -
              
         | 
| 4 | 
            -
              COMMANDS =  { :compile => %w(ragel rlgen-cd gcc-4.0 gnumake cc1),
         | 
| 5 | 
            -
                            :test    => %w(ruby) }
         | 
| 6 | 
            -
                            
         | 
| 7 | 
            -
              FIELDS = %w(compile_time compile_max_rss test_time test_max_rss file_size)
         | 
| 8 | 
            -
                            
         | 
| 9 | 
            -
              @@results = {}
         | 
| 10 | 
            -
             | 
| 11 | 
            -
              def initialize(name)
         | 
| 12 | 
            -
                @name = name
         | 
| 13 | 
            -
                @@results[name] = []
         | 
| 14 | 
            -
              end
         | 
| 15 | 
            -
              
         | 
| 16 | 
            -
              def measure(type)
         | 
| 17 | 
            -
                raise "not a valid type" unless COMMANDS.keys.include?(type)
         | 
| 18 | 
            -
                regex = COMMANDS[type].map {|c| Regexp.escape(c) }.join("|")
         | 
| 19 | 
            -
                t = Thread.new do
         | 
| 20 | 
            -
                  Thread.current[:max] = 0
         | 
| 21 | 
            -
                  loop do
         | 
| 22 | 
            -
                    Thread.current[:max] = [run(regex), Thread.current[:max]].max
         | 
| 23 | 
            -
                    sleep 0.5
         | 
| 24 | 
            -
                  end
         | 
| 25 | 
            -
                end
         | 
| 26 | 
            -
                begin_time = Time.now
         | 
| 27 | 
            -
                yield
         | 
| 28 | 
            -
                total_time = Time.now - begin_time
         | 
| 29 | 
            -
             | 
| 30 | 
            -
                t.kill
         | 
| 31 | 
            -
                store_result(type, "time", total_time)
         | 
| 32 | 
            -
                store_result(type, "max_rss", t[:max])
         | 
| 33 | 
            -
              end
         | 
| 34 | 
            -
              
         | 
| 35 | 
            -
              def ext_size(file)
         | 
| 36 | 
            -
                store_result(:file, "size", File.size(file) / MEM_CONVERSION)
         | 
| 37 | 
            -
              end
         | 
| 38 | 
            -
              
         | 
| 39 | 
            -
              def self.results
         | 
| 40 | 
            -
                out = []
         | 
| 41 | 
            -
                out << "name\t" + FIELDS.join("\t")
         | 
| 42 | 
            -
                @@results.each do |name, results|
         | 
| 43 | 
            -
                  out << [name, results ].flatten.join("\t")
         | 
| 44 | 
            -
                end
         | 
| 45 | 
            -
                out.join("\n")
         | 
| 46 | 
            -
              end
         | 
| 47 | 
            -
              
         | 
| 48 | 
            -
              private
         | 
| 49 | 
            -
              
         | 
| 50 | 
            -
              def store_result(type, metric, value)
         | 
| 51 | 
            -
                index = FIELDS.index("#{type.to_s}_#{metric}")
         | 
| 52 | 
            -
                @@results[@name][index] = "%.2f" % value
         | 
| 53 | 
            -
              end
         | 
| 54 | 
            -
              
         | 
| 55 | 
            -
              def run(ps_regex)
         | 
| 56 | 
            -
                ps_command   = "ps axucww"
         | 
| 57 | 
            -
                ps_output    = `#{ps_command}`
         | 
| 58 | 
            -
                fields       = ps_output.to_a.first.downcase.split
         | 
| 59 | 
            -
                memory_index = fields.index("rss")
         | 
| 60 | 
            -
                pid_index    = fields.index("pid")
         | 
| 61 | 
            -
                ppid_index   = fields.index("ppid")
         | 
| 62 | 
            -
                total        = ps_output.grep(/(#{ps_regex})\s+$/i).map do |com|
         | 
| 63 | 
            -
                                 Float(com.split[memory_index]).abs
         | 
| 64 | 
            -
                               end.inject(0) { |s,v| s += v }
         | 
| 65 | 
            -
                if total
         | 
| 66 | 
            -
                  return total/MEM_CONVERSION
         | 
| 67 | 
            -
                else
         | 
| 68 | 
            -
                  STDERR.puts "Command not found. No processes found matching #{ps_regex}."
         | 
| 69 | 
            -
                end
         | 
| 70 | 
            -
             | 
| 71 | 
            -
              end
         | 
| 72 | 
            -
             | 
| 73 | 
            -
            end
         | 
    
        data/test/validate_fixtures.rb
    DELETED
    
    | @@ -1,74 +0,0 @@ | |
| 1 | 
            -
            #!/usr/bin/env ruby
         | 
| 2 | 
            -
             | 
| 3 | 
            -
            require File.join(File.dirname(__FILE__), 'helper')
         | 
| 4 | 
            -
             | 
| 5 | 
            -
            require 'erb'
         | 
| 6 | 
            -
            require 'w3c_validators'
         | 
| 7 | 
            -
             | 
| 8 | 
            -
            class ValidateFixtures < Test::Unit::TestCase
         | 
| 9 | 
            -
              include W3CValidators
         | 
| 10 | 
            -
             | 
| 11 | 
            -
              def setup
         | 
| 12 | 
            -
                @v = MarkupValidator.new
         | 
| 13 | 
            -
                sleep 1 # delay per WC3 request
         | 
| 14 | 
            -
              end
         | 
| 15 | 
            -
             | 
| 16 | 
            -
              HTML_4_0_TEMPLATE = <<EOD
         | 
| 17 | 
            -
            <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
         | 
| 18 | 
            -
            <html>
         | 
| 19 | 
            -
            <head>
         | 
| 20 | 
            -
            	<title><%= test_name %></title>
         | 
| 21 | 
            -
            </head>
         | 
| 22 | 
            -
            <body>
         | 
| 23 | 
            -
            <%= content %>
         | 
| 24 | 
            -
            </body>
         | 
| 25 | 
            -
            </html>
         | 
| 26 | 
            -
            EOD
         | 
| 27 | 
            -
              XHTML_1_0_TEMPLATE = <<EOD
         | 
| 28 | 
            -
            <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
         | 
| 29 | 
            -
            	"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
         | 
| 30 | 
            -
            <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
         | 
| 31 | 
            -
            <head>
         | 
| 32 | 
            -
            <title><%= test_name %></title>
         | 
| 33 | 
            -
            </head>
         | 
| 34 | 
            -
            <body>
         | 
| 35 | 
            -
            <%= content %>
         | 
| 36 | 
            -
            </body>
         | 
| 37 | 
            -
            </html>
         | 
| 38 | 
            -
            EOD
         | 
| 39 | 
            -
              
         | 
| 40 | 
            -
              fixtures.each do |name, doc|
         | 
| 41 | 
            -
               if doc['html'] && (doc['valid_html'].nil? || doc['valid_html'])
         | 
| 42 | 
            -
                 define_method("test_html_output_validity_of_#{name}") do
         | 
| 43 | 
            -
                   assert_produces_valid_html(name, doc['html'])
         | 
| 44 | 
            -
                 end
         | 
| 45 | 
            -
                 define_method("test_xhtml_output_validity_of_#{name}") do
         | 
| 46 | 
            -
                   assert_produces_valid_xhtml(name, doc['html'])
         | 
| 47 | 
            -
                 end
         | 
| 48 | 
            -
               end
         | 
| 49 | 
            -
              end
         | 
| 50 | 
            -
              
         | 
| 51 | 
            -
              private
         | 
| 52 | 
            -
              def assert_produces_valid_html(test_name, content)
         | 
| 53 | 
            -
                body = ERB.new(HTML_4_0_TEMPLATE, nil,'-%').result(binding)    
         | 
| 54 | 
            -
                assert_validates(body)
         | 
| 55 | 
            -
              end
         | 
| 56 | 
            -
             | 
| 57 | 
            -
              def assert_produces_valid_xhtml(test_name, content)
         | 
| 58 | 
            -
                body = ERB.new(XHTML_1_0_TEMPLATE, nil,'-%').result(binding)    
         | 
| 59 | 
            -
                assert_validates(body)
         | 
| 60 | 
            -
              end
         | 
| 61 | 
            -
              
         | 
| 62 | 
            -
              def assert_validates(body)
         | 
| 63 | 
            -
                results = @v.validate_text(body)
         | 
| 64 | 
            -
                errors = results.errors
         | 
| 65 | 
            -
                warnings = results.warnings.reject {|w| w.message_id == "247" } # NET-enabling start-tag requires SHORTTAG YES.
         | 
| 66 | 
            -
                
         | 
| 67 | 
            -
                assert(errors.empty?, "Validator errors: \n" +
         | 
| 68 | 
            -
                  errors.collect {|e| "'#{e.to_s}'"}.join("\n"))
         | 
| 69 | 
            -
                
         | 
| 70 | 
            -
                assert(warnings.empty?, "Validator warnings: \n" +
         | 
| 71 | 
            -
                  warnings.collect {|w| "'#{w.to_s}'"}.join("\n"))
         | 
| 72 | 
            -
              end
         | 
| 73 | 
            -
              
         | 
| 74 | 
            -
            end
         |