using windows32console gem for colors
This commit is contained in:
@@ -107,7 +107,9 @@ module EdgeCase
|
||||
def use_colors?
|
||||
return false if ENV['NO_COLOR']
|
||||
if ENV['ANSI_COLOR'].nil?
|
||||
! using_windows?
|
||||
if using_windows?
|
||||
using_win32console
|
||||
end
|
||||
else
|
||||
ENV['ANSI_COLOR'] =~ /^(t|y)/i
|
||||
end
|
||||
@@ -116,6 +118,13 @@ module EdgeCase
|
||||
def using_windows?
|
||||
File::ALT_SEPARATOR
|
||||
end
|
||||
def using_win32console
|
||||
begin
|
||||
!! Win32::Console::ANSI
|
||||
rescue
|
||||
return false
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
class Sensei
|
||||
|
||||
Reference in New Issue
Block a user