lib/nanoc3/cli/logger.rb in nanoc3-3.0.9 vs lib/nanoc3/cli/logger.rb in nanoc3-3.1.0a1
- old
+ new
@@ -27,9 +27,16 @@
alias_method :color?, :color
def initialize
@level = :high
@color = true
+
+ # Try enabling color support on Windows
+ begin
+ require 'Win32/Console/ANSI' if RUBY_PLATFORM =~/mswin|mingw/
+ rescue LoadError
+ warn 'The win32console gem is not available. Install it to enable color support on Windows.'
+ end
end
# Logs a file-related action.
#
# +level+:: The importance of this action. Can be :high or :low.