clio 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/COPYING +170 -0
- data/HISTORY +11 -0
- data/MANIFEST +181 -0
- data/METADATA +18 -0
- data/NEWS +10 -0
- data/README +52 -0
- data/admin/config/reap.yaml +30 -0
- data/admin/depot/commandline.rb +219 -0
- data/admin/depot/multicommand.rb +403 -0
- data/admin/depot/test_multicommand.rb +40 -0
- data/admin/log/notes.xml +28 -0
- data/admin/log/stats.html +25 -0
- data/admin/log/syntax.log +0 -0
- data/admin/log/testunit.log +16 -0
- data/admin/pack/clio-0.0.1.gem +0 -0
- data/admin/share/reap/example.rb +7 -0
- data/admin/temps/lib/clio/about.rb.erb +4 -0
- data/lib/clio/ansicode.rb +319 -0
- data/lib/clio/command.rb +296 -0
- data/lib/clio/commandable.rb +195 -0
- data/lib/clio/commandline.rb +275 -0
- data/lib/clio/consoleutils.rb +117 -0
- data/lib/clio/errors.rb +16 -0
- data/lib/clio/option.rb +36 -0
- data/lib/clio/progressbar.rb +253 -0
- data/lib/clio/runmode.rb +126 -0
- data/lib/clio/string.rb +147 -0
- data/test/test_command.rb +42 -0
- data/test/test_commandline.rb +83 -0
- data/vendor/Console/Console.cpp +1203 -0
- data/vendor/Console/Console.rdoc +690 -0
- data/vendor/Console/Console_ANSI.rdoc +302 -0
- data/vendor/Console/HISTORY.txt +7 -0
- data/vendor/Console/INSTALL.txt +18 -0
- data/vendor/Console/Makefile +162 -0
- data/vendor/Console/README.txt +26 -0
- data/vendor/Console/doc/classes/Win32.html +115 -0
- data/vendor/Console/doc/classes/Win32/Console.html +650 -0
- data/vendor/Console/doc/classes/Win32/Console.src/M000001.html +31 -0
- data/vendor/Console/doc/classes/Win32/Console.src/M000002.html +23 -0
- data/vendor/Console/doc/classes/Win32/Console.src/M000003.html +23 -0
- data/vendor/Console/doc/classes/Win32/Console.src/M000004.html +27 -0
- data/vendor/Console/doc/classes/Win32/Console.src/M000005.html +23 -0
- data/vendor/Console/doc/classes/Win32/Console.src/M000006.html +28 -0
- data/vendor/Console/doc/classes/Win32/Console.src/M000007.html +23 -0
- data/vendor/Console/doc/classes/Win32/Console.src/M000008.html +24 -0
- data/vendor/Console/doc/classes/Win32/Console.src/M000009.html +44 -0
- data/vendor/Console/doc/classes/Win32/Console.src/M000010.html +23 -0
- data/vendor/Console/doc/classes/Win32/Console.src/M000011.html +33 -0
- data/vendor/Console/doc/classes/Win32/Console.src/M000012.html +26 -0
- data/vendor/Console/doc/classes/Win32/Console.src/M000013.html +27 -0
- data/vendor/Console/doc/classes/Win32/Console.src/M000014.html +28 -0
- data/vendor/Console/doc/classes/Win32/Console.src/M000015.html +23 -0
- data/vendor/Console/doc/classes/Win32/Console.src/M000016.html +23 -0
- data/vendor/Console/doc/classes/Win32/Console.src/M000017.html +23 -0
- data/vendor/Console/doc/classes/Win32/Console.src/M000018.html +29 -0
- data/vendor/Console/doc/classes/Win32/Console.src/M000019.html +23 -0
- data/vendor/Console/doc/classes/Win32/Console.src/M000020.html +23 -0
- data/vendor/Console/doc/classes/Win32/Console.src/M000021.html +28 -0
- data/vendor/Console/doc/classes/Win32/Console.src/M000022.html +23 -0
- data/vendor/Console/doc/classes/Win32/Console.src/M000023.html +28 -0
- data/vendor/Console/doc/classes/Win32/Console.src/M000024.html +35 -0
- data/vendor/Console/doc/classes/Win32/Console.src/M000025.html +28 -0
- data/vendor/Console/doc/classes/Win32/Console.src/M000026.html +28 -0
- data/vendor/Console/doc/classes/Win32/Console.src/M000027.html +28 -0
- data/vendor/Console/doc/classes/Win32/Console.src/M000028.html +31 -0
- data/vendor/Console/doc/classes/Win32/Console.src/M000029.html +23 -0
- data/vendor/Console/doc/classes/Win32/Console.src/M000030.html +23 -0
- data/vendor/Console/doc/classes/Win32/Console.src/M000031.html +23 -0
- data/vendor/Console/doc/classes/Win32/Console.src/M000032.html +27 -0
- data/vendor/Console/doc/classes/Win32/Console.src/M000033.html +27 -0
- data/vendor/Console/doc/classes/Win32/Console.src/M000034.html +25 -0
- data/vendor/Console/doc/classes/Win32/Console/ANSI.html +103 -0
- data/vendor/Console/doc/classes/Win32/Console/ANSI/IO.html +220 -0
- data/vendor/Console/doc/classes/Win32/Console/ANSI/IO.src/M000035.html +32 -0
- data/vendor/Console/doc/classes/Win32/Console/ANSI/IO.src/M000036.html +205 -0
- data/vendor/Console/doc/classes/Win32/Console/ANSI/IO.src/M000037.html +40 -0
- data/vendor/Console/doc/classes/Win32/Console/ANSI/IO.src/M000038.html +25 -0
- data/vendor/Console/doc/classes/Win32/Console/API.html +758 -0
- data/vendor/Console/doc/classes/Win32/Console/API.src/M000039.html +27 -0
- data/vendor/Console/doc/classes/Win32/Console/API.src/M000040.html +27 -0
- data/vendor/Console/doc/classes/Win32/Console/API.src/M000041.html +27 -0
- data/vendor/Console/doc/classes/Win32/Console/API.src/M000042.html +32 -0
- data/vendor/Console/doc/classes/Win32/Console/API.src/M000043.html +32 -0
- data/vendor/Console/doc/classes/Win32/Console/API.src/M000044.html +28 -0
- data/vendor/Console/doc/classes/Win32/Console/API.src/M000045.html +26 -0
- data/vendor/Console/doc/classes/Win32/Console/API.src/M000046.html +26 -0
- data/vendor/Console/doc/classes/Win32/Console/API.src/M000047.html +27 -0
- data/vendor/Console/doc/classes/Win32/Console/API.src/M000048.html +30 -0
- data/vendor/Console/doc/classes/Win32/Console/API.src/M000049.html +29 -0
- data/vendor/Console/doc/classes/Win32/Console/API.src/M000050.html +27 -0
- data/vendor/Console/doc/classes/Win32/Console/API.src/M000051.html +28 -0
- data/vendor/Console/doc/classes/Win32/Console/API.src/M000052.html +30 -0
- data/vendor/Console/doc/classes/Win32/Console/API.src/M000053.html +27 -0
- data/vendor/Console/doc/classes/Win32/Console/API.src/M000054.html +29 -0
- data/vendor/Console/doc/classes/Win32/Console/API.src/M000055.html +29 -0
- data/vendor/Console/doc/classes/Win32/Console/API.src/M000056.html +28 -0
- data/vendor/Console/doc/classes/Win32/Console/API.src/M000057.html +27 -0
- data/vendor/Console/doc/classes/Win32/Console/API.src/M000058.html +47 -0
- data/vendor/Console/doc/classes/Win32/Console/API.src/M000059.html +32 -0
- data/vendor/Console/doc/classes/Win32/Console/API.src/M000060.html +47 -0
- data/vendor/Console/doc/classes/Win32/Console/API.src/M000061.html +34 -0
- data/vendor/Console/doc/classes/Win32/Console/API.src/M000062.html +32 -0
- data/vendor/Console/doc/classes/Win32/Console/API.src/M000063.html +32 -0
- data/vendor/Console/doc/classes/Win32/Console/API.src/M000064.html +35 -0
- data/vendor/Console/doc/classes/Win32/Console/API.src/M000065.html +26 -0
- data/vendor/Console/doc/classes/Win32/Console/API.src/M000066.html +27 -0
- data/vendor/Console/doc/classes/Win32/Console/API.src/M000067.html +29 -0
- data/vendor/Console/doc/classes/Win32/Console/API.src/M000068.html +27 -0
- data/vendor/Console/doc/classes/Win32/Console/API.src/M000069.html +27 -0
- data/vendor/Console/doc/classes/Win32/Console/API.src/M000070.html +28 -0
- data/vendor/Console/doc/classes/Win32/Console/API.src/M000071.html +27 -0
- data/vendor/Console/doc/classes/Win32/Console/API.src/M000072.html +26 -0
- data/vendor/Console/doc/classes/Win32/Console/API.src/M000073.html +27 -0
- data/vendor/Console/doc/classes/Win32/Console/API.src/M000074.html +31 -0
- data/vendor/Console/doc/classes/Win32/Console/API.src/M000075.html +27 -0
- data/vendor/Console/doc/classes/Win32/Console/API.src/M000076.html +32 -0
- data/vendor/Console/doc/classes/Win32/Console/API.src/M000077.html +27 -0
- data/vendor/Console/doc/classes/Win32/Console/API.src/M000078.html +32 -0
- data/vendor/Console/doc/classes/Win32/Console/API.src/M000079.html +32 -0
- data/vendor/Console/doc/classes/Win32/Console/API.src/M000080.html +32 -0
- data/vendor/Console/doc/classes/Win32/Console/Constants.html +360 -0
- data/vendor/Console/doc/created.rid +1 -0
- data/vendor/Console/doc/files/Console_ANSI_rdoc.html +407 -0
- data/vendor/Console/doc/files/Console_cpp.html +104 -0
- data/vendor/Console/doc/files/Console_rdoc.html +964 -0
- data/vendor/Console/doc/files/lib/Win32/Console/ANSI_rb.html +123 -0
- data/vendor/Console/doc/files/lib/Win32/Console_rb.html +297 -0
- data/vendor/Console/doc/fr_class_index.html +32 -0
- data/vendor/Console/doc/fr_file_index.html +31 -0
- data/vendor/Console/doc/fr_method_index.html +106 -0
- data/vendor/Console/doc/index.html +24 -0
- data/vendor/Console/doc/rdoc-style.css +172 -0
- data/vendor/Console/extconf.rb +18 -0
- data/vendor/Console/lib/Term/ansicolor.rb +76 -0
- data/vendor/Console/lib/Win32/Console.rb +970 -0
- data/vendor/Console/lib/Win32/Console/ANSI.rb +305 -0
- data/vendor/Console/test/test_cursor.rb +9 -0
- data/vendor/Console/test/test_mouse.rb +6 -0
- data/vendor/Console/test/test_readinput.rb +62 -0
- data/vendor/Console/test/test_readoutput.rb +52 -0
- data/vendor/Console/test/test_sendevent.rb +17 -0
- data/vendor/Console/test/test_title.rb +14 -0
- data/vendor/Console/test/test_write.rb +36 -0
- metadata +253 -0
@@ -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
|
+
#
|
@@ -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.
|
@@ -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
|
+
|
@@ -0,0 +1,162 @@
|
|
1
|
+
|
2
|
+
SHELL = /bin/sh
|
3
|
+
|
4
|
+
#### Start of system configuration section. ####
|
5
|
+
|
6
|
+
srcdir = C:/ruby/visualc/Console
|
7
|
+
topdir = $(rubylibdir)/$(arch)
|
8
|
+
hdrdir = $(rubylibdir)/$(arch)
|
9
|
+
VPATH = $(srcdir)
|
10
|
+
|
11
|
+
DESTDIR = c:
|
12
|
+
prefix = $(DESTDIR)/ruby
|
13
|
+
exec_prefix = $(prefix)
|
14
|
+
bindir = $(exec_prefix)/bin
|
15
|
+
sitelibdir = $(sitedir)/$(ruby_version)
|
16
|
+
datadir = $(prefix)/share
|
17
|
+
sitedir = $(prefix)/lib/ruby/site_ruby
|
18
|
+
sharedstatedir = $(DESTDIR)/etc
|
19
|
+
archdir = $(rubylibdir)/$(arch)
|
20
|
+
localstatedir = $(DESTDIR)/var
|
21
|
+
infodir = $(prefix)/info
|
22
|
+
oldincludedir = $(DESTDIR)/usr/include
|
23
|
+
libexecdir = $(exec_prefix)/libexec
|
24
|
+
compile_dir = $(DESTDIR)/WINDOWS/Escritorio/Programacion/ruby/win32
|
25
|
+
sbindir = $(exec_prefix)/sbin
|
26
|
+
includedir = $(prefix)/include
|
27
|
+
sysconfdir = $(prefix)/etc
|
28
|
+
sitearchdir = $(sitelibdir)/$(sitearch)
|
29
|
+
mandir = $(prefix)/man
|
30
|
+
libdir = $(exec_prefix)/lib
|
31
|
+
rubylibdir = $(libdir)/ruby/$(ruby_version)
|
32
|
+
|
33
|
+
CC = cl -nologo
|
34
|
+
LIBRUBY = $(RUBY_SO_NAME).lib
|
35
|
+
LIBRUBY_A = $(RUBY_SO_NAME)-static.lib
|
36
|
+
LIBRUBYARG_SHARED = $(LIBRUBY)
|
37
|
+
LIBRUBYARG_STATIC = $(LIBRUBY_A)
|
38
|
+
|
39
|
+
CFLAGS = -MD -Zi -O2b2xg- -G6
|
40
|
+
CPPFLAGS = -I. -I$(topdir) -I$(hdrdir) -I$(srcdir) -I. -I./.. -I./../missing
|
41
|
+
CXXFLAGS = $(CFLAGS)
|
42
|
+
DLDFLAGS = -link -incremental:no -debug -opt:ref -opt:icf -dll $(LIBPATH) -def:$(DEFFILE)
|
43
|
+
LDSHARED = cl -nologo -LD
|
44
|
+
AR = lib -nologo
|
45
|
+
EXEEXT = .exe
|
46
|
+
|
47
|
+
RUBY_INSTALL_NAME = ruby
|
48
|
+
RUBY_SO_NAME = msvcrt-ruby18
|
49
|
+
arch = i386-mswin32
|
50
|
+
sitearch = i386-msvcrt
|
51
|
+
ruby_version = 1.8
|
52
|
+
RUBY = ruby
|
53
|
+
RM = $(RUBY) -run -e rm -- -f
|
54
|
+
MAKEDIRS = $(RUBY) -run -e mkdir -- -p
|
55
|
+
INSTALL_PROG = $(RUBY) -run -e install -- -vpm 0755
|
56
|
+
INSTALL_DATA = $(RUBY) -run -e install -- -vpm 0644
|
57
|
+
|
58
|
+
#### End of system configuration section. ####
|
59
|
+
|
60
|
+
|
61
|
+
LIBPATH = -libpath:"$(libdir)"
|
62
|
+
DEFFILE = $(TARGET)-$(arch).def
|
63
|
+
|
64
|
+
CLEANFILES =
|
65
|
+
DISTCLEANFILES = $(DEFFILE)
|
66
|
+
|
67
|
+
target_prefix =
|
68
|
+
LOCAL_LIBS =
|
69
|
+
LIBS = $(LIBRUBYARG_SHARED) oldnames.lib user32.lib advapi32.lib wsock32.lib
|
70
|
+
OBJS = Console.obj
|
71
|
+
TARGET = Console
|
72
|
+
DLLIB = $(TARGET).so
|
73
|
+
STATIC_LIB = $(TARGET).lib
|
74
|
+
|
75
|
+
RUBYCOMMONDIR = $(sitedir)$(target_prefix)
|
76
|
+
RUBYLIBDIR = $(sitelibdir)$(target_prefix)
|
77
|
+
RUBYARCHDIR = $(sitearchdir)$(target_prefix)
|
78
|
+
|
79
|
+
CLEANLIBS = "$(TARGET).{lib,exp,il?,tds,map}" $(DLLIB)
|
80
|
+
CLEANOBJS = "*.{obj,lib,s[ol],pdb,bak}"
|
81
|
+
|
82
|
+
all: $(DLLIB)
|
83
|
+
static: $(STATIC_LIB)
|
84
|
+
|
85
|
+
clean:
|
86
|
+
@$(RM) $(CLEANLIBS) $(CLEANOBJS) $(CLEANFILES)
|
87
|
+
|
88
|
+
distclean: clean
|
89
|
+
@$(RM) Makefile extconf.h conftest.* mkmf.log
|
90
|
+
@$(RM) core ruby$(EXEEXT) *~ $(DISTCLEANFILES)
|
91
|
+
|
92
|
+
realclean: distclean
|
93
|
+
install: $(RUBYARCHDIR)
|
94
|
+
install: $(RUBYARCHDIR)/$(DLLIB)
|
95
|
+
$(RUBYARCHDIR)/$(DLLIB): $(DLLIB) $(RUBYARCHDIR)
|
96
|
+
@$(INSTALL_PROG) $(DLLIB) $(RUBYARCHDIR)
|
97
|
+
install: $(RUBYLIBDIR)/Win32
|
98
|
+
install: $(RUBYLIBDIR)/Win32/Console.rb
|
99
|
+
$(RUBYLIBDIR)/Win32/Console.rb: $(srcdir)/lib/Win32/Console.rb $(RUBYLIBDIR)/Win32
|
100
|
+
@$(INSTALL_DATA) $(srcdir)/lib/Win32/Console.rb $(RUBYLIBDIR)/Win32
|
101
|
+
install: $(RUBYLIBDIR)/Win32/Console
|
102
|
+
install: $(RUBYLIBDIR)/Win32/Console/ANSI.rb
|
103
|
+
$(RUBYLIBDIR)/Win32/Console/ANSI.rb: $(srcdir)/lib/Win32/Console/ANSI.rb $(RUBYLIBDIR)/Win32/Console
|
104
|
+
@$(INSTALL_DATA) $(srcdir)/lib/Win32/Console/ANSI.rb $(RUBYLIBDIR)/Win32/Console
|
105
|
+
install: $(RUBYLIBDIR)/Term
|
106
|
+
install: $(RUBYLIBDIR)/Term/ansicolor.rb
|
107
|
+
$(RUBYLIBDIR)/Term/ansicolor.rb: $(srcdir)/lib/Term/ansicolor.rb $(RUBYLIBDIR)/Term
|
108
|
+
@$(INSTALL_DATA) $(srcdir)/lib/Term/ansicolor.rb $(RUBYLIBDIR)/Term
|
109
|
+
$(RUBYARCHDIR):
|
110
|
+
@$(MAKEDIRS) $(RUBYARCHDIR)
|
111
|
+
$(RUBYLIBDIR)/Win32:
|
112
|
+
@$(MAKEDIRS) $(RUBYLIBDIR)/Win32
|
113
|
+
$(RUBYLIBDIR)/Win32/Console:
|
114
|
+
@$(MAKEDIRS) $(RUBYLIBDIR)/Win32/Console
|
115
|
+
$(RUBYLIBDIR)/Term:
|
116
|
+
@$(MAKEDIRS) $(RUBYLIBDIR)/Term
|
117
|
+
|
118
|
+
site-install: install
|
119
|
+
|
120
|
+
.SUFFIXES: .c .cc .m .cxx .cpp .C .obj
|
121
|
+
|
122
|
+
{$(srcdir)}.cc{}.obj:
|
123
|
+
$(CXX) $(CXXFLAGS) $(CPPFLAGS) -c -Tp$(<:\=/)
|
124
|
+
|
125
|
+
.cc.obj:
|
126
|
+
$(CXX) $(CXXFLAGS) $(CPPFLAGS) -c -Tp$(<:\=/)
|
127
|
+
|
128
|
+
{$(srcdir)}.cpp{}.obj:
|
129
|
+
$(CXX) $(CXXFLAGS) $(CPPFLAGS) -c -Tp$(<:\=/)
|
130
|
+
|
131
|
+
.cpp.obj:
|
132
|
+
$(CXX) $(CXXFLAGS) $(CPPFLAGS) -c -Tp$(<:\=/)
|
133
|
+
|
134
|
+
{$(srcdir)}.cxx{}.obj:
|
135
|
+
$(CXX) $(CXXFLAGS) $(CPPFLAGS) -c -Tp$(<:\=/)
|
136
|
+
|
137
|
+
.cxx.obj:
|
138
|
+
$(CXX) $(CXXFLAGS) $(CPPFLAGS) -c -Tp$(<:\=/)
|
139
|
+
|
140
|
+
{$(srcdir)}.C{}.obj:
|
141
|
+
$(CXX) $(CXXFLAGS) $(CPPFLAGS) -c -Tp$(<:\=/)
|
142
|
+
|
143
|
+
.C.obj:
|
144
|
+
$(CXX) $(CXXFLAGS) $(CPPFLAGS) -c -Tp$(<:\=/)
|
145
|
+
|
146
|
+
{$(srcdir)}.c{}.obj:
|
147
|
+
$(CC) $(CFLAGS) $(CPPFLAGS) -c -Tc$(<:\=/)
|
148
|
+
|
149
|
+
.c.obj:
|
150
|
+
$(CC) $(CFLAGS) $(CPPFLAGS) -c -Tc$(<:\=/)
|
151
|
+
|
152
|
+
$(DLLIB): $(OBJS) $(DEFFILE)
|
153
|
+
@-$(RM) $@
|
154
|
+
@-$(RM) $(TARGET).lib
|
155
|
+
$(LDSHARED) -Fe$(@) $(OBJS) $(LIBS) $(LOCAL_LIBS) $(DLDFLAGS)
|
156
|
+
|
157
|
+
$(STATIC_LIB): $(OBJS)
|
158
|
+
$(AR) -machine:x86 -out:$@ $(OBJS)
|
159
|
+
|
160
|
+
$(DEFFILE):
|
161
|
+
$(RUBY) -e "puts 'EXPORTS', 'Init_$(TARGET)'" > $@
|
162
|
+
|