diff --git a/lib/compass-validator.rb b/lib/compass-validator.rb index c8701f4..e9e2df9 100644 --- a/lib/compass-validator.rb +++ b/lib/compass-validator.rb @@ -1,5 +1,6 @@ # This file was extracted from the blueprint project and then modified. require "open3" +require "rbconfig" module Compass # Validates generated CSS against the W3 using Java @@ -28,7 +29,14 @@ def self.execute(*directories) # Validates all three CSS files def validate - java_path = `which java`.rstrip + if (!(RbConfig::CONFIG['host_os'] =~ /mswin|mingw|cygwin/)) + java_path = `which java`.rstrip + else + java_path = `where java`.rstrip + if (!java_path || java_path.empty?) + java_path = `WHERE /R C:\\ java`.rstrip + end + end raise "You do not have a Java installed, but it is required." unless java_path && !java_path.empty? Dir.glob(File.join(css_directory, "**", "*.css")).each do |file_name| @@ -87,4 +95,4 @@ def output_results end end end -end \ No newline at end of file +end