win32console 1.0.8-i386-mswin32 → 1.1.0-i386-mswin32
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/Console.cpp +15 -0
- data/HISTORY_GEM.txt +34 -0
- data/README.txt +0 -1
- data/{lib/README_GEM.txt → README_GEM.txt} +1 -1
- data/Rakefile +5 -5
- data/lib/Console.so +0 -0
- data/lib/Win32/Console/ANSI.rb +283 -240
- data/lib/Win32/Console/api.rb +342 -0
- data/lib/Win32/Console/constants.rb +66 -0
- data/lib/Win32/Console.rb +77 -675
- metadata +10 -114
- data/doc/classes/Win32/Console/ANSI/IO.html +0 -220
- data/doc/classes/Win32/Console/ANSI/IO.src/M000035.html +0 -32
- data/doc/classes/Win32/Console/ANSI/IO.src/M000036.html +0 -205
- data/doc/classes/Win32/Console/ANSI/IO.src/M000037.html +0 -40
- data/doc/classes/Win32/Console/ANSI/IO.src/M000038.html +0 -25
- data/doc/classes/Win32/Console/ANSI.html +0 -103
- data/doc/classes/Win32/Console/API.html +0 -758
- data/doc/classes/Win32/Console/API.src/M000039.html +0 -27
- data/doc/classes/Win32/Console/API.src/M000040.html +0 -27
- data/doc/classes/Win32/Console/API.src/M000041.html +0 -27
- data/doc/classes/Win32/Console/API.src/M000042.html +0 -32
- data/doc/classes/Win32/Console/API.src/M000043.html +0 -32
- data/doc/classes/Win32/Console/API.src/M000044.html +0 -28
- data/doc/classes/Win32/Console/API.src/M000045.html +0 -26
- data/doc/classes/Win32/Console/API.src/M000046.html +0 -26
- data/doc/classes/Win32/Console/API.src/M000047.html +0 -27
- data/doc/classes/Win32/Console/API.src/M000048.html +0 -30
- data/doc/classes/Win32/Console/API.src/M000049.html +0 -29
- data/doc/classes/Win32/Console/API.src/M000050.html +0 -27
- data/doc/classes/Win32/Console/API.src/M000051.html +0 -28
- data/doc/classes/Win32/Console/API.src/M000052.html +0 -30
- data/doc/classes/Win32/Console/API.src/M000053.html +0 -27
- data/doc/classes/Win32/Console/API.src/M000054.html +0 -29
- data/doc/classes/Win32/Console/API.src/M000055.html +0 -29
- data/doc/classes/Win32/Console/API.src/M000056.html +0 -28
- data/doc/classes/Win32/Console/API.src/M000057.html +0 -27
- data/doc/classes/Win32/Console/API.src/M000058.html +0 -47
- data/doc/classes/Win32/Console/API.src/M000059.html +0 -32
- data/doc/classes/Win32/Console/API.src/M000060.html +0 -47
- data/doc/classes/Win32/Console/API.src/M000061.html +0 -34
- data/doc/classes/Win32/Console/API.src/M000062.html +0 -32
- data/doc/classes/Win32/Console/API.src/M000063.html +0 -32
- data/doc/classes/Win32/Console/API.src/M000064.html +0 -35
- data/doc/classes/Win32/Console/API.src/M000065.html +0 -26
- data/doc/classes/Win32/Console/API.src/M000066.html +0 -27
- data/doc/classes/Win32/Console/API.src/M000067.html +0 -29
- data/doc/classes/Win32/Console/API.src/M000068.html +0 -27
- data/doc/classes/Win32/Console/API.src/M000069.html +0 -27
- data/doc/classes/Win32/Console/API.src/M000070.html +0 -28
- data/doc/classes/Win32/Console/API.src/M000071.html +0 -27
- data/doc/classes/Win32/Console/API.src/M000072.html +0 -26
- data/doc/classes/Win32/Console/API.src/M000073.html +0 -27
- data/doc/classes/Win32/Console/API.src/M000074.html +0 -31
- data/doc/classes/Win32/Console/API.src/M000075.html +0 -27
- data/doc/classes/Win32/Console/API.src/M000076.html +0 -32
- data/doc/classes/Win32/Console/API.src/M000077.html +0 -27
- data/doc/classes/Win32/Console/API.src/M000078.html +0 -32
- data/doc/classes/Win32/Console/API.src/M000079.html +0 -32
- data/doc/classes/Win32/Console/API.src/M000080.html +0 -32
- data/doc/classes/Win32/Console/Constants.html +0 -360
- data/doc/classes/Win32/Console.html +0 -650
- data/doc/classes/Win32/Console.src/M000001.html +0 -31
- data/doc/classes/Win32/Console.src/M000002.html +0 -23
- data/doc/classes/Win32/Console.src/M000003.html +0 -23
- data/doc/classes/Win32/Console.src/M000004.html +0 -27
- data/doc/classes/Win32/Console.src/M000005.html +0 -23
- data/doc/classes/Win32/Console.src/M000006.html +0 -28
- data/doc/classes/Win32/Console.src/M000007.html +0 -23
- data/doc/classes/Win32/Console.src/M000008.html +0 -24
- data/doc/classes/Win32/Console.src/M000009.html +0 -44
- data/doc/classes/Win32/Console.src/M000010.html +0 -23
- data/doc/classes/Win32/Console.src/M000011.html +0 -33
- data/doc/classes/Win32/Console.src/M000012.html +0 -26
- data/doc/classes/Win32/Console.src/M000013.html +0 -27
- data/doc/classes/Win32/Console.src/M000014.html +0 -28
- data/doc/classes/Win32/Console.src/M000015.html +0 -23
- data/doc/classes/Win32/Console.src/M000016.html +0 -23
- data/doc/classes/Win32/Console.src/M000017.html +0 -23
- data/doc/classes/Win32/Console.src/M000018.html +0 -29
- data/doc/classes/Win32/Console.src/M000019.html +0 -23
- data/doc/classes/Win32/Console.src/M000020.html +0 -23
- data/doc/classes/Win32/Console.src/M000021.html +0 -28
- data/doc/classes/Win32/Console.src/M000022.html +0 -23
- data/doc/classes/Win32/Console.src/M000023.html +0 -28
- data/doc/classes/Win32/Console.src/M000024.html +0 -35
- data/doc/classes/Win32/Console.src/M000025.html +0 -28
- data/doc/classes/Win32/Console.src/M000026.html +0 -28
- data/doc/classes/Win32/Console.src/M000027.html +0 -28
- data/doc/classes/Win32/Console.src/M000028.html +0 -31
- data/doc/classes/Win32/Console.src/M000029.html +0 -23
- data/doc/classes/Win32/Console.src/M000030.html +0 -23
- data/doc/classes/Win32/Console.src/M000031.html +0 -23
- data/doc/classes/Win32/Console.src/M000032.html +0 -27
- data/doc/classes/Win32/Console.src/M000033.html +0 -27
- data/doc/classes/Win32/Console.src/M000034.html +0 -25
- data/doc/classes/Win32.html +0 -115
- data/doc/created.rid +0 -1
- data/doc/files/Console_ANSI_rdoc.html +0 -407
- data/doc/files/Console_cpp.html +0 -104
- data/doc/files/Console_rdoc.html +0 -964
- data/doc/files/lib/Win32/Console/ANSI_rb.html +0 -123
- data/doc/files/lib/Win32/Console_rb.html +0 -297
- data/doc/fr_class_index.html +0 -32
- data/doc/fr_file_index.html +0 -31
- data/doc/fr_method_index.html +0 -106
- data/doc/index.html +0 -24
- data/doc/rdoc-style.css +0 -172
data/Console.cpp
CHANGED
@@ -215,6 +215,20 @@ static VALUE rb_WriteConsole( VALUE self, VALUE hConsoleOutput,
|
|
215
215
|
return UINT2NUM( lpNumberOfCharsWritten );
|
216
216
|
}
|
217
217
|
|
218
|
+
static VALUE rb_WriteFile( VALUE self, VALUE hConsoleOutput,
|
219
|
+
VALUE lpBuffer )
|
220
|
+
{
|
221
|
+
HANDLE handle = ULongToPtr( NUM2ULONG( hConsoleOutput ) );
|
222
|
+
DWORD nNumberOfBytesToWrite = RSTRING(lpBuffer)->len;
|
223
|
+
|
224
|
+
DWORD lpNumberOfBytesWritten;
|
225
|
+
|
226
|
+
WriteFile( handle, RSTRING(lpBuffer)->ptr,
|
227
|
+
nNumberOfBytesToWrite,
|
228
|
+
&lpNumberOfBytesWritten, NULL );
|
229
|
+
return UINT2NUM( lpNumberOfBytesWritten );
|
230
|
+
}
|
231
|
+
|
218
232
|
|
219
233
|
static VALUE rb_GetLargestConsoleWindowSize( VALUE self, VALUE hConsoleOutput )
|
220
234
|
{
|
@@ -1192,6 +1206,7 @@ Init_Console(void)
|
|
1192
1206
|
RB_DEF_API_METHOD(SetStdHandle, 2);
|
1193
1207
|
|
1194
1208
|
RB_DEF_API_METHOD(WriteConsole, 2);
|
1209
|
+
RB_DEF_API_METHOD(WriteFile, 2);
|
1195
1210
|
|
1196
1211
|
RB_DEF_API_METHOD(WriteConsoleInput, -1);
|
1197
1212
|
RB_DEF_API_METHOD(WriteConsoleOutput, 10);
|
data/HISTORY_GEM.txt
ADDED
@@ -0,0 +1,34 @@
|
|
1
|
+
1.1.0 - Bug fixes provided by Gordon Thiesfeld (gthiesfeld at gmail dot com).
|
2
|
+
* added #putc to Win32::Console::ANSI::IO
|
3
|
+
This putc buffers escape sequences so that they will be handled properly
|
4
|
+
*added Kernel#putc
|
5
|
+
Redefined Kernel#putc to wrap Win32::Console::ANSI::IO#putc
|
6
|
+
*added #redirected? to Win32::Console::ANSI::IO
|
7
|
+
Checks the mode of the console to see if IO is being redirected or not
|
8
|
+
* fixed "Invalid Handle" error in compiled version of GetConsoleMode
|
9
|
+
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.
|
10
|
+
* modified Win32::Console::ANSI::IO#write
|
11
|
+
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.
|
12
|
+
* added Win32::Console::API#WriteFile
|
13
|
+
to both the Ruby and compiled versions
|
14
|
+
* added Win32::Console*WriteFile
|
15
|
+
This is a wrapper around Win32::Console::API#WriteFile
|
16
|
+
* modified Win32::Console::ANSI::IO#_PrintString
|
17
|
+
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.
|
18
|
+
* split Win32::Console::Constants and Win32::Console::API out into seperate files.
|
19
|
+
These two classes were in 'Win32/Console.rb' I moved them into 'Win32/Console/constants.rb' and 'Win32/Console/api.rb' respectively.
|
20
|
+
* cleaned up indentation
|
21
|
+
indentations was a mixture of tabs and spaces. I made everything indented with 2 spaces.
|
22
|
+
* modified all Win32::Console::API methods
|
23
|
+
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.
|
24
|
+
For instance, instead of:
|
25
|
+
|
26
|
+
if @@m_AllocConsole == nil
|
27
|
+
@@m_AllocConsole = Win32API.new( "kernel32", "AllocConsole",
|
28
|
+
[], 'l' )
|
29
|
+
|
30
|
+
It is now:
|
31
|
+
|
32
|
+
@AllocConsole ||= Win32API.new( "kernel32", "AllocConsole", [], 'l' )
|
33
|
+
* Non-string arguments passed to Win32::Console::ANSI#write caused error - fix by Ivan Evtuhovich (evtuhovich at gmail dot com).
|
34
|
+
1.0.8 - First public release of win32console gem by Justin Bailey (jgbailey at gmail dot com).
|
data/README.txt
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
= Introduction
|
2
2
|
|
3
|
-
This gem packages Gonzalo Garramuno Win32::Console project, and includes a compiled binary for speed. The Win32::Console project's home can be found at:
|
3
|
+
This gem packages Gonzalo Garramuno's Win32::Console project, and includes a compiled binary for speed. The Win32::Console project's home can be found at:
|
4
4
|
|
5
5
|
http://rubyforge.org/projects/win32console
|
6
6
|
|
data/Rakefile
CHANGED
@@ -5,7 +5,7 @@ require 'rake/gempackagetask'
|
|
5
5
|
spec = Gem::Specification.new do |s|
|
6
6
|
s.name = "win32console"
|
7
7
|
s.summary = "A library giving the Win32 console ANSI escape sequence support."
|
8
|
-
s.version = "1.0
|
8
|
+
s.version = "1.1.0"
|
9
9
|
s.author = "Original Library by Gonzalo Garramuno, Gem by Justin Bailey"
|
10
10
|
s.email = "ggarra @nospam@ advancedsl.com.ar, jgbailey @nospan@ gmail.com"
|
11
11
|
s.homepage = "http://rubyforge.org/projects/winconsole"
|
@@ -13,11 +13,11 @@ spec = Gem::Specification.new do |s|
|
|
13
13
|
s.description = <<EOS
|
14
14
|
This gem packages Gonzalo Garramuno's Win32::Console project, and includes a compiled binary for speed. The Win32::Console project's home can be found at:
|
15
15
|
|
16
|
-
http://rubyforge.org/projects/win32console
|
16
|
+
http://rubyforge.org/projects/win32console
|
17
17
|
|
18
18
|
The gem project can be found at
|
19
19
|
|
20
|
-
http://rubyforge.org/projects/winconsole
|
20
|
+
http://rubyforge.org/projects/winconsole
|
21
21
|
EOS
|
22
22
|
|
23
23
|
s.platform = Gem::Platform::CURRENT
|
@@ -27,9 +27,9 @@ EOS
|
|
27
27
|
s.autorequire = "win32console"
|
28
28
|
|
29
29
|
s.has_rdoc = true
|
30
|
-
s.extra_rdoc_files = ["
|
30
|
+
s.extra_rdoc_files = ["README_GEM.txt"]
|
31
31
|
s.rdoc_options << '--title' << 'Win32Console Gem -- Gem for Win32::Console Project' <<
|
32
|
-
'--main' << '
|
32
|
+
'--main' << 'README_GEM.txt' <<
|
33
33
|
'--line-numbers'
|
34
34
|
end
|
35
35
|
|
data/lib/Console.so
CHANGED
Binary file
|