[Rspec-devel] --colour : Windows complications

DeeJay smartgpx at gmail.com
Fri Sep 8 09:57:22 EDT 2006


"  It looks like

STDOUT.puts
and
puts

Don't behave the same way with win32console . "

I'm slower on the uptake, but had reached a similar conclusion, demonstrated
here -

===


require 'Win32/Console/ANSI'

@works = $stdout
@works << "\e[31m" << "RED" << "\e[32m" << "GREEN" << "\e[0m" << "normal" <<
"\n"
@fails = STDOUT
@fails << "\e[31m" << "RED" << "\e[32m" << "GREEN" << "\e[0m" << "normal" <<
"\n"


===


Changing the default output stream from STDOUT to $stdout breaks other
things, but doesn't fix this.

Looking in the win32console library, at the end of ../Win32/Console/ANSI.rb,
it is a new $stdout that
gets returned, which is an  IO with its own  'write' method. So it seems
STDOUT << 'string' doesn't
go through win32console at all.

DeeJay
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://rubyforge.org/pipermail/rspec-devel/attachments/20060908/52f08d84/attachment-0001.html 


More information about the Rspec-devel mailing list