Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions lib/compass-validator.rb
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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|
Expand Down Expand Up @@ -87,4 +95,4 @@ def output_results
end
end
end
end
end