Skip to content

Commit

Permalink
Tried and failed to upgrade the validator to understand css3.
Browse files Browse the repository at this point in the history
  • Loading branch information
chriseppstein committed Oct 30, 2010
1 parent cb764a8 commit 7dfd1fc
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 8 deletions.
2 changes: 1 addition & 1 deletion VERSION.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
---
:major: 1
:major: 3
:minor: 0
:patch: 0
4 changes: 4 additions & 0 deletions bin/compass-validate
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/usr/bin/env ruby
require 'compass'
require 'compass-validator'
Compass::Validator.new(*ARGV).validate
11 changes: 6 additions & 5 deletions compass-validator.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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
Expand Down
8 changes: 6 additions & 2 deletions lib/compass-validator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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
Expand Down
Binary file modified lib/java_validator/css-validator.jar
Binary file not shown.

0 comments on commit 7dfd1fc

Please sign in to comment.