win32console 1.0.8-i386-mswin32

Sign up to get free protection for your applications and to get access to all the features.
Files changed (119) hide show
  1. data/Console-i386-mswin32.def +2 -0
  2. data/Console.cpp +1203 -0
  3. data/Console.rdoc +690 -0
  4. data/Console_ANSI.rdoc +302 -0
  5. data/HISTORY.txt +7 -0
  6. data/INSTALL.txt +18 -0
  7. data/README.txt +26 -0
  8. data/Rakefile +38 -0
  9. data/doc/classes/Win32.html +115 -0
  10. data/doc/classes/Win32/Console.html +650 -0
  11. data/doc/classes/Win32/Console.src/M000001.html +31 -0
  12. data/doc/classes/Win32/Console.src/M000002.html +23 -0
  13. data/doc/classes/Win32/Console.src/M000003.html +23 -0
  14. data/doc/classes/Win32/Console.src/M000004.html +27 -0
  15. data/doc/classes/Win32/Console.src/M000005.html +23 -0
  16. data/doc/classes/Win32/Console.src/M000006.html +28 -0
  17. data/doc/classes/Win32/Console.src/M000007.html +23 -0
  18. data/doc/classes/Win32/Console.src/M000008.html +24 -0
  19. data/doc/classes/Win32/Console.src/M000009.html +44 -0
  20. data/doc/classes/Win32/Console.src/M000010.html +23 -0
  21. data/doc/classes/Win32/Console.src/M000011.html +33 -0
  22. data/doc/classes/Win32/Console.src/M000012.html +26 -0
  23. data/doc/classes/Win32/Console.src/M000013.html +27 -0
  24. data/doc/classes/Win32/Console.src/M000014.html +28 -0
  25. data/doc/classes/Win32/Console.src/M000015.html +23 -0
  26. data/doc/classes/Win32/Console.src/M000016.html +23 -0
  27. data/doc/classes/Win32/Console.src/M000017.html +23 -0
  28. data/doc/classes/Win32/Console.src/M000018.html +29 -0
  29. data/doc/classes/Win32/Console.src/M000019.html +23 -0
  30. data/doc/classes/Win32/Console.src/M000020.html +23 -0
  31. data/doc/classes/Win32/Console.src/M000021.html +28 -0
  32. data/doc/classes/Win32/Console.src/M000022.html +23 -0
  33. data/doc/classes/Win32/Console.src/M000023.html +28 -0
  34. data/doc/classes/Win32/Console.src/M000024.html +35 -0
  35. data/doc/classes/Win32/Console.src/M000025.html +28 -0
  36. data/doc/classes/Win32/Console.src/M000026.html +28 -0
  37. data/doc/classes/Win32/Console.src/M000027.html +28 -0
  38. data/doc/classes/Win32/Console.src/M000028.html +31 -0
  39. data/doc/classes/Win32/Console.src/M000029.html +23 -0
  40. data/doc/classes/Win32/Console.src/M000030.html +23 -0
  41. data/doc/classes/Win32/Console.src/M000031.html +23 -0
  42. data/doc/classes/Win32/Console.src/M000032.html +27 -0
  43. data/doc/classes/Win32/Console.src/M000033.html +27 -0
  44. data/doc/classes/Win32/Console.src/M000034.html +25 -0
  45. data/doc/classes/Win32/Console/ANSI.html +103 -0
  46. data/doc/classes/Win32/Console/ANSI/IO.html +220 -0
  47. data/doc/classes/Win32/Console/ANSI/IO.src/M000035.html +32 -0
  48. data/doc/classes/Win32/Console/ANSI/IO.src/M000036.html +205 -0
  49. data/doc/classes/Win32/Console/ANSI/IO.src/M000037.html +40 -0
  50. data/doc/classes/Win32/Console/ANSI/IO.src/M000038.html +25 -0
  51. data/doc/classes/Win32/Console/API.html +758 -0
  52. data/doc/classes/Win32/Console/API.src/M000039.html +27 -0
  53. data/doc/classes/Win32/Console/API.src/M000040.html +27 -0
  54. data/doc/classes/Win32/Console/API.src/M000041.html +27 -0
  55. data/doc/classes/Win32/Console/API.src/M000042.html +32 -0
  56. data/doc/classes/Win32/Console/API.src/M000043.html +32 -0
  57. data/doc/classes/Win32/Console/API.src/M000044.html +28 -0
  58. data/doc/classes/Win32/Console/API.src/M000045.html +26 -0
  59. data/doc/classes/Win32/Console/API.src/M000046.html +26 -0
  60. data/doc/classes/Win32/Console/API.src/M000047.html +27 -0
  61. data/doc/classes/Win32/Console/API.src/M000048.html +30 -0
  62. data/doc/classes/Win32/Console/API.src/M000049.html +29 -0
  63. data/doc/classes/Win32/Console/API.src/M000050.html +27 -0
  64. data/doc/classes/Win32/Console/API.src/M000051.html +28 -0
  65. data/doc/classes/Win32/Console/API.src/M000052.html +30 -0
  66. data/doc/classes/Win32/Console/API.src/M000053.html +27 -0
  67. data/doc/classes/Win32/Console/API.src/M000054.html +29 -0
  68. data/doc/classes/Win32/Console/API.src/M000055.html +29 -0
  69. data/doc/classes/Win32/Console/API.src/M000056.html +28 -0
  70. data/doc/classes/Win32/Console/API.src/M000057.html +27 -0
  71. data/doc/classes/Win32/Console/API.src/M000058.html +47 -0
  72. data/doc/classes/Win32/Console/API.src/M000059.html +32 -0
  73. data/doc/classes/Win32/Console/API.src/M000060.html +47 -0
  74. data/doc/classes/Win32/Console/API.src/M000061.html +34 -0
  75. data/doc/classes/Win32/Console/API.src/M000062.html +32 -0
  76. data/doc/classes/Win32/Console/API.src/M000063.html +32 -0
  77. data/doc/classes/Win32/Console/API.src/M000064.html +35 -0
  78. data/doc/classes/Win32/Console/API.src/M000065.html +26 -0
  79. data/doc/classes/Win32/Console/API.src/M000066.html +27 -0
  80. data/doc/classes/Win32/Console/API.src/M000067.html +29 -0
  81. data/doc/classes/Win32/Console/API.src/M000068.html +27 -0
  82. data/doc/classes/Win32/Console/API.src/M000069.html +27 -0
  83. data/doc/classes/Win32/Console/API.src/M000070.html +28 -0
  84. data/doc/classes/Win32/Console/API.src/M000071.html +27 -0
  85. data/doc/classes/Win32/Console/API.src/M000072.html +26 -0
  86. data/doc/classes/Win32/Console/API.src/M000073.html +27 -0
  87. data/doc/classes/Win32/Console/API.src/M000074.html +31 -0
  88. data/doc/classes/Win32/Console/API.src/M000075.html +27 -0
  89. data/doc/classes/Win32/Console/API.src/M000076.html +32 -0
  90. data/doc/classes/Win32/Console/API.src/M000077.html +27 -0
  91. data/doc/classes/Win32/Console/API.src/M000078.html +32 -0
  92. data/doc/classes/Win32/Console/API.src/M000079.html +32 -0
  93. data/doc/classes/Win32/Console/API.src/M000080.html +32 -0
  94. data/doc/classes/Win32/Console/Constants.html +360 -0
  95. data/doc/created.rid +1 -0
  96. data/doc/files/Console_ANSI_rdoc.html +407 -0
  97. data/doc/files/Console_cpp.html +104 -0
  98. data/doc/files/Console_rdoc.html +964 -0
  99. data/doc/files/lib/Win32/Console/ANSI_rb.html +123 -0
  100. data/doc/files/lib/Win32/Console_rb.html +297 -0
  101. data/doc/fr_class_index.html +32 -0
  102. data/doc/fr_file_index.html +31 -0
  103. data/doc/fr_method_index.html +106 -0
  104. data/doc/index.html +24 -0
  105. data/doc/rdoc-style.css +172 -0
  106. data/lib/Console.so +0 -0
  107. data/lib/README_GEM.txt +64 -0
  108. data/lib/Term/ansicolor.rb +76 -0
  109. data/lib/Win32/Console.rb +970 -0
  110. data/lib/Win32/Console/ANSI.rb +305 -0
  111. data/lib/win32console.rb +3 -0
  112. data/test/test_cursor.rb +9 -0
  113. data/test/test_mouse.rb +6 -0
  114. data/test/test_readinput.rb +62 -0
  115. data/test/test_readoutput.rb +52 -0
  116. data/test/test_sendevent.rb +17 -0
  117. data/test/test_title.rb +14 -0
  118. data/test/test_write.rb +36 -0
  119. metadata +180 -0
@@ -0,0 +1,31 @@
1
+
2
+ <?xml version="1.0" encoding="iso-8859-1"?>
3
+ <!DOCTYPE html
4
+ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
5
+ "DTD/xhtml1-transitional.dtd">
6
+
7
+ <!--
8
+
9
+ Files
10
+
11
+ -->
12
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
13
+ <head>
14
+ <title>Files</title>
15
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
16
+ <link rel="stylesheet" href="rdoc-style.css" type="text/css" />
17
+ <base target="docwin" />
18
+ </head>
19
+ <body>
20
+ <div id="index">
21
+ <h1 class="section-bar">Files</h1>
22
+ <div id="index-entries">
23
+ <a href="files/Console_cpp.html">Console.cpp</a><br />
24
+ <a href="files/Console_rdoc.html">Console.rdoc</a><br />
25
+ <a href="files/Console_ANSI_rdoc.html">Console_ANSI.rdoc</a><br />
26
+ <a href="files/lib\Win32/Console_rb.html">lib\Win32/Console.rb</a><br />
27
+ <a href="files/lib\Win32/Console/ANSI_rb.html">lib\Win32/Console/ANSI.rb</a><br />
28
+ </div>
29
+ </div>
30
+ </body>
31
+ </html>
@@ -0,0 +1,106 @@
1
+
2
+ <?xml version="1.0" encoding="iso-8859-1"?>
3
+ <!DOCTYPE html
4
+ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
5
+ "DTD/xhtml1-transitional.dtd">
6
+
7
+ <!--
8
+
9
+ Methods
10
+
11
+ -->
12
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
13
+ <head>
14
+ <title>Methods</title>
15
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
16
+ <link rel="stylesheet" href="rdoc-style.css" type="text/css" />
17
+ <base target="docwin" />
18
+ </head>
19
+ <body>
20
+ <div id="index">
21
+ <h1 class="section-bar">Methods</h1>
22
+ <div id="index-entries">
23
+ <a href="classes/Win32/Console.html#M000030">Alloc (Win32::Console)</a><br />
24
+ <a href="classes/Win32/Console/API.html#M000040">AllocConsole (Win32::Console::API)</a><br />
25
+ <a href="classes/Win32/Console.html#M000023">Attr (Win32::Console)</a><br />
26
+ <a href="classes/Win32/Console.html#M000028">Cls (Win32::Console)</a><br />
27
+ <a href="classes/Win32/Console/API.html#M000041">CreateConsoleScreenBuffer (Win32::Console::API)</a><br />
28
+ <a href="classes/Win32/Console.html#M000009">Cursor (Win32::Console)</a><br />
29
+ <a href="classes/Win32/Console.html#M000002">Display (Win32::Console)</a><br />
30
+ <a href="classes/Win32/Console.html#M000026">FillAttr (Win32::Console)</a><br />
31
+ <a href="classes/Win32/Console.html#M000027">FillChar (Win32::Console)</a><br />
32
+ <a href="classes/Win32/Console/API.html#M000042">FillConsoleOutputAttribute (Win32::Console::API)</a><br />
33
+ <a href="classes/Win32/Console/API.html#M000043">FillConsoleOutputCharacter (Win32::Console::API)</a><br />
34
+ <a href="classes/Win32/Console.html#M000017">Flush (Win32::Console)</a><br />
35
+ <a href="classes/Win32/Console/API.html#M000044">FlushConsoleInputBuffer (Win32::Console::API)</a><br />
36
+ <a href="classes/Win32/Console.html#M000029">Free (Win32::Console)</a><br />
37
+ <a href="classes/Win32/Console/API.html#M000045">FreeConsole (Win32::Console::API)</a><br />
38
+ <a href="classes/Win32/Console/API.html#M000046">GenerateConsoleCtrlEvent (Win32::Console::API)</a><br />
39
+ <a href="classes/Win32/Console.html#M000034">GenerateCtrlEvent (Win32::Console)</a><br />
40
+ <a href="classes/Win32/Console/API.html#M000047">GetConsoleCP (Win32::Console::API)</a><br />
41
+ <a href="classes/Win32/Console/API.html#M000048">GetConsoleCursorInfo (Win32::Console::API)</a><br />
42
+ <a href="classes/Win32/Console/API.html#M000049">GetConsoleMode (Win32::Console::API)</a><br />
43
+ <a href="classes/Win32/Console/API.html#M000050">GetConsoleOutputCP (Win32::Console::API)</a><br />
44
+ <a href="classes/Win32/Console/API.html#M000051">GetConsoleScreenBufferInfo (Win32::Console::API)</a><br />
45
+ <a href="classes/Win32/Console/API.html#M000052">GetConsoleTitle (Win32::Console::API)</a><br />
46
+ <a href="classes/Win32/Console/API.html#M000053">GetConsoleWindow (Win32::Console::API)</a><br />
47
+ <a href="classes/Win32/Console.html#M000016">GetEvents (Win32::Console)</a><br />
48
+ <a href="classes/Win32/Console/API.html#M000054">GetLargestConsoleWindowSize (Win32::Console::API)</a><br />
49
+ <a href="classes/Win32/Console/API.html#M000055">GetNumberOfConsoleInputEvents (Win32::Console::API)</a><br />
50
+ <a href="classes/Win32/Console/API.html#M000056">GetNumberOfConsoleMouseButtons (Win32::Console::API)</a><br />
51
+ <a href="classes/Win32/Console/API.html#M000057">GetStdHandle (Win32::Console::API)</a><br />
52
+ <a href="classes/Win32/Console.html#M000015">Info (Win32::Console)</a><br />
53
+ <a href="classes/Win32/Console.html#M000019">Input (Win32::Console)</a><br />
54
+ <a href="classes/Win32/Console.html#M000032">InputCP (Win32::Console)</a><br />
55
+ <a href="classes/Win32/Console.html#M000018">InputChar (Win32::Console)</a><br />
56
+ <a href="classes/Win32/Console.html#M000014">MaxWindow (Win32::Console)</a><br />
57
+ <a href="classes/Win32/Console.html#M000021">Mode (Win32::Console)</a><br />
58
+ <a href="classes/Win32/Console.html#M000031">MouseButtons (Win32::Console)</a><br />
59
+ <a href="classes/Win32/Console.html#M000033">OutputCP (Win32::Console)</a><br />
60
+ <a href="classes/Win32/Console/API.html#M000058">PeekConsoleInput (Win32::Console::API)</a><br />
61
+ <a href="classes/Win32/Console.html#M000020">PeekInput (Win32::Console)</a><br />
62
+ <a href="classes/Win32/Console.html#M000008">ReadAttr (Win32::Console)</a><br />
63
+ <a href="classes/Win32/Console.html#M000006">ReadChar (Win32::Console)</a><br />
64
+ <a href="classes/Win32/Console/API.html#M000059">ReadConsole (Win32::Console::API)</a><br />
65
+ <a href="classes/Win32/Console/API.html#M000060">ReadConsoleInput (Win32::Console::API)</a><br />
66
+ <a href="classes/Win32/Console/API.html#M000061">ReadConsoleOutput (Win32::Console::API)</a><br />
67
+ <a href="classes/Win32/Console/API.html#M000062">ReadConsoleOutputAttribute (Win32::Console::API)</a><br />
68
+ <a href="classes/Win32/Console/API.html#M000063">ReadConsoleOutputCharacter (Win32::Console::API)</a><br />
69
+ <a href="classes/Win32/Console.html#M000011">ReadRect (Win32::Console)</a><br />
70
+ <a href="classes/Win32/Console.html#M000013">Scroll (Win32::Console)</a><br />
71
+ <a href="classes/Win32/Console/API.html#M000064">ScrollConsoleScreenBuffer (Win32::Console::API)</a><br />
72
+ <a href="classes/Win32/Console.html#M000003">Select (Win32::Console)</a><br />
73
+ <a href="classes/Win32/Console/API.html#M000065">SetConsoleActiveScreenBuffer (Win32::Console::API)</a><br />
74
+ <a href="classes/Win32/Console/API.html#M000066">SetConsoleCP (Win32::Console::API)</a><br />
75
+ <a href="classes/Win32/Console/API.html#M000067">SetConsoleCursorInfo (Win32::Console::API)</a><br />
76
+ <a href="classes/Win32/Console/API.html#M000068">SetConsoleCursorPosition (Win32::Console::API)</a><br />
77
+ <a href="classes/Win32/Console/API.html#M000069">SetConsoleMode (Win32::Console::API)</a><br />
78
+ <a href="classes/Win32/Console/API.html#M000070">SetConsoleOutputCP (Win32::Console::API)</a><br />
79
+ <a href="classes/Win32/Console/API.html#M000071">SetConsoleScreenBufferSize (Win32::Console::API)</a><br />
80
+ <a href="classes/Win32/Console/API.html#M000072">SetConsoleTextAttribute (Win32::Console::API)</a><br />
81
+ <a href="classes/Win32/Console/API.html#M000073">SetConsoleTitle (Win32::Console::API)</a><br />
82
+ <a href="classes/Win32/Console/API.html#M000074">SetConsoleWindowInfo (Win32::Console::API)</a><br />
83
+ <a href="classes/Win32/Console/API.html#M000075">SetStdHandle (Win32::Console::API)</a><br />
84
+ <a href="classes/Win32/Console.html#M000024">Size (Win32::Console)</a><br />
85
+ <a href="classes/Win32/Console.html#M000004">Title (Win32::Console)</a><br />
86
+ <a href="classes/Win32/Console.html#M000025">Window (Win32::Console)</a><br />
87
+ <a href="classes/Win32/Console.html#M000010">Write (Win32::Console)</a><br />
88
+ <a href="classes/Win32/Console.html#M000007">WriteAttr (Win32::Console)</a><br />
89
+ <a href="classes/Win32/Console.html#M000005">WriteChar (Win32::Console)</a><br />
90
+ <a href="classes/Win32/Console/API.html#M000076">WriteConsole (Win32::Console::API)</a><br />
91
+ <a href="classes/Win32/Console/API.html#M000077">WriteConsoleInput (Win32::Console::API)</a><br />
92
+ <a href="classes/Win32/Console/API.html#M000078">WriteConsoleOutput (Win32::Console::API)</a><br />
93
+ <a href="classes/Win32/Console/API.html#M000079">WriteConsoleOutputAttribute (Win32::Console::API)</a><br />
94
+ <a href="classes/Win32/Console/API.html#M000080">WriteConsoleOutputCharacter (Win32::Console::API)</a><br />
95
+ <a href="classes/Win32/Console.html#M000022">WriteInput (Win32::Console)</a><br />
96
+ <a href="classes/Win32/Console.html#M000012">WriteRect (Win32::Console)</a><br />
97
+ <a href="classes/Win32/Console/ANSI/IO.html#M000036">_PrintString (Win32::Console::ANSI::IO)</a><br />
98
+ <a href="classes/Win32/Console/ANSI/IO.html#M000037">_conv (Win32::Console::ANSI::IO)</a><br />
99
+ <a href="classes/Win32/Console/API.html#M000039">constant (Win32::Console::API)</a><br />
100
+ <a href="classes/Win32/Console/ANSI/IO.html#M000035">new (Win32::Console::ANSI::IO)</a><br />
101
+ <a href="classes/Win32/Console.html#M000001">new (Win32::Console)</a><br />
102
+ <a href="classes/Win32/Console/ANSI/IO.html#M000038">write (Win32::Console::ANSI::IO)</a><br />
103
+ </div>
104
+ </div>
105
+ </body>
106
+ </html>
data/doc/index.html ADDED
@@ -0,0 +1,24 @@
1
+ <?xml version="1.0" encoding="iso-8859-1"?>
2
+ <!DOCTYPE html
3
+ PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN"
4
+ "DTD/xhtml1-frameset.dtd">
5
+
6
+ <!--
7
+
8
+ RDoc Documentation
9
+
10
+ -->
11
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
12
+ <head>
13
+ <title>RDoc Documentation</title>
14
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
15
+ </head>
16
+ <frameset rows="20%, 80%">
17
+ <frameset cols="25%,35%,45%">
18
+ <frame src="fr_file_index.html" title="Files" name="Files" />
19
+ <frame src="fr_class_index.html" name="Classes" />
20
+ <frame src="fr_method_index.html" name="Methods" />
21
+ </frameset>
22
+ <frame src="files/Console_ANSI_rdoc.html" name="docwin" />
23
+ </frameset>
24
+ </html>
@@ -0,0 +1,172 @@
1
+
2
+ body {
3
+ margin: 0;
4
+ padding: 0;
5
+ }
6
+
7
+ h1,h2,h3,h4 { margin: 0; color: #efefef; background: transparent; }
8
+ h1 { font-size: 120%; }
9
+ h2,h3,h4 { margin-top: 1em; }
10
+
11
+ a { background: #eef; color: #039; text-decoration: none; }
12
+ a:hover { background: #039; color: #eef; }
13
+
14
+ /* Override the base stylesheet's Anchor inside a table cell */
15
+ td > a {
16
+ background: transparent;
17
+ color: #039;
18
+ text-decoration: none;
19
+ }
20
+
21
+ /* === Structural elements =================================== */
22
+
23
+ div#index {
24
+ margin: 0;
25
+ padding: 0;
26
+ font-size: 0.9em;
27
+ }
28
+
29
+ div#index a {
30
+ margin-left: 0.7em;
31
+ }
32
+
33
+ div#classHeader {
34
+ width: auto;
35
+ background: #039;
36
+ color: white;
37
+ padding: 0.5em 1.5em 0.5em 1.5em;
38
+ margin: 0;
39
+ border-bottom: 3px solid #006;
40
+ }
41
+
42
+ div#classHeader a {
43
+ background: inherit;
44
+ color: white;
45
+ }
46
+
47
+ div#classHeader td {
48
+ background: inherit;
49
+ color: white;
50
+ }
51
+
52
+ div#fileHeader {
53
+ width: auto;
54
+ background: #039;
55
+ color: white;
56
+ padding: 0.5em 1.5em 0.5em 1.5em;
57
+ margin: 0;
58
+ border-bottom: 3px solid #006;
59
+ }
60
+
61
+ div#fileHeader a {
62
+ background: inherit;
63
+ color: white;
64
+ }
65
+
66
+ div#fileHeader td {
67
+ background: inherit;
68
+ color: white;
69
+ }
70
+
71
+ div#bodyContent {
72
+ padding: 0 1.5em 0 1.5em;
73
+ }
74
+
75
+ div#description {
76
+ padding: 0.5em 1.5em;
77
+ background: #efefef;
78
+ border: 1px dotted #999;
79
+ }
80
+
81
+ div#description h1,h2,h3,h4,h5,h6 {
82
+ color: black;
83
+ background: transparent;
84
+ }
85
+
86
+ div#validator-badges {
87
+ text-align: center;
88
+ }
89
+ div#validator-badges img { border: 0; }
90
+
91
+ div#copyright {
92
+ color: #333;
93
+ background: #efefef;
94
+ font: 0.75em sans-serif;
95
+ margin-top: 5em;
96
+ margin-bottom: 0;
97
+ padding: 0.5em 2em;
98
+ }
99
+
100
+
101
+ /* === Classes =================================== */
102
+
103
+ table.header-table {
104
+ color: white;
105
+ font-size: small;
106
+ }
107
+
108
+ .type-note {
109
+ font-size: small;
110
+ color: #DEDEDE;
111
+ }
112
+
113
+ .section-bar {
114
+ background: #eee;
115
+ color: #333;
116
+ padding: 3px;
117
+ border: 1px solid #999;
118
+ }
119
+
120
+ .top-aligned-row { vertical-align: vertical-align: top }
121
+
122
+ /* --- Context section classes ----------------------- */
123
+
124
+ .context-row { }
125
+ .context-item-name { font-family: monospace; font-weight: bold; color: black; }
126
+ .context-item-value { font-size: x-small; color: #448; }
127
+ .context-item-desc { background: #efefef; }
128
+
129
+ /* --- Method classes -------------------------- */
130
+ .method-detail {
131
+ background: #EFEFEF;
132
+ padding: 0;
133
+ margin-top: 0.5em;
134
+ margin-bottom: 0.5em;
135
+ border: 1px dotted #DDD;
136
+ }
137
+ .method-heading {
138
+ color: black;
139
+ background: #AAA;
140
+ border-bottom: 1px solid #666;
141
+ padding: 0.2em 0.5em 0 0.5em;
142
+ }
143
+ .method-signature { color: black; background: inherit; }
144
+ .method-name { font-weight: bold; }
145
+ .method-args { font-style: italic; }
146
+ .method-description { padding: 0 0.5em 0 0.5em; }
147
+
148
+ /* --- Source code sections -------------------- */
149
+
150
+ a.source-toggle { font-size: 90%; }
151
+ div.method-source-code {
152
+ background: #262626;
153
+ color: #ffdead;
154
+ margin: 1em;
155
+ padding: 0.5em;
156
+ border: 1px dashed #999;
157
+ overflow: hidden;
158
+ }
159
+
160
+ div.method-source-code pre { color: #ffdead; overflow: hidden; }
161
+
162
+ /* --- Ruby keyword styles --------------------- */
163
+ /* (requires a hacked html_generator.rb to add more class-types) */
164
+ .ruby-constant { color: #7fffd4; background: transparent; }
165
+ .ruby-keyword { color: #00ffff; background: transparent; }
166
+ .ruby-ivar { color: #eedd82; background: transparent; }
167
+ .ruby-operator { color: #00ffee; background: transparent; }
168
+ .ruby-identifier { color: #ffdead; background: transparent; }
169
+ .ruby-node { color: #ffa07a; background: transparent; }
170
+ .ruby-comment { color: #b22222; font-weight: bold; background: transparent; }
171
+ .ruby-regexp { color: #ffa07a; background: transparent; }
172
+ .ruby-value { color: #7fffd4; background: transparent; }
data/lib/Console.so ADDED
Binary file
@@ -0,0 +1,64 @@
1
+ = Introduction
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:
4
+
5
+ http://rubyforge.org/projects/win32console
6
+
7
+ To use the gem, just put
8
+
9
+ require 'win32console'
10
+
11
+ At the top of your file.
12
+
13
+ = Example
14
+
15
+ To output a simple bolded string, try this script:
16
+
17
+ require 'rubygems'
18
+ require 'win32console'
19
+ include Win32::Console::ANSI
20
+ include Term::ANSIColor
21
+
22
+ puts bold << "bolded text" << clear << " and no longer bold."
23
+
24
+ = Formatting Methods Available
25
+
26
+ The full list of methods available is found in lib/Term/ansicolor.rb (generated from the @@attributes array):
27
+
28
+ clear
29
+ reset # synonym for clear
30
+ bold
31
+ dark
32
+ italic # not widely implemented
33
+ underline
34
+ underscore # synonym for underline
35
+ blink
36
+ rapid_blink # not widely implemented
37
+ negative # no reverse because of String#reverse
38
+ concealed
39
+ strikethrough # not widely implemented
40
+
41
+ # The following will set the foreground color
42
+
43
+ black
44
+ red
45
+ green
46
+ yellow
47
+ blue
48
+ magenta
49
+ cyan
50
+ white
51
+
52
+ # The following will set the background color
53
+
54
+ on_black
55
+ on_red
56
+ on_green
57
+ on_yellow
58
+ on_blue
59
+ on_magenta
60
+ on_cyan
61
+ on_white
62
+
63
+ The methods are fairly sophisticated. If you don't pass an argument, the appropriate escape sequence is returned. If a string is given, it will be outputted with an escape sequence wrapping it to apply the formatting to just that portion. If a block is given, the escape sequence will wrap the output of the block. Finally, if the Term::ANSIColor module is mixed into an object, and that instance supports to_str, tnen the result of to_str will be wrapped in the escape sequence.
64
+
@@ -0,0 +1,76 @@
1
+ module Term
2
+
3
+ module ANSIColor
4
+
5
+ @@attributes = [
6
+ [ :clear , 0 ],
7
+ [ :reset , 0 ], # synonym for :clear
8
+ [ :bold , 1 ],
9
+ [ :dark , 2 ],
10
+ [ :italic , 3 ], # not widely implemented
11
+ [ :underline , 4 ],
12
+ [ :underscore , 4 ], # synonym for :underline
13
+ [ :blink , 5 ],
14
+ [ :rapid_blink , 6 ], # not widely implemented
15
+ [ :negative , 7 ], # no reverse because of String#reverse
16
+ [ :concealed , 8 ],
17
+ [ :strikethrough, 9 ], # not widely implemented
18
+ [ :black , 30 ],
19
+ [ :red , 31 ],
20
+ [ :green , 32 ],
21
+ [ :yellow , 33 ],
22
+ [ :blue , 34 ],
23
+ [ :magenta , 35 ],
24
+ [ :cyan , 36 ],
25
+ [ :white , 37 ],
26
+ [ :on_black , 40 ],
27
+ [ :on_red , 41 ],
28
+ [ :on_green , 42 ],
29
+ [ :on_yellow , 43 ],
30
+ [ :on_blue , 44 ],
31
+ [ :on_magenta , 45 ],
32
+ [ :on_cyan , 46 ],
33
+ [ :on_white , 47 ],
34
+ ]
35
+
36
+ @@attributes.each do |c, v|
37
+ eval %Q{
38
+ def #{c.to_s}(string = nil)
39
+ result = "\e[#{v}m"
40
+ if block_given?
41
+ result << yield
42
+ result << "\e[0m"
43
+ elsif string
44
+ result << string
45
+ result << "\e[0m"
46
+ elsif respond_to?(:to_str)
47
+ result << self
48
+ result << "\e[0m"
49
+ end
50
+ return result
51
+ end
52
+ }
53
+ end
54
+
55
+ ColoredRegexp = /\e\[([34][0-7]|[0-9])m/
56
+ def uncolored(string = nil)
57
+ if block_given?
58
+ yield.gsub(ColoredRegexp, '')
59
+ elsif string
60
+ string.gsub(ColoredRegexp, '')
61
+ elsif respond_to?(:to_str)
62
+ gsub(ColoredRegexp, '')
63
+ else
64
+ ''
65
+ end
66
+ end
67
+
68
+ def attributes
69
+ @@attributes.map { |c| c[0] }
70
+ end
71
+ module_function :attributes
72
+
73
+ end
74
+
75
+ end
76
+ # vim: set cin sw=4 ts=4: