win32console 1.0.8-i386-mswin32 → 1.1.0-i386-mswin32

Sign up to get free protection for your applications and to get access to all the features.
Files changed (108) hide show
  1. data/Console.cpp +15 -0
  2. data/HISTORY_GEM.txt +34 -0
  3. data/README.txt +0 -1
  4. data/{lib/README_GEM.txt → README_GEM.txt} +1 -1
  5. data/Rakefile +5 -5
  6. data/lib/Console.so +0 -0
  7. data/lib/Win32/Console/ANSI.rb +283 -240
  8. data/lib/Win32/Console/api.rb +342 -0
  9. data/lib/Win32/Console/constants.rb +66 -0
  10. data/lib/Win32/Console.rb +77 -675
  11. metadata +10 -114
  12. data/doc/classes/Win32/Console/ANSI/IO.html +0 -220
  13. data/doc/classes/Win32/Console/ANSI/IO.src/M000035.html +0 -32
  14. data/doc/classes/Win32/Console/ANSI/IO.src/M000036.html +0 -205
  15. data/doc/classes/Win32/Console/ANSI/IO.src/M000037.html +0 -40
  16. data/doc/classes/Win32/Console/ANSI/IO.src/M000038.html +0 -25
  17. data/doc/classes/Win32/Console/ANSI.html +0 -103
  18. data/doc/classes/Win32/Console/API.html +0 -758
  19. data/doc/classes/Win32/Console/API.src/M000039.html +0 -27
  20. data/doc/classes/Win32/Console/API.src/M000040.html +0 -27
  21. data/doc/classes/Win32/Console/API.src/M000041.html +0 -27
  22. data/doc/classes/Win32/Console/API.src/M000042.html +0 -32
  23. data/doc/classes/Win32/Console/API.src/M000043.html +0 -32
  24. data/doc/classes/Win32/Console/API.src/M000044.html +0 -28
  25. data/doc/classes/Win32/Console/API.src/M000045.html +0 -26
  26. data/doc/classes/Win32/Console/API.src/M000046.html +0 -26
  27. data/doc/classes/Win32/Console/API.src/M000047.html +0 -27
  28. data/doc/classes/Win32/Console/API.src/M000048.html +0 -30
  29. data/doc/classes/Win32/Console/API.src/M000049.html +0 -29
  30. data/doc/classes/Win32/Console/API.src/M000050.html +0 -27
  31. data/doc/classes/Win32/Console/API.src/M000051.html +0 -28
  32. data/doc/classes/Win32/Console/API.src/M000052.html +0 -30
  33. data/doc/classes/Win32/Console/API.src/M000053.html +0 -27
  34. data/doc/classes/Win32/Console/API.src/M000054.html +0 -29
  35. data/doc/classes/Win32/Console/API.src/M000055.html +0 -29
  36. data/doc/classes/Win32/Console/API.src/M000056.html +0 -28
  37. data/doc/classes/Win32/Console/API.src/M000057.html +0 -27
  38. data/doc/classes/Win32/Console/API.src/M000058.html +0 -47
  39. data/doc/classes/Win32/Console/API.src/M000059.html +0 -32
  40. data/doc/classes/Win32/Console/API.src/M000060.html +0 -47
  41. data/doc/classes/Win32/Console/API.src/M000061.html +0 -34
  42. data/doc/classes/Win32/Console/API.src/M000062.html +0 -32
  43. data/doc/classes/Win32/Console/API.src/M000063.html +0 -32
  44. data/doc/classes/Win32/Console/API.src/M000064.html +0 -35
  45. data/doc/classes/Win32/Console/API.src/M000065.html +0 -26
  46. data/doc/classes/Win32/Console/API.src/M000066.html +0 -27
  47. data/doc/classes/Win32/Console/API.src/M000067.html +0 -29
  48. data/doc/classes/Win32/Console/API.src/M000068.html +0 -27
  49. data/doc/classes/Win32/Console/API.src/M000069.html +0 -27
  50. data/doc/classes/Win32/Console/API.src/M000070.html +0 -28
  51. data/doc/classes/Win32/Console/API.src/M000071.html +0 -27
  52. data/doc/classes/Win32/Console/API.src/M000072.html +0 -26
  53. data/doc/classes/Win32/Console/API.src/M000073.html +0 -27
  54. data/doc/classes/Win32/Console/API.src/M000074.html +0 -31
  55. data/doc/classes/Win32/Console/API.src/M000075.html +0 -27
  56. data/doc/classes/Win32/Console/API.src/M000076.html +0 -32
  57. data/doc/classes/Win32/Console/API.src/M000077.html +0 -27
  58. data/doc/classes/Win32/Console/API.src/M000078.html +0 -32
  59. data/doc/classes/Win32/Console/API.src/M000079.html +0 -32
  60. data/doc/classes/Win32/Console/API.src/M000080.html +0 -32
  61. data/doc/classes/Win32/Console/Constants.html +0 -360
  62. data/doc/classes/Win32/Console.html +0 -650
  63. data/doc/classes/Win32/Console.src/M000001.html +0 -31
  64. data/doc/classes/Win32/Console.src/M000002.html +0 -23
  65. data/doc/classes/Win32/Console.src/M000003.html +0 -23
  66. data/doc/classes/Win32/Console.src/M000004.html +0 -27
  67. data/doc/classes/Win32/Console.src/M000005.html +0 -23
  68. data/doc/classes/Win32/Console.src/M000006.html +0 -28
  69. data/doc/classes/Win32/Console.src/M000007.html +0 -23
  70. data/doc/classes/Win32/Console.src/M000008.html +0 -24
  71. data/doc/classes/Win32/Console.src/M000009.html +0 -44
  72. data/doc/classes/Win32/Console.src/M000010.html +0 -23
  73. data/doc/classes/Win32/Console.src/M000011.html +0 -33
  74. data/doc/classes/Win32/Console.src/M000012.html +0 -26
  75. data/doc/classes/Win32/Console.src/M000013.html +0 -27
  76. data/doc/classes/Win32/Console.src/M000014.html +0 -28
  77. data/doc/classes/Win32/Console.src/M000015.html +0 -23
  78. data/doc/classes/Win32/Console.src/M000016.html +0 -23
  79. data/doc/classes/Win32/Console.src/M000017.html +0 -23
  80. data/doc/classes/Win32/Console.src/M000018.html +0 -29
  81. data/doc/classes/Win32/Console.src/M000019.html +0 -23
  82. data/doc/classes/Win32/Console.src/M000020.html +0 -23
  83. data/doc/classes/Win32/Console.src/M000021.html +0 -28
  84. data/doc/classes/Win32/Console.src/M000022.html +0 -23
  85. data/doc/classes/Win32/Console.src/M000023.html +0 -28
  86. data/doc/classes/Win32/Console.src/M000024.html +0 -35
  87. data/doc/classes/Win32/Console.src/M000025.html +0 -28
  88. data/doc/classes/Win32/Console.src/M000026.html +0 -28
  89. data/doc/classes/Win32/Console.src/M000027.html +0 -28
  90. data/doc/classes/Win32/Console.src/M000028.html +0 -31
  91. data/doc/classes/Win32/Console.src/M000029.html +0 -23
  92. data/doc/classes/Win32/Console.src/M000030.html +0 -23
  93. data/doc/classes/Win32/Console.src/M000031.html +0 -23
  94. data/doc/classes/Win32/Console.src/M000032.html +0 -27
  95. data/doc/classes/Win32/Console.src/M000033.html +0 -27
  96. data/doc/classes/Win32/Console.src/M000034.html +0 -25
  97. data/doc/classes/Win32.html +0 -115
  98. data/doc/created.rid +0 -1
  99. data/doc/files/Console_ANSI_rdoc.html +0 -407
  100. data/doc/files/Console_cpp.html +0 -104
  101. data/doc/files/Console_rdoc.html +0 -964
  102. data/doc/files/lib/Win32/Console/ANSI_rb.html +0 -123
  103. data/doc/files/lib/Win32/Console_rb.html +0 -297
  104. data/doc/fr_class_index.html +0 -32
  105. data/doc/fr_file_index.html +0 -31
  106. data/doc/fr_method_index.html +0 -106
  107. data/doc/index.html +0 -24
  108. 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
@@ -23,4 +23,3 @@ One of the most common uses for this is to allow to color your
23
23
  output.
24
24
  The modules are disted with Term/ansicolor.rb, too, as it is a nice
25
25
  thing to verify it is working properly.
26
-
@@ -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"
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 = ["lib/README_GEM.txt"]
30
+ s.extra_rdoc_files = ["README_GEM.txt"]
31
31
  s.rdoc_options << '--title' << 'Win32Console Gem -- Gem for Win32::Console Project' <<
32
- '--main' << 'lib/README_GEM.txt' <<
32
+ '--main' << 'README_GEM.txt' <<
33
33
  '--line-numbers'
34
34
  end
35
35
 
data/lib/Console.so CHANGED
Binary file