Skip to content

Instantly share code, notes, and snippets.

@lboulard
Created August 26, 2010 13:32
Show Gist options
  • Save lboulard/551383 to your computer and use it in GitHub Desktop.
Save lboulard/551383 to your computer and use it in GitHub Desktop.
--- lib/Win32/Console/ANSI.rb~ Thu Aug 26 15:09:18 2010
+++ lib/Win32/Console/ANSI.rb Thu Aug 26 15:27:17 2010
@@ -132,7 +132,7 @@
# For Ruby applications, this means requiring Win32Conole again.
def write(*s)
if redirected?
- s.each{ |x| @Out.WriteFile(x.dup.to_s) }
+ s.each{ |x| @Out.WriteFile(x.to_s.dup) }
else
s.each{ |x| _PrintString(x) }
end
@@ -146,7 +146,7 @@
private
def _PrintString(t)
- s = t.dup.to_s
+ s = t.to_s.dup
while s != ''
if s.sub!( /([^\e]*)?\e([\[\(])([0-9\;\=]*)([a-zA-Z@])(.*)/, '\5')
@Out.Write((_conv("#$1")))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment