Skip to content

Instantly share code, notes, and snippets.

@Capncavedan
Created May 16, 2012 13:32
Show Gist options
  • Select an option

  • Save Capncavedan/2710353 to your computer and use it in GitHub Desktop.

Select an option

Save Capncavedan/2710353 to your computer and use it in GitHub Desktop.
Ruby CSS validator
require 'rubygems'
require 'w3c_validators'
validator = W3CValidators::CSSValidator.new
validator.set_profile!(:css2)
fp = '/path/to/cssfile.css'
results = validator.validate_file(fp)
puts results.errors
puts results.warnings.size
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment