Sha256: 31430bdcd71b53f621df1c1605e7c7982b326bae795ae71f5b706917acd8d08d
Contents?: true
Size: 673 Bytes
Versions: 19
Compression:
Stored size: 673 Bytes
Contents
module ::Nanoc::Extra::Checking::Checks # @api private class CSS < ::Nanoc::Extra::Checking::Check identifier :css def run require 'w3c_validators' Dir[@config[:output_dir] + '/**/*.css'].each do |filename| results = ::W3CValidators::CSSValidator.new.validate_file(filename) lines = File.readlines(filename) results.errors.each do |e| line_num = e.line.to_i - 1 line = lines[line_num] message = e.message.gsub(%r{\s+}, ' ').strip.sub(/\s+:$/, '') desc = "line #{line_num + 1}: #{message}: #{line}" add_issue(desc, subject: filename) end end end end end
Version data entries
19 entries across 19 versions & 1 rubygems