Sha256: 3733ae3c9e5decb649019a2445f17c38b1e2da61e4b2354d46fcef158c24bc8f

Contents?: true

Size: 494 Bytes

Versions: 9

Compression:

Stored size: 494 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
          add_issue(desc, :subject => filename)
        end
      end
    end

  end

end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
nanoc-3.7.4 lib/nanoc/extra/checking/checks/css.rb
nanoc-3.7.3 lib/nanoc/extra/checking/checks/css.rb
nanoc-3.7.2 lib/nanoc/extra/checking/checks/css.rb
nanoc-3.7.1 lib/nanoc/extra/checking/checks/css.rb
nanoc-3.7.0 lib/nanoc/extra/checking/checks/css.rb
nanoc-3.6.11 lib/nanoc/extra/checking/checks/css.rb
nanoc-3.6.10 lib/nanoc/extra/checking/checks/css.rb
nanoc-3.6.9 lib/nanoc/extra/checking/checks/css.rb
nanoc-3.6.8 lib/nanoc/extra/checking/checks/css.rb