Release Name: 1.1.0
Notes:
Bug fixes and minor updates.
Changes:
* added #putc to Win32::Console::ANSI::IO
This putc buffers escape sequences so that they will be handled properly
*added Kernel#putc
Redefined Kernel#putc to wrap Win32::Console::ANSI::IO#putc
*added #redirected? to Win32::Console::ANSI::IO
Checks the mode of the console to see if IO is being redirected or not
* fixed "Invalid Handle" error in compiled version of GetConsoleMode
I'm actually not sure of the source of this error. It may be expected behavior when output is being redirected. I worked around it by rescuing the exception in Win32::Console#Mode and returning 9999. I picked that arbitrary value, because it is higher than 31, which is what I think is the highest value Mode would return if output isn't being redirected.
* modified Win32::Console::ANSI::IO#write
to check for redirection. If output is redirected, it uses WriteFile instead of WriteConosle. It also skips the parsing step, and passes the escape sequences through.
* added Win32::Console::API#WriteFile
to both the Ruby and compiled versions
* added Win32::Console*WriteFile
This is a wrapper around Win32::Console::API#WriteFile
* modified Win32::Console::ANSI::IO#_PrintString
Didn't change behavior, just tried to make it more idiomatic ruby. I didn't make all of the changes I wanted to, because I wasn't sure how to test them all.
* split Win32::Console::Constants and Win32::Console::API out into seperate files.
These two classes were in 'Win32/Console.rb' I moved them into 'Win32/Console/constants.rb' and 'Win32/Console/api.rb' respectively.
* cleaned up indentation
indentations was a mixture of tabs and spaces. I made everything indented with 2 spaces.
* modified all Win32::Console::API methods
It was assigning Win32API functions to class variables. I switched them to instance variables. I also changed the idiom it was using to instantiate the objects.
For instance, instead of:
if @@m_AllocConsole == nil
@@m_AllocConsole = Win32API.new( "kernel32", "AllocConsole",
[], 'l' )
It is now:
@AllocConsole ||= Win32API.new( "kernel32", "AllocConsole", [], 'l' )
* Non-string arguments passed to Win32::Console::ANSI#write caused error - fixed.
|