[Command Line] [Windows] Disable colorized output if win32console cannot be loaded.

Closes GH-82
This commit is contained in:
Chris Eppstein 2010-02-13 17:44:49 -08:00
parent 6b5ffdb0d6
commit 3dd2a90dec
2 changed files with 10 additions and 2 deletions

View File

@ -6,7 +6,11 @@ require 'compass/actions'
require 'compass/installers'
require 'compass/commands'
require 'rbconfig'
begin
require 'win32console' if RbConfig::CONFIG['host_os'] =~ /mswin|mingw/
rescue LoadError
$boring = true
end
module Compass::Exec
end

View File

@ -46,7 +46,11 @@ module Compass
def color(c)
if Compass.configuration.color_output && c && COLORS.has_key?(c.to_sym)
if defined?($boring) && $boring
""
else
"\e[#{COLORS[c.to_sym]}m"
end
else
""
end