win32console 1.0.8-i386-mswin32
Sign up to get free protection for your applications and to get access to all the features.
- data/Console-i386-mswin32.def +2 -0
- data/Console.cpp +1203 -0
- data/Console.rdoc +690 -0
- data/Console_ANSI.rdoc +302 -0
- data/HISTORY.txt +7 -0
- data/INSTALL.txt +18 -0
- data/README.txt +26 -0
- data/Rakefile +38 -0
- data/doc/classes/Win32.html +115 -0
- data/doc/classes/Win32/Console.html +650 -0
- data/doc/classes/Win32/Console.src/M000001.html +31 -0
- data/doc/classes/Win32/Console.src/M000002.html +23 -0
- data/doc/classes/Win32/Console.src/M000003.html +23 -0
- data/doc/classes/Win32/Console.src/M000004.html +27 -0
- data/doc/classes/Win32/Console.src/M000005.html +23 -0
- data/doc/classes/Win32/Console.src/M000006.html +28 -0
- data/doc/classes/Win32/Console.src/M000007.html +23 -0
- data/doc/classes/Win32/Console.src/M000008.html +24 -0
- data/doc/classes/Win32/Console.src/M000009.html +44 -0
- data/doc/classes/Win32/Console.src/M000010.html +23 -0
- data/doc/classes/Win32/Console.src/M000011.html +33 -0
- data/doc/classes/Win32/Console.src/M000012.html +26 -0
- data/doc/classes/Win32/Console.src/M000013.html +27 -0
- data/doc/classes/Win32/Console.src/M000014.html +28 -0
- data/doc/classes/Win32/Console.src/M000015.html +23 -0
- data/doc/classes/Win32/Console.src/M000016.html +23 -0
- data/doc/classes/Win32/Console.src/M000017.html +23 -0
- data/doc/classes/Win32/Console.src/M000018.html +29 -0
- data/doc/classes/Win32/Console.src/M000019.html +23 -0
- data/doc/classes/Win32/Console.src/M000020.html +23 -0
- data/doc/classes/Win32/Console.src/M000021.html +28 -0
- data/doc/classes/Win32/Console.src/M000022.html +23 -0
- data/doc/classes/Win32/Console.src/M000023.html +28 -0
- data/doc/classes/Win32/Console.src/M000024.html +35 -0
- data/doc/classes/Win32/Console.src/M000025.html +28 -0
- data/doc/classes/Win32/Console.src/M000026.html +28 -0
- data/doc/classes/Win32/Console.src/M000027.html +28 -0
- data/doc/classes/Win32/Console.src/M000028.html +31 -0
- data/doc/classes/Win32/Console.src/M000029.html +23 -0
- data/doc/classes/Win32/Console.src/M000030.html +23 -0
- data/doc/classes/Win32/Console.src/M000031.html +23 -0
- data/doc/classes/Win32/Console.src/M000032.html +27 -0
- data/doc/classes/Win32/Console.src/M000033.html +27 -0
- data/doc/classes/Win32/Console.src/M000034.html +25 -0
- data/doc/classes/Win32/Console/ANSI.html +103 -0
- data/doc/classes/Win32/Console/ANSI/IO.html +220 -0
- data/doc/classes/Win32/Console/ANSI/IO.src/M000035.html +32 -0
- data/doc/classes/Win32/Console/ANSI/IO.src/M000036.html +205 -0
- data/doc/classes/Win32/Console/ANSI/IO.src/M000037.html +40 -0
- data/doc/classes/Win32/Console/ANSI/IO.src/M000038.html +25 -0
- data/doc/classes/Win32/Console/API.html +758 -0
- data/doc/classes/Win32/Console/API.src/M000039.html +27 -0
- data/doc/classes/Win32/Console/API.src/M000040.html +27 -0
- data/doc/classes/Win32/Console/API.src/M000041.html +27 -0
- data/doc/classes/Win32/Console/API.src/M000042.html +32 -0
- data/doc/classes/Win32/Console/API.src/M000043.html +32 -0
- data/doc/classes/Win32/Console/API.src/M000044.html +28 -0
- data/doc/classes/Win32/Console/API.src/M000045.html +26 -0
- data/doc/classes/Win32/Console/API.src/M000046.html +26 -0
- data/doc/classes/Win32/Console/API.src/M000047.html +27 -0
- data/doc/classes/Win32/Console/API.src/M000048.html +30 -0
- data/doc/classes/Win32/Console/API.src/M000049.html +29 -0
- data/doc/classes/Win32/Console/API.src/M000050.html +27 -0
- data/doc/classes/Win32/Console/API.src/M000051.html +28 -0
- data/doc/classes/Win32/Console/API.src/M000052.html +30 -0
- data/doc/classes/Win32/Console/API.src/M000053.html +27 -0
- data/doc/classes/Win32/Console/API.src/M000054.html +29 -0
- data/doc/classes/Win32/Console/API.src/M000055.html +29 -0
- data/doc/classes/Win32/Console/API.src/M000056.html +28 -0
- data/doc/classes/Win32/Console/API.src/M000057.html +27 -0
- data/doc/classes/Win32/Console/API.src/M000058.html +47 -0
- data/doc/classes/Win32/Console/API.src/M000059.html +32 -0
- data/doc/classes/Win32/Console/API.src/M000060.html +47 -0
- data/doc/classes/Win32/Console/API.src/M000061.html +34 -0
- data/doc/classes/Win32/Console/API.src/M000062.html +32 -0
- data/doc/classes/Win32/Console/API.src/M000063.html +32 -0
- data/doc/classes/Win32/Console/API.src/M000064.html +35 -0
- data/doc/classes/Win32/Console/API.src/M000065.html +26 -0
- data/doc/classes/Win32/Console/API.src/M000066.html +27 -0
- data/doc/classes/Win32/Console/API.src/M000067.html +29 -0
- data/doc/classes/Win32/Console/API.src/M000068.html +27 -0
- data/doc/classes/Win32/Console/API.src/M000069.html +27 -0
- data/doc/classes/Win32/Console/API.src/M000070.html +28 -0
- data/doc/classes/Win32/Console/API.src/M000071.html +27 -0
- data/doc/classes/Win32/Console/API.src/M000072.html +26 -0
- data/doc/classes/Win32/Console/API.src/M000073.html +27 -0
- data/doc/classes/Win32/Console/API.src/M000074.html +31 -0
- data/doc/classes/Win32/Console/API.src/M000075.html +27 -0
- data/doc/classes/Win32/Console/API.src/M000076.html +32 -0
- data/doc/classes/Win32/Console/API.src/M000077.html +27 -0
- data/doc/classes/Win32/Console/API.src/M000078.html +32 -0
- data/doc/classes/Win32/Console/API.src/M000079.html +32 -0
- data/doc/classes/Win32/Console/API.src/M000080.html +32 -0
- data/doc/classes/Win32/Console/Constants.html +360 -0
- data/doc/created.rid +1 -0
- data/doc/files/Console_ANSI_rdoc.html +407 -0
- data/doc/files/Console_cpp.html +104 -0
- data/doc/files/Console_rdoc.html +964 -0
- data/doc/files/lib/Win32/Console/ANSI_rb.html +123 -0
- data/doc/files/lib/Win32/Console_rb.html +297 -0
- data/doc/fr_class_index.html +32 -0
- data/doc/fr_file_index.html +31 -0
- data/doc/fr_method_index.html +106 -0
- data/doc/index.html +24 -0
- data/doc/rdoc-style.css +172 -0
- data/lib/Console.so +0 -0
- data/lib/README_GEM.txt +64 -0
- data/lib/Term/ansicolor.rb +76 -0
- data/lib/Win32/Console.rb +970 -0
- data/lib/Win32/Console/ANSI.rb +305 -0
- data/lib/win32console.rb +3 -0
- data/test/test_cursor.rb +9 -0
- data/test/test_mouse.rb +6 -0
- data/test/test_readinput.rb +62 -0
- data/test/test_readoutput.rb +52 -0
- data/test/test_sendevent.rb +17 -0
- data/test/test_title.rb +14 -0
- data/test/test_write.rb +36 -0
- metadata +180 -0
data/Console_ANSI.rdoc
ADDED
@@ -0,0 +1,302 @@
|
|
1
|
+
#
|
2
|
+
# = NAME
|
3
|
+
#
|
4
|
+
# Win32::Console::ANSI - Ruby extension to emulate ANSI console on Win32 system.
|
5
|
+
#
|
6
|
+
# = SYNOPSIS
|
7
|
+
#
|
8
|
+
# require "Win32::Console::ANSI"
|
9
|
+
#
|
10
|
+
# puts "\e[1;34mThis text is bold blue.\e[0m"
|
11
|
+
# puts "This text is normal.""
|
12
|
+
# puts "\e[33;45;1mBold yellow on magenta.\e[0m"
|
13
|
+
# puts "This text is normal."
|
14
|
+
#
|
15
|
+
# With the Term::ANSIColor module one increases the readability:
|
16
|
+
#
|
17
|
+
# require "Win32::Console::ANSI"
|
18
|
+
# require "Term::ANSIColor"
|
19
|
+
#
|
20
|
+
# puts color 'bold blue'
|
21
|
+
# puts "This text is bold blue."
|
22
|
+
# puts color 'reset'
|
23
|
+
# puts "This text is normal."
|
24
|
+
# puts colored ("Bold yellow on magenta.", 'bold yellow on_magenta')
|
25
|
+
# puts "This text is normal."
|
26
|
+
#
|
27
|
+
# And even more with Term::ANSIScreen:
|
28
|
+
#
|
29
|
+
# require "Win32::Console::ANSI;
|
30
|
+
# require "Term::ANSIScreen qw/:color :cursor :screen/;
|
31
|
+
#
|
32
|
+
# locate 1, 1; puts "@ This is (1,1)", savepos;
|
33
|
+
# puts locate(24,60), "@ This is (24,60)"; loadpos;
|
34
|
+
# puts down(2), clline, "@ This is (3,16)";
|
35
|
+
# setscroll 1, 20;
|
36
|
+
# color 'black on white'; clline;
|
37
|
+
# puts "This line is black on white.";
|
38
|
+
# puts color 'reset'; puts "This text is normal.";
|
39
|
+
# puts colored ("This text is bold blue.", 'bold blue');
|
40
|
+
# puts "This text is normal.";
|
41
|
+
# puts colored ['bold blue'], "This text is bold blue.";
|
42
|
+
# puts "This text is normal.";
|
43
|
+
#
|
44
|
+
# = DESCRIPTION
|
45
|
+
#
|
46
|
+
# Windows NT/2000/XP does not support ANSI escape sequences in Win32 Console
|
47
|
+
# applications. This module emulates an ANSI console for the script which
|
48
|
+
# uses it.
|
49
|
+
#
|
50
|
+
#
|
51
|
+
# == Escape sequences for Cursor Movement
|
52
|
+
#
|
53
|
+
# * \e[#A
|
54
|
+
#
|
55
|
+
# CUU: CUrsor Up: Moves the cursor up by the specified number of lines without
|
56
|
+
# changing columns. If the cursor is already on the top line, this sequence
|
57
|
+
# is ignored. \e[A is equivalent to \e[1A.
|
58
|
+
#
|
59
|
+
# * \e[#B
|
60
|
+
#
|
61
|
+
# CUD: CUrsor Down: Moves the cursor down by the specified number of lines
|
62
|
+
# without changing columns. If the cursor is already on the bottom line,
|
63
|
+
# this sequence is ignored. \e[B is equivalent to \e[1B.
|
64
|
+
#
|
65
|
+
# * \e[#C
|
66
|
+
#
|
67
|
+
# CUF: CUrsor Forward: Moves the cursor forward by the specified number of
|
68
|
+
# columns without changing lines. If the cursor is already in the
|
69
|
+
# rightmost column, this sequence is ignored. \e[C is equivalent to \e[1C.
|
70
|
+
#
|
71
|
+
# * \e[#D
|
72
|
+
#
|
73
|
+
# CUB: CUrsor Backward: Moves the cursor back by the specified number of
|
74
|
+
# columns without changing lines. If the cursor is already in the leftmost
|
75
|
+
# column, this sequence is ignored. \e[D is equivalent to \e[1D.
|
76
|
+
#
|
77
|
+
# * \e[#E
|
78
|
+
#
|
79
|
+
# CNL: Cursor Next Line: Moves the cursor down the indicated # of rows, to
|
80
|
+
# column 1. \e[E is equivalent to \e[1E.
|
81
|
+
#
|
82
|
+
# * \e[#F
|
83
|
+
#
|
84
|
+
# CPL: Cursor Preceding Line: Moves the cursor up the indicated # of rows,
|
85
|
+
# to column 1. \e[F is equivalent to \e[1F.
|
86
|
+
#
|
87
|
+
# * \e[#G
|
88
|
+
#
|
89
|
+
# CHA: Cursor Horizontal Absolute: Moves the cursor to indicated column in
|
90
|
+
# current row. \e[G is equivalent to \e[1G.
|
91
|
+
#
|
92
|
+
# * \e[#;#H
|
93
|
+
#
|
94
|
+
# CUP: CUrsor Position: Moves the cursor to the specified position. The first #
|
95
|
+
# specifies the line number, the second # specifies the column.
|
96
|
+
# If you do not specify a position, the cursor moves to the
|
97
|
+
# home position: the upper-left corner of the screen (line 1, column 1).
|
98
|
+
#
|
99
|
+
# * \e[#;#f
|
100
|
+
#
|
101
|
+
# HVP: Horizontal and Vertical Position.
|
102
|
+
# Works the same way as the preceding escape sequence.
|
103
|
+
#
|
104
|
+
# * \e[s
|
105
|
+
#
|
106
|
+
# SCP: Save Cursor Position: Saves the current cursor position. You can move
|
107
|
+
# the cursor to the saved cursor position by using the Restore Cursor
|
108
|
+
# Position sequence.
|
109
|
+
#
|
110
|
+
# * \e[u
|
111
|
+
#
|
112
|
+
# RCP: Restore Cursor Position: Returns the cursor to the position stored
|
113
|
+
# by the Save Cursor Position sequence.
|
114
|
+
#
|
115
|
+
# == Escape sequences for Display Edition
|
116
|
+
#
|
117
|
+
# * \e[#J
|
118
|
+
#
|
119
|
+
# ED: Erase Display:
|
120
|
+
#
|
121
|
+
# * \e[0J
|
122
|
+
#
|
123
|
+
# Clears the screen from cursor to end of display. The cursor position is unchanged.
|
124
|
+
#
|
125
|
+
# * \e[1J
|
126
|
+
#
|
127
|
+
# Clears the screen from start to cursor. The cursor position is unchanged.
|
128
|
+
#
|
129
|
+
# * \e[2J
|
130
|
+
#
|
131
|
+
# Clears the screen and moves the cursor to the home position (line 1, column 1).
|
132
|
+
#
|
133
|
+
# \e[J is equivalent to \e[0J. (Some terminal/emulators respond to \e[J as if
|
134
|
+
# it were \e[2J. Here, the default is 0; it's the norm)
|
135
|
+
#
|
136
|
+
# * \e[#K
|
137
|
+
#
|
138
|
+
# EL: Erase Line:
|
139
|
+
#
|
140
|
+
# * \e[0K
|
141
|
+
#
|
142
|
+
# Clears all characters from the cursor position to the end of the line
|
143
|
+
# (including the character at the cursor position).
|
144
|
+
# The cursor position is unchanged.
|
145
|
+
#
|
146
|
+
# * \e[1K
|
147
|
+
#
|
148
|
+
# Clears all characters from start of line to the cursor position.
|
149
|
+
# (including the character at the cursor position).
|
150
|
+
# The cursor position is unchanged.
|
151
|
+
#
|
152
|
+
# * \e[2K
|
153
|
+
#
|
154
|
+
# Clears all characters of the whole line.
|
155
|
+
# The cursor position is unchanged.
|
156
|
+
#
|
157
|
+
# \e[K is equivalent to \e[0K.
|
158
|
+
#
|
159
|
+
# * \e[#L
|
160
|
+
#
|
161
|
+
# IL: Insert Lines: The cursor line and all lines below it move down # lines,
|
162
|
+
# leaving blank space. The cursor position is unchanged. The bottommost #
|
163
|
+
# lines are lost. \e[L is equivalent to \e[1L.
|
164
|
+
#
|
165
|
+
# * \e[#M
|
166
|
+
#
|
167
|
+
# DL: Delete Line: The block of # lines at and below the cursor are deleted;
|
168
|
+
# all lines below them move up # lines to fill in the gap, leaving # blank
|
169
|
+
# lines at the bottom of the screen. The cursor position is unchanged.
|
170
|
+
# \e[M is equivalent to \e[1M.
|
171
|
+
#
|
172
|
+
# * \e#\@
|
173
|
+
#
|
174
|
+
# ICH: Insert CHaracter: The cursor character and all characters to the right
|
175
|
+
# of it move right # columns, leaving behind blank space.
|
176
|
+
# The cursor position is unchanged. The rightmost # characters on the line are lost.
|
177
|
+
#
|
178
|
+
# * \e[#P
|
179
|
+
#
|
180
|
+
# DCH: Delete CHaracter: The block of # characters at and to the right of the
|
181
|
+
# cursor are deleted; all characters to the right of it move left # columns,
|
182
|
+
# leaving behind blank space. The cursor position is unchanged.
|
183
|
+
# \e[P is equivalent to \e[1P.
|
184
|
+
#
|
185
|
+
#
|
186
|
+
# == Escape sequences for Set Graphics Rendition
|
187
|
+
#
|
188
|
+
# * \e[#;...;#m
|
189
|
+
#
|
190
|
+
# SGM: Set Graphics Mode: Calls the graphics functions specified by the
|
191
|
+
# following values. These specified functions remain active until the next
|
192
|
+
# occurrence of this escape sequence. Graphics mode changes the colors and
|
193
|
+
# attributes of text (such as bold and underline) displayed on the
|
194
|
+
# screen.
|
195
|
+
#
|
196
|
+
# * Text attributes
|
197
|
+
#
|
198
|
+
# 0 All attributes off
|
199
|
+
# 1 Bold on
|
200
|
+
# 4 Underscore on
|
201
|
+
# 7 Reverse video on
|
202
|
+
# 8 Concealed on
|
203
|
+
#
|
204
|
+
# 21 Bold off
|
205
|
+
# 24 Underscore off
|
206
|
+
# 27 Reverse video off
|
207
|
+
# 28 Concealed off
|
208
|
+
#
|
209
|
+
# * Foreground colors
|
210
|
+
#
|
211
|
+
# 30 Black
|
212
|
+
# 31 Red
|
213
|
+
# 32 Green
|
214
|
+
# 33 Yellow
|
215
|
+
# 34 Blue
|
216
|
+
# 35 Magenta
|
217
|
+
# 36 Cyan
|
218
|
+
# 37 White
|
219
|
+
#
|
220
|
+
# * Background colors
|
221
|
+
#
|
222
|
+
# 40 Black
|
223
|
+
# 41 Red
|
224
|
+
# 42 Green
|
225
|
+
# 43 Yellow
|
226
|
+
# 44 Blue
|
227
|
+
# 45 Magenta
|
228
|
+
# 46 Cyan
|
229
|
+
# 47 White
|
230
|
+
#
|
231
|
+
# \e[m is equivalent to \e0m.
|
232
|
+
#
|
233
|
+
# == Escape sequences for Select Character Set
|
234
|
+
#
|
235
|
+
# * \e(U
|
236
|
+
#
|
237
|
+
# Select null mapping - straight to character from the codepage of the console.
|
238
|
+
#
|
239
|
+
# * \e(K
|
240
|
+
#
|
241
|
+
# Select Windows to DOS mapping, if the corresponding map exist; no effect
|
242
|
+
# otherwise. This is the default mapping (if the map exist, of course). It's
|
243
|
+
# useful becarequire "one types the script with a Windows-based editor (using a
|
244
|
+
# Windows codepage) and the script prints its messages on the console using
|
245
|
+
# another codepage: without translation, the characters with a code greatest
|
246
|
+
# than 127 are different and the printed messages may be not readable.
|
247
|
+
#
|
248
|
+
# The conversion is done by the module Encode if it is installed (it's a
|
249
|
+
# standard module with Perl5.8, not Ruby yet). Otherwise, the conversion is limited to the
|
250
|
+
# following couples:
|
251
|
+
#
|
252
|
+
# WinLatin1 (cp1252) to DOSLatin1 (cp850)
|
253
|
+
# WinLatin1 (cp1252) to DOSLatinUS (cp437)
|
254
|
+
# WinLatin2 (cp1250) to DOSLatin2 (cp852)
|
255
|
+
# WinCyrillic(cp1251) to DOSCyrillic (cp855)
|
256
|
+
#
|
257
|
+
# * \e(#X
|
258
|
+
#
|
259
|
+
# This escape sequence is I<not> standard! It's an experimental one, just for
|
260
|
+
# fun :-)
|
261
|
+
#
|
262
|
+
# If <i>and only if</i> the console uses an Unicode police, it is possible to
|
263
|
+
# change its codepage with this escape sequence. No effect with an ordinary
|
264
|
+
# "Raster Font". (For Windows NT/2000/XP the currently available Unicode
|
265
|
+
# console font is the Lucida Console TrueType font.)
|
266
|
+
# # is the number of the codepage needed, 855 for cp855 for instance.
|
267
|
+
#
|
268
|
+
#
|
269
|
+
# = LIMITATIONS
|
270
|
+
#
|
271
|
+
# * Due to DOS-console limitations, the blink mode (text attributes 5 and 25) is not implemented.
|
272
|
+
#
|
273
|
+
# = SEE ALSO
|
274
|
+
#
|
275
|
+
# <b>Win32::Console</b>, <b>Term::ANSIColor</b>, <b>Term::ANSIScreen</b>.
|
276
|
+
#
|
277
|
+
# = AUTHOR
|
278
|
+
#
|
279
|
+
# J-L Morel jl_morel@bribes.org
|
280
|
+
#
|
281
|
+
# Home page: http://www.bribes.org/perl/wANSIConsole.html
|
282
|
+
#
|
283
|
+
# Gonzalo Garramu�o GGarramuno@aol.com Ruby port
|
284
|
+
#
|
285
|
+
# = CREDITS
|
286
|
+
#
|
287
|
+
# Render unto C�sar the things which are C�sar's...
|
288
|
+
#
|
289
|
+
# This module requires the module Win32::Console. Thanks to Aldo Calpini.
|
290
|
+
#
|
291
|
+
# The method used to overload the print function is due to Matt Sergeant
|
292
|
+
# (see his module Win32::ASP).
|
293
|
+
#
|
294
|
+
# = COPYRIGHT
|
295
|
+
#
|
296
|
+
# Copyright (c) 2004 Gonzalo Garramu�o. All rights reserved.
|
297
|
+
# Copyright (c) 2003 J-L Morel. All rights reserved.
|
298
|
+
#
|
299
|
+
# This program is free software; you can redistribute it and/or modify it under
|
300
|
+
# the terms of the Artistic License.
|
301
|
+
#
|
302
|
+
#
|
data/HISTORY.txt
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
v1.0 - Added .dup to _printString function to avoid mangling outside
|
2
|
+
string references. Removed the other (later) .dup call.
|
3
|
+
Turned of some exceptions that were conflicting with using
|
4
|
+
the module with pipes or redirections.
|
5
|
+
v0.8 - Fixed bugs in reading routines, added ruby docs, and
|
6
|
+
sample test suite.
|
7
|
+
v0.5 - First public release.
|
data/INSTALL.txt
ADDED
@@ -0,0 +1,18 @@
|
|
1
|
+
|
2
|
+
To compile and install:
|
3
|
+
|
4
|
+
|
5
|
+
Open a windows console.
|
6
|
+
> vcvars32.bat # to set up microsoft's compiling environment
|
7
|
+
# this is located in the bin/ directory of the MSVC compiler
|
8
|
+
> ruby extconf.rb # to create a Makefile
|
9
|
+
> nmake # to compile
|
10
|
+
> nmake install # to install
|
11
|
+
|
12
|
+
|
13
|
+
To test:
|
14
|
+
|
15
|
+
> cd test
|
16
|
+
> dir # to see available samples
|
17
|
+
> ruby [anysample]
|
18
|
+
|
data/README.txt
ADDED
@@ -0,0 +1,26 @@
|
|
1
|
+
|
2
|
+
This file implements a port of Perl's Win32::Console
|
3
|
+
and Win32::Console::ANSI modules.
|
4
|
+
|
5
|
+
Win32::Console allows controling the windows command line terminal
|
6
|
+
thru an OO-interface. This allows you to query the terminal (find
|
7
|
+
its size, characters, attributes, etc). The interface and functionality
|
8
|
+
should be identical to Perl's.
|
9
|
+
|
10
|
+
Win32::Console consists of a Ruby .rb interface.
|
11
|
+
For best performance, this library has been also ported to C.
|
12
|
+
If you lack a C compiler, you can still use the class thru the ruby
|
13
|
+
interface. If you can compile it, then the ruby interface is not
|
14
|
+
used and the C functions are called instead.
|
15
|
+
|
16
|
+
Win32::Console::ANSI is a class derived from IO that seamlessly
|
17
|
+
translates ANSI Esc control character codes into Windows' command.exe
|
18
|
+
or cmd.exe equivalents.
|
19
|
+
|
20
|
+
These modules allow you to develop command-line tools that can take
|
21
|
+
advantage of the unix terminal functions while still being portable.
|
22
|
+
One of the most common uses for this is to allow to color your
|
23
|
+
output.
|
24
|
+
The modules are disted with Term/ansicolor.rb, too, as it is a nice
|
25
|
+
thing to verify it is working properly.
|
26
|
+
|
data/Rakefile
ADDED
@@ -0,0 +1,38 @@
|
|
1
|
+
require 'rubygems'
|
2
|
+
Gem::manage_gems
|
3
|
+
require 'rake/gempackagetask'
|
4
|
+
|
5
|
+
spec = Gem::Specification.new do |s|
|
6
|
+
s.name = "win32console"
|
7
|
+
s.summary = "A library giving the Win32 console ANSI escape sequence support."
|
8
|
+
s.version = "1.0.8"
|
9
|
+
s.author = "Original Library by Gonzalo Garramuno, Gem by Justin Bailey"
|
10
|
+
s.email = "ggarra @nospam@ advancedsl.com.ar, jgbailey @nospan@ gmail.com"
|
11
|
+
s.homepage = "http://rubyforge.org/projects/winconsole"
|
12
|
+
s.rubyforge_project = "http://rubyforge.org/projects/winconsole"
|
13
|
+
s.description = <<EOS
|
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
|
+
|
16
|
+
http://rubyforge.org/projects/win32console
|
17
|
+
|
18
|
+
The gem project can be found at
|
19
|
+
|
20
|
+
http://rubyforge.org/projects/winconsole
|
21
|
+
EOS
|
22
|
+
|
23
|
+
s.platform = Gem::Platform::CURRENT
|
24
|
+
s.files = FileList["lib/**/*", "test/*", "doc/**/*", "Console*", "*.txt", "Rakefile"].to_a
|
25
|
+
|
26
|
+
s.require_path = "lib"
|
27
|
+
s.autorequire = "win32console"
|
28
|
+
|
29
|
+
s.has_rdoc = true
|
30
|
+
s.extra_rdoc_files = ["lib/README_GEM.txt"]
|
31
|
+
s.rdoc_options << '--title' << 'Win32Console Gem -- Gem for Win32::Console Project' <<
|
32
|
+
'--main' << 'lib/README_GEM.txt' <<
|
33
|
+
'--line-numbers'
|
34
|
+
end
|
35
|
+
|
36
|
+
Rake::GemPackageTask.new(spec) do |pkg|
|
37
|
+
pkg.need_tar = true
|
38
|
+
end
|
@@ -0,0 +1,115 @@
|
|
1
|
+
<?xml version="1.0" encoding="iso-8859-1"?>
|
2
|
+
<!DOCTYPE html
|
3
|
+
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
4
|
+
"DTD/xhtml1-transitional.dtd">
|
5
|
+
|
6
|
+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
7
|
+
<head>
|
8
|
+
<title>Module: Win32</title>
|
9
|
+
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
10
|
+
<meta http-equiv="Content-Script-Type" content="text/javascript" />
|
11
|
+
<link rel="stylesheet" href=".././rdoc-style.css" type="text/css" media="screen" />
|
12
|
+
<script type="text/javascript">
|
13
|
+
// <![CDATA[
|
14
|
+
|
15
|
+
function popupCode( url ) {
|
16
|
+
window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
|
17
|
+
}
|
18
|
+
|
19
|
+
function toggleCode( id ) {
|
20
|
+
if ( document.getElementById )
|
21
|
+
elem = document.getElementById( id );
|
22
|
+
else if ( document.all )
|
23
|
+
elem = eval( "document.all." + id );
|
24
|
+
else
|
25
|
+
return false;
|
26
|
+
|
27
|
+
elemStyle = elem.style;
|
28
|
+
|
29
|
+
if ( elemStyle.display != "block" ) {
|
30
|
+
elemStyle.display = "block"
|
31
|
+
} else {
|
32
|
+
elemStyle.display = "none"
|
33
|
+
}
|
34
|
+
|
35
|
+
return true;
|
36
|
+
}
|
37
|
+
|
38
|
+
// Make codeblocks hidden by default
|
39
|
+
document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
|
40
|
+
|
41
|
+
// ]]>
|
42
|
+
</script>
|
43
|
+
|
44
|
+
</head>
|
45
|
+
<body>
|
46
|
+
|
47
|
+
|
48
|
+
|
49
|
+
<div id="classHeader">
|
50
|
+
<h1>Win32 <sup class="type-note">(Module)</sup></h1>
|
51
|
+
<table class="header-table">
|
52
|
+
<tr class="top-aligned-row">
|
53
|
+
<td><strong>In:</strong></td>
|
54
|
+
<td>
|
55
|
+
<a href="../files/lib\Win32/Console/ANSI_rb.html">
|
56
|
+
lib\Win32/Console/ANSI.rb
|
57
|
+
</a>
|
58
|
+
<br />
|
59
|
+
<a href="../files/lib\Win32/Console_rb.html">
|
60
|
+
lib\Win32/Console.rb
|
61
|
+
</a>
|
62
|
+
<br />
|
63
|
+
<a href="../files/Console_cpp.html">
|
64
|
+
Console.cpp
|
65
|
+
</a>
|
66
|
+
<br />
|
67
|
+
</td>
|
68
|
+
</tr>
|
69
|
+
|
70
|
+
</table>
|
71
|
+
</div>
|
72
|
+
<!-- banner header -->
|
73
|
+
|
74
|
+
<div id="bodyContent">
|
75
|
+
|
76
|
+
|
77
|
+
<div id="contextContent">
|
78
|
+
|
79
|
+
|
80
|
+
|
81
|
+
|
82
|
+
|
83
|
+
|
84
|
+
|
85
|
+
|
86
|
+
<div id="class-list">
|
87
|
+
<h2 class="section-bar">Classes and Modules</h2>
|
88
|
+
|
89
|
+
Class <a href="Win32/Console.html" class="link">Win32::Console</a><br />
|
90
|
+
::Module <a href="Win32/Console/ANSI.html" class="link">Win32::Console::ANSI</a><br />
|
91
|
+
:: ::Class <a href="Win32/Console/ANSI/IO.html" class="link">Win32::Console::ANSI::IO</a><br />
|
92
|
+
::Module <a href="Win32/Console/Constants.html" class="link">Win32::Console::Constants</a><br />
|
93
|
+
::Class <a href="Win32/Console/API.html" class="link">Win32::Console::API</a><br />
|
94
|
+
|
95
|
+
</div>
|
96
|
+
|
97
|
+
</div>
|
98
|
+
|
99
|
+
|
100
|
+
|
101
|
+
<!-- if includes -->
|
102
|
+
|
103
|
+
|
104
|
+
<!-- if method_list -->
|
105
|
+
|
106
|
+
|
107
|
+
</div>
|
108
|
+
|
109
|
+
|
110
|
+
<div id="validator-badges">
|
111
|
+
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
112
|
+
</div>
|
113
|
+
|
114
|
+
</body>
|
115
|
+
</html>
|