Release Name: 1.2.0
Notes:
This new release of win32console includes several fixed provided by the community.
Please check the changelog for the introduced fixes.
Both mswin32 and mingw32 platforms of this gem has been included.
Further development can be tracked at GitHub:
http://github.com/luislavena/win32console/tree
Changes:
1.2.0 - Code corrections integrated from GitHub
* Removed license conflicting ANSI Term code and functionality.
* Better code organization and clenaup
1.1.0 - Bug fixes provided by Gordon Thiesfeld (gthiesfeld at gmail dot com).
* 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 - fix by Ivan Evtuhovich (evtuhovich at gmail dot com).
|