Permalink
Browse files

Tried and failed to upgrade the validator to understand css3.

  • Loading branch information...
1 parent cb764a8 commit 7dfd1fcda58efb54dffb6a339b9ac537c3a23e34 @chriseppstein committed Oct 30, 2010
View
@@ -1,4 +1,4 @@
---
-:major: 1
+:major: 3
:minor: 0
:patch: 0
View
@@ -0,0 +1,4 @@
+#!/usr/bin/env ruby
+require 'compass'
+require 'compass-validator'
+Compass::Validator.new(*ARGV).validate
View
@@ -5,11 +5,11 @@
Gem::Specification.new do |s|
s.name = %q{compass-validator}
- s.version = "1.0.0"
+ s.version = "3.0.0"
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
s.authors = ["Chris Eppstein"]
- s.date = %q{2010-04-05}
+ s.date = %q{2010-10-30}
s.email = %q{chris@eppsteins.net}
s.extra_rdoc_files = [
"LICENSE",
@@ -28,19 +28,20 @@ Gem::Specification.new do |s|
"lib/java_validator/css-validator-javadoc.jar",
"lib/java_validator/css-validator.jar",
"lib/java_validator/jigsaw.jar",
- "lib/java_validator/xerces.jar"
+ "lib/java_validator/xerces.jar",
+ "lib/jigsaw.jar"
]
s.homepage = %q{http://github.com/chriseppstein/compass-validator}
s.rdoc_options = ["--charset=UTF-8"]
s.require_paths = ["lib"]
- s.rubygems_version = %q{1.3.6}
+ s.rubygems_version = %q{1.3.7}
s.summary = %q{A CSS Validator that is used by the Compass CSS Framework.}
if s.respond_to? :specification_version then
current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
s.specification_version = 3
- if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
+ if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
else
end
else
View
@@ -4,7 +4,8 @@
module Compass
# Validates generated CSS against the W3 using Java
class Validator
- VALIDATOR_FILE = File.join(File.dirname(__FILE__), 'java_validator', 'css-validator.jar')
+ VALIDATOR_DIR = File.join(File.dirname(__FILE__), 'java_validator')
+ VALIDATOR_FILE = File.join(VALIDATOR_DIR, 'css-validator.jar')
attr_reader :error_count
attr_reader :css_directory
@@ -30,8 +31,11 @@ def validate
private
def validate_css_file(java_path, css_file)
puts "\n\nTesting #{css_file}"
+ jars = Dir.glob("#{VALIDATOR_DIR}/*.jar") - [VALIDATOR_FILE]
+ cmd = "#{java_path} -jar '#{VALIDATOR_FILE}' -classpath '#{jars.join(File::PATH_SEPARATOR)}' -e '#{css_file}'"
+ puts "Running: #{cmd}\n"
puts "Output ============================================================\n\n"
- system("#{java_path} -jar '#{VALIDATOR_FILE}' -e '#{css_file}'")
+ system("#{java_path} -jar '#{VALIDATOR_FILE}' -classpath '#{Dir.glob("#{VALIDATOR_DIR}/*.jar").join(":")}' -e '#{css_file}'")
end
def output_header
Binary file not shown.

0 comments on commit 7dfd1fc

Please sign in to comment.