bin/oct in oct-0.1.0 vs bin/oct in oct-0.2.0
- old
+ new
@@ -1,9 +1,10 @@
#!/usr/bin/env ruby
$:.unshift(File.dirname(__FILE__) + '/../lib')
+require 'rubygems'
require 'oct'
require 'optparse'
require 'term/ansicolor'
available_actions = Oct::AVAILABLE_ACTIONS
@@ -63,9 +64,19 @@
end
if STDOUT.isatty
Term::ANSIColor::coloring = options[:coloring]
+
+ if options[:coloring] && Oct::WINDOWS
+ begin
+ require 'Win32/Console/ANSI'
+ rescue LoadError
+ Term::ANSIColor::coloring = false
+ STDERR.puts 'WARNING: You must "gem install win32console" (1.2.0 or higher) to get color output on MRI/Windows'
+ end
+ end
+
else
Term::ANSIColor::coloring = false
end
app = Oct::App.new(FileUtils.pwd, options)