Sha256: 5b85a20253cde12f1d2a4962ccdd2108ae56ff3b6125770e63818b9ca46e2600

Contents?: true

Size: 502 Bytes

Versions: 11

Compression:

Stored size: 502 Bytes

Contents

# encoding: utf-8   

module ::Nanoc::Extra::Checking::Checks

  class CSS < ::Nanoc::Extra::Checking::Check

    identifier :css

    def run
      require 'w3c_validators'

      Dir[site.config[:output_dir] + '/**/*.css'].each do |filename|
        results = ::W3CValidators::CSSValidator.new.validate_file(filename)
        results.errors.each do |e|
          desc = e.message.gsub(%r{\s+}, ' ').strip
          self.add_issue(desc, :subject => filename)
        end
      end
    end

  end

end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
nanoc-3.6.7 lib/nanoc/extra/checking/checks/css.rb
nanoc-3.6.6 lib/nanoc/extra/checking/checks/css.rb
nanoc-3.6.5 lib/nanoc/extra/checking/checks/css.rb
nanoc-3.6.4 lib/nanoc/extra/checking/checks/css.rb
nanoc-3.6.3 lib/nanoc/extra/checking/checks/css.rb
nanoc-3.6.2 lib/nanoc/extra/checking/checks/css.rb
nanoc-3.6.1 lib/nanoc/extra/checking/checks/css.rb
nanoc-3.6.0 lib/nanoc/extra/checking/checks/css.rb
nanoc-3.5.0 lib/nanoc/extra/checking/checks/css.rb
nanoc-3.5.0b2 lib/nanoc/extra/checking/checks/css.rb
nanoc-3.5.0b1 lib/nanoc/extra/checking/checks/css.rb