rubytext 0.1.22 → 0.1.26
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/examples/topmenu.rb +56 -0
- data/lib/.yardoc/checksums +11 -0
- data/lib/.yardoc/complete +0 -0
- data/lib/.yardoc/object_types +0 -0
- data/lib/.yardoc/objects/root.dat +0 -0
- data/lib/.yardoc/proxy_types +0 -0
- data/lib/color.rb +22 -0
- data/lib/doc/RubyText/Color.html +366 -0
- data/lib/doc/RubyText/Effects.html +658 -0
- data/lib/doc/RubyText/Keys.html +300 -0
- data/lib/doc/RubyText/Settings.html +593 -0
- data/lib/doc/RubyText/Window/GetString.html +812 -0
- data/lib/doc/RubyText/Window.html +5074 -0
- data/lib/doc/RubyText.html +1410 -0
- data/lib/doc/WindowIO.html +541 -0
- data/lib/doc/_index.html +195 -0
- data/lib/doc/class_list.html +51 -0
- data/lib/doc/css/common.css +1 -0
- data/lib/doc/css/full_list.css +58 -0
- data/lib/doc/css/style.css +496 -0
- data/lib/doc/file_list.html +51 -0
- data/lib/doc/frames.html +17 -0
- data/lib/doc/index.html +195 -0
- data/lib/doc/js/app.js +314 -0
- data/lib/doc/js/full_list.js +216 -0
- data/lib/doc/js/jquery.js +4 -0
- data/lib/doc/method_list.html +987 -0
- data/lib/doc/top-level-namespace.html +483 -0
- data/lib/effects.rb +15 -1
- data/lib/keys.rb +3 -0
- data/lib/menu.rb +410 -17
- data/lib/navigation.rb +35 -0
- data/lib/output.rb +18 -4
- data/lib/rubytext_version.rb +1 -1
- data/lib/settings.rb +5 -4
- data/lib/widgets.rb +10 -2
- data/lib/window.rb +1 -0
- data/rubytext.gemspec +2 -1
- metadata +35 -14
@@ -0,0 +1,483 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<meta charset="utf-8">
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
6
|
+
<title>
|
7
|
+
Top Level Namespace
|
8
|
+
|
9
|
+
— Documentation by YARD 0.9.24
|
10
|
+
|
11
|
+
</title>
|
12
|
+
|
13
|
+
<link rel="stylesheet" href="css/style.css" type="text/css" />
|
14
|
+
|
15
|
+
<link rel="stylesheet" href="css/common.css" type="text/css" />
|
16
|
+
|
17
|
+
<script type="text/javascript">
|
18
|
+
pathId = "";
|
19
|
+
relpath = '';
|
20
|
+
</script>
|
21
|
+
|
22
|
+
|
23
|
+
<script type="text/javascript" charset="utf-8" src="js/jquery.js"></script>
|
24
|
+
|
25
|
+
<script type="text/javascript" charset="utf-8" src="js/app.js"></script>
|
26
|
+
|
27
|
+
|
28
|
+
</head>
|
29
|
+
<body>
|
30
|
+
<div class="nav_wrap">
|
31
|
+
<iframe id="nav" src="class_list.html?1"></iframe>
|
32
|
+
<div id="resizer"></div>
|
33
|
+
</div>
|
34
|
+
|
35
|
+
<div id="main" tabindex="-1">
|
36
|
+
<div id="header">
|
37
|
+
<div id="menu">
|
38
|
+
|
39
|
+
<a href="_index.html">Index</a> »
|
40
|
+
|
41
|
+
|
42
|
+
<span class="title">Top Level Namespace</span>
|
43
|
+
|
44
|
+
</div>
|
45
|
+
|
46
|
+
<div id="search">
|
47
|
+
|
48
|
+
<a class="full_list_link" id="class_list_link"
|
49
|
+
href="class_list.html">
|
50
|
+
|
51
|
+
<svg width="24" height="24">
|
52
|
+
<rect x="0" y="4" width="24" height="4" rx="1" ry="1"></rect>
|
53
|
+
<rect x="0" y="12" width="24" height="4" rx="1" ry="1"></rect>
|
54
|
+
<rect x="0" y="20" width="24" height="4" rx="1" ry="1"></rect>
|
55
|
+
</svg>
|
56
|
+
</a>
|
57
|
+
|
58
|
+
</div>
|
59
|
+
<div class="clear"></div>
|
60
|
+
</div>
|
61
|
+
|
62
|
+
<div id="content"><h1>Top Level Namespace
|
63
|
+
|
64
|
+
|
65
|
+
|
66
|
+
</h1>
|
67
|
+
<div class="box_info">
|
68
|
+
|
69
|
+
|
70
|
+
|
71
|
+
|
72
|
+
|
73
|
+
|
74
|
+
|
75
|
+
|
76
|
+
|
77
|
+
|
78
|
+
|
79
|
+
</div>
|
80
|
+
|
81
|
+
<h2>Defined Under Namespace</h2>
|
82
|
+
<p class="children">
|
83
|
+
|
84
|
+
|
85
|
+
<strong class="modules">Modules:</strong> <span class='object_link'><a href="RubyText.html" title="RubyText (module)">RubyText</a></span>, <span class='object_link'><a href="WindowIO.html" title="WindowIO (module)">WindowIO</a></span>
|
86
|
+
|
87
|
+
|
88
|
+
|
89
|
+
|
90
|
+
</p>
|
91
|
+
|
92
|
+
|
93
|
+
<h2>
|
94
|
+
Constant Summary
|
95
|
+
<small><a href="#" class="constants_summary_toggle">collapse</a></small>
|
96
|
+
</h2>
|
97
|
+
|
98
|
+
<dl class="constants">
|
99
|
+
|
100
|
+
<dt id="Colors-constant" class="">Colors =
|
101
|
+
|
102
|
+
</dt>
|
103
|
+
<dd><pre class="code"><span class='lbracket'>[</span><span class='const'>Black</span><span class='comma'>,</span> <span class='const'>Blue</span><span class='comma'>,</span> <span class='const'>Cyan</span><span class='comma'>,</span> <span class='const'>Green</span><span class='comma'>,</span> <span class='const'>Magenta</span><span class='comma'>,</span> <span class='const'>Red</span><span class='comma'>,</span> <span class='const'>White</span><span class='comma'>,</span> <span class='const'>Yellow</span><span class='rbracket'>]</span></pre></dd>
|
104
|
+
|
105
|
+
</dl>
|
106
|
+
|
107
|
+
|
108
|
+
|
109
|
+
|
110
|
+
|
111
|
+
|
112
|
+
|
113
|
+
|
114
|
+
|
115
|
+
<h2>
|
116
|
+
Instance Method Summary
|
117
|
+
<small><a href="#" class="summary_toggle">collapse</a></small>
|
118
|
+
</h2>
|
119
|
+
|
120
|
+
<ul class="summary">
|
121
|
+
|
122
|
+
<li class="public ">
|
123
|
+
<span class="summary_signature">
|
124
|
+
|
125
|
+
<a href="top-level-namespace.html#debug-instance_method" title="#debug (instance method)">#<strong>debug</strong>(*args) ⇒ Object </a>
|
126
|
+
|
127
|
+
|
128
|
+
|
129
|
+
</span>
|
130
|
+
|
131
|
+
|
132
|
+
|
133
|
+
|
134
|
+
|
135
|
+
|
136
|
+
|
137
|
+
|
138
|
+
|
139
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
140
|
+
|
141
|
+
</li>
|
142
|
+
|
143
|
+
|
144
|
+
<li class="public ">
|
145
|
+
<span class="summary_signature">
|
146
|
+
|
147
|
+
<a href="top-level-namespace.html#debugging-instance_method" title="#debugging (instance method)">#<strong>debugging</strong>(onoff) ⇒ Object </a>
|
148
|
+
|
149
|
+
|
150
|
+
|
151
|
+
</span>
|
152
|
+
|
153
|
+
|
154
|
+
|
155
|
+
|
156
|
+
|
157
|
+
|
158
|
+
|
159
|
+
|
160
|
+
|
161
|
+
<span class="summary_desc"><div class='inline'>
|
162
|
+
<p>TODO more…</p>
|
163
|
+
</div></span>
|
164
|
+
|
165
|
+
</li>
|
166
|
+
|
167
|
+
|
168
|
+
<li class="public ">
|
169
|
+
<span class="summary_signature">
|
170
|
+
|
171
|
+
<a href="top-level-namespace.html#fx-instance_method" title="#fx (instance method)">#<strong>fx</strong>(str, *args, bg: nil) ⇒ Object </a>
|
172
|
+
|
173
|
+
|
174
|
+
|
175
|
+
</span>
|
176
|
+
|
177
|
+
|
178
|
+
|
179
|
+
|
180
|
+
|
181
|
+
|
182
|
+
|
183
|
+
|
184
|
+
|
185
|
+
<span class="summary_desc"><div class='inline'>
|
186
|
+
<p>Helper method: insert text effects while printing.</p>
|
187
|
+
</div></span>
|
188
|
+
|
189
|
+
</li>
|
190
|
+
|
191
|
+
|
192
|
+
<li class="public ">
|
193
|
+
<span class="summary_signature">
|
194
|
+
|
195
|
+
<a href="top-level-namespace.html#import-instance_method" title="#import (instance method)">#<strong>import</strong>(meth, recv) ⇒ Object </a>
|
196
|
+
|
197
|
+
|
198
|
+
|
199
|
+
</span>
|
200
|
+
|
201
|
+
|
202
|
+
|
203
|
+
|
204
|
+
|
205
|
+
|
206
|
+
|
207
|
+
|
208
|
+
|
209
|
+
<span class="summary_desc"><div class='inline'>
|
210
|
+
<p>FIXME lots of changes to make here…</p>
|
211
|
+
</div></span>
|
212
|
+
|
213
|
+
</li>
|
214
|
+
|
215
|
+
|
216
|
+
<li class="public ">
|
217
|
+
<span class="summary_signature">
|
218
|
+
|
219
|
+
<a href="top-level-namespace.html#make_exception-instance_method" title="#make_exception (instance method)">#<strong>make_exception</strong>(sym, str) ⇒ Object </a>
|
220
|
+
|
221
|
+
|
222
|
+
|
223
|
+
</span>
|
224
|
+
|
225
|
+
|
226
|
+
|
227
|
+
|
228
|
+
|
229
|
+
|
230
|
+
|
231
|
+
|
232
|
+
|
233
|
+
<span class="summary_desc"><div class='inline'>
|
234
|
+
<p>FIXME refactor.</p>
|
235
|
+
</div></span>
|
236
|
+
|
237
|
+
</li>
|
238
|
+
|
239
|
+
|
240
|
+
</ul>
|
241
|
+
|
242
|
+
|
243
|
+
|
244
|
+
|
245
|
+
<div id="instance_method_details" class="method_details_list">
|
246
|
+
<h2>Instance Method Details</h2>
|
247
|
+
|
248
|
+
|
249
|
+
<div class="method_details first">
|
250
|
+
<h3 class="signature first" id="debug-instance_method">
|
251
|
+
|
252
|
+
#<strong>debug</strong>(*args) ⇒ <tt>Object</tt>
|
253
|
+
|
254
|
+
|
255
|
+
|
256
|
+
|
257
|
+
|
258
|
+
</h3><table class="source_code">
|
259
|
+
<tr>
|
260
|
+
<td>
|
261
|
+
<pre class="lines">
|
262
|
+
|
263
|
+
|
264
|
+
60
|
265
|
+
61
|
266
|
+
62
|
267
|
+
63
|
268
|
+
64
|
269
|
+
65</pre>
|
270
|
+
</td>
|
271
|
+
<td>
|
272
|
+
<pre class="code"><span class="info file"># File 'rubytext.rb', line 60</span>
|
273
|
+
|
274
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_debug'>debug</span><span class='lparen'>(</span><span class='op'>*</span><span class='id identifier rubyid_args'>args</span><span class='rparen'>)</span>
|
275
|
+
<span class='kw'>return</span> <span class='kw'>unless</span> <span class='gvar'>$debugging</span>
|
276
|
+
<span class='kw'>return</span> <span class='kw'>unless</span> <span class='gvar'>$debug</span> <span class='comment'># FIXME eschew global?
|
277
|
+
</span> <span class='gvar'>$debug</span><span class='period'>.</span><span class='id identifier rubyid_puts'>puts</span> <span class='op'>*</span><span class='id identifier rubyid_args'>args</span>
|
278
|
+
<span class='gvar'>$debug</span><span class='period'>.</span><span class='id identifier rubyid_flush'>flush</span>
|
279
|
+
<span class='kw'>end</span></pre>
|
280
|
+
</td>
|
281
|
+
</tr>
|
282
|
+
</table>
|
283
|
+
</div>
|
284
|
+
|
285
|
+
<div class="method_details ">
|
286
|
+
<h3 class="signature " id="debugging-instance_method">
|
287
|
+
|
288
|
+
#<strong>debugging</strong>(onoff) ⇒ <tt>Object</tt>
|
289
|
+
|
290
|
+
|
291
|
+
|
292
|
+
|
293
|
+
|
294
|
+
</h3><div class="docstring">
|
295
|
+
<div class="discussion">
|
296
|
+
|
297
|
+
<p>TODO more…</p>
|
298
|
+
|
299
|
+
|
300
|
+
</div>
|
301
|
+
</div>
|
302
|
+
<div class="tags">
|
303
|
+
|
304
|
+
|
305
|
+
</div><table class="source_code">
|
306
|
+
<tr>
|
307
|
+
<td>
|
308
|
+
<pre class="lines">
|
309
|
+
|
310
|
+
|
311
|
+
56
|
312
|
+
57
|
313
|
+
58</pre>
|
314
|
+
</td>
|
315
|
+
<td>
|
316
|
+
<pre class="code"><span class="info file"># File 'rubytext.rb', line 56</span>
|
317
|
+
|
318
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_debugging'>debugging</span><span class='lparen'>(</span><span class='id identifier rubyid_onoff'>onoff</span><span class='rparen'>)</span>
|
319
|
+
<span class='gvar'>$debugging</span> <span class='op'>=</span> <span class='id identifier rubyid_onoff'>onoff</span> <span class='comment'># FIXME eschew global?
|
320
|
+
</span><span class='kw'>end</span></pre>
|
321
|
+
</td>
|
322
|
+
</tr>
|
323
|
+
</table>
|
324
|
+
</div>
|
325
|
+
|
326
|
+
<div class="method_details ">
|
327
|
+
<h3 class="signature " id="fx-instance_method">
|
328
|
+
|
329
|
+
#<strong>fx</strong>(str, *args, bg: nil) ⇒ <tt>Object</tt>
|
330
|
+
|
331
|
+
|
332
|
+
|
333
|
+
|
334
|
+
|
335
|
+
</h3><div class="docstring">
|
336
|
+
<div class="discussion">
|
337
|
+
|
338
|
+
<p>Helper method: insert text effects while printing</p>
|
339
|
+
|
340
|
+
|
341
|
+
</div>
|
342
|
+
</div>
|
343
|
+
<div class="tags">
|
344
|
+
|
345
|
+
|
346
|
+
</div><table class="source_code">
|
347
|
+
<tr>
|
348
|
+
<td>
|
349
|
+
<pre class="lines">
|
350
|
+
|
351
|
+
|
352
|
+
4
|
353
|
+
5
|
354
|
+
6
|
355
|
+
7
|
356
|
+
8</pre>
|
357
|
+
</td>
|
358
|
+
<td>
|
359
|
+
<pre class="code"><span class="info file"># File 'effects.rb', line 4</span>
|
360
|
+
|
361
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_fx'>fx</span><span class='lparen'>(</span><span class='id identifier rubyid_str'>str</span><span class='comma'>,</span> <span class='op'>*</span><span class='id identifier rubyid_args'>args</span><span class='comma'>,</span> <span class='label'>bg:</span> <span class='kw'>nil</span><span class='rparen'>)</span>
|
362
|
+
<span class='id identifier rubyid_eff'>eff</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="RubyText.html" title="RubyText (module)">RubyText</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="RubyText/Effects.html" title="RubyText::Effects (class)">Effects</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="RubyText/Effects.html#initialize-instance_method" title="RubyText::Effects#initialize (method)">new</a></span></span><span class='lparen'>(</span><span class='op'>*</span><span class='id identifier rubyid_args'>args</span><span class='comma'>,</span> <span class='label'>bg:</span> <span class='id identifier rubyid_bg'>bg</span><span class='rparen'>)</span>
|
363
|
+
<span class='id identifier rubyid_str'>str</span><span class='period'>.</span><span class='id identifier rubyid_define_singleton_method'>define_singleton_method</span><span class='lparen'>(</span><span class='symbol'>:effect</span><span class='rparen'>)</span> <span class='lbrace'>{</span> <span class='id identifier rubyid_eff'>eff</span> <span class='rbrace'>}</span>
|
364
|
+
<span class='id identifier rubyid_str'>str</span> <span class='comment'># must return str
|
365
|
+
</span><span class='kw'>end</span></pre>
|
366
|
+
</td>
|
367
|
+
</tr>
|
368
|
+
</table>
|
369
|
+
</div>
|
370
|
+
|
371
|
+
<div class="method_details ">
|
372
|
+
<h3 class="signature " id="import-instance_method">
|
373
|
+
|
374
|
+
#<strong>import</strong>(meth, recv) ⇒ <tt>Object</tt>
|
375
|
+
|
376
|
+
|
377
|
+
|
378
|
+
|
379
|
+
|
380
|
+
</h3><div class="docstring">
|
381
|
+
<div class="discussion">
|
382
|
+
|
383
|
+
<p>FIXME lots of changes to make here…</p>
|
384
|
+
|
385
|
+
|
386
|
+
</div>
|
387
|
+
</div>
|
388
|
+
<div class="tags">
|
389
|
+
|
390
|
+
|
391
|
+
</div><table class="source_code">
|
392
|
+
<tr>
|
393
|
+
<td>
|
394
|
+
<pre class="lines">
|
395
|
+
|
396
|
+
|
397
|
+
36
|
398
|
+
37
|
399
|
+
38
|
400
|
+
39
|
401
|
+
40</pre>
|
402
|
+
</td>
|
403
|
+
<td>
|
404
|
+
<pre class="code"><span class="info file"># File 'rubytext.rb', line 36</span>
|
405
|
+
|
406
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_import'>import</span><span class='lparen'>(</span><span class='id identifier rubyid_meth'>meth</span><span class='comma'>,</span> <span class='id identifier rubyid_recv'>recv</span><span class='rparen'>)</span>
|
407
|
+
<span class='const'>Kernel</span><span class='period'>.</span><span class='id identifier rubyid_module_eval'>module_eval</span> <span class='kw'>do</span>
|
408
|
+
<span class='id identifier rubyid_define_method'>define_method</span><span class='lparen'>(</span><span class='id identifier rubyid_meth'>meth</span><span class='rparen'>)</span> <span class='lbrace'>{</span><span class='op'>|</span><span class='op'>*</span><span class='id identifier rubyid_args'>args</span><span class='op'>|</span> <span class='id identifier rubyid_recv'>recv</span><span class='period'>.</span><span class='id identifier rubyid_send'>send</span><span class='lparen'>(</span><span class='id identifier rubyid_meth'>meth</span><span class='comma'>,</span> <span class='op'>*</span><span class='id identifier rubyid_args'>args</span><span class='rparen'>)</span> <span class='rbrace'>}</span>
|
409
|
+
<span class='kw'>end</span>
|
410
|
+
<span class='kw'>end</span></pre>
|
411
|
+
</td>
|
412
|
+
</tr>
|
413
|
+
</table>
|
414
|
+
</div>
|
415
|
+
|
416
|
+
<div class="method_details ">
|
417
|
+
<h3 class="signature " id="make_exception-instance_method">
|
418
|
+
|
419
|
+
#<strong>make_exception</strong>(sym, str) ⇒ <tt>Object</tt>
|
420
|
+
|
421
|
+
|
422
|
+
|
423
|
+
|
424
|
+
|
425
|
+
</h3><div class="docstring">
|
426
|
+
<div class="discussion">
|
427
|
+
|
428
|
+
<p>FIXME refactor</p>
|
429
|
+
|
430
|
+
|
431
|
+
</div>
|
432
|
+
</div>
|
433
|
+
<div class="tags">
|
434
|
+
|
435
|
+
|
436
|
+
</div><table class="source_code">
|
437
|
+
<tr>
|
438
|
+
<td>
|
439
|
+
<pre class="lines">
|
440
|
+
|
441
|
+
|
442
|
+
42
|
443
|
+
43
|
444
|
+
44
|
445
|
+
45
|
446
|
+
46
|
447
|
+
47
|
448
|
+
48
|
449
|
+
49
|
450
|
+
50
|
451
|
+
51</pre>
|
452
|
+
</td>
|
453
|
+
<td>
|
454
|
+
<pre class="code"><span class="info file"># File 'rubytext.rb', line 42</span>
|
455
|
+
|
456
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_make_exception'>make_exception</span><span class='lparen'>(</span><span class='id identifier rubyid_sym'>sym</span><span class='comma'>,</span> <span class='id identifier rubyid_str'>str</span><span class='rparen'>)</span> <span class='comment'># FIXME refactor
|
457
|
+
</span> <span class='kw'>return</span> <span class='kw'>if</span> <span class='const'>Object</span><span class='period'>.</span><span class='id identifier rubyid_constants'>constants</span><span class='period'>.</span><span class='id identifier rubyid_include?'>include?</span><span class='lparen'>(</span><span class='id identifier rubyid_sym'>sym</span><span class='rparen'>)</span>
|
458
|
+
<span class='const'>Object</span><span class='period'>.</span><span class='id identifier rubyid_const_set'>const_set</span><span class='lparen'>(</span><span class='id identifier rubyid_sym'>sym</span><span class='comma'>,</span> <span class='const'>StandardError</span><span class='period'>.</span><span class='id identifier rubyid_dup'>dup</span><span class='rparen'>)</span>
|
459
|
+
<span class='id identifier rubyid_define_method'>define_method</span><span class='lparen'>(</span><span class='id identifier rubyid_sym'>sym</span><span class='rparen'>)</span> <span class='kw'>do</span> <span class='op'>|</span><span class='op'>*</span><span class='id identifier rubyid_args'>args</span><span class='op'>|</span>
|
460
|
+
<span class='id identifier rubyid_msg'>msg</span> <span class='op'>=</span> <span class='id identifier rubyid_str'>str</span>
|
461
|
+
<span class='id identifier rubyid_list'>list</span> <span class='op'>=</span> <span class='lparen'>(</span><span class='id identifier rubyid_args'>args</span> <span class='op'>+</span> <span class='lbracket'>[</span><span class='kw'>nil</span><span class='rbracket'>]</span><span class='op'>*</span><span class='int'>2</span><span class='rparen'>)</span><span class='lbracket'>[</span><span class='int'>0</span><span class='op'>..</span><span class='int'>2</span><span class='rbracket'>]</span>
|
462
|
+
<span class='id identifier rubyid_list'>list</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span><span class='period'>.</span><span class='id identifier rubyid_with_index'>with_index</span> <span class='lbrace'>{</span><span class='op'>|</span><span class='id identifier rubyid_arg'>arg</span><span class='comma'>,</span> <span class='id identifier rubyid_i'>i</span><span class='op'>|</span> <span class='id identifier rubyid_msg'>msg</span><span class='period'>.</span><span class='id identifier rubyid_sub!'>sub!</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>$</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_i'>i</span><span class='op'>+</span><span class='int'>1</span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='id identifier rubyid_arg'>arg</span><span class='period'>.</span><span class='id identifier rubyid_to_s'>to_s</span><span class='rparen'>)</span> <span class='rbrace'>}</span>
|
463
|
+
<span class='const'>Object</span><span class='period'>.</span><span class='id identifier rubyid_class_eval'>class_eval</span><span class='lparen'>(</span><span class='id identifier rubyid_sym'>sym</span><span class='period'>.</span><span class='id identifier rubyid_to_s'>to_s</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='id identifier rubyid_msg'>msg</span><span class='rparen'>)</span>
|
464
|
+
<span class='kw'>end</span>
|
465
|
+
<span class='kw'>end</span></pre>
|
466
|
+
</td>
|
467
|
+
</tr>
|
468
|
+
</table>
|
469
|
+
</div>
|
470
|
+
|
471
|
+
</div>
|
472
|
+
|
473
|
+
</div>
|
474
|
+
|
475
|
+
<div id="footer">
|
476
|
+
Generated on Sat Feb 8 04:23:59 2020 by
|
477
|
+
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
478
|
+
0.9.24 (ruby-2.4.2).
|
479
|
+
</div>
|
480
|
+
|
481
|
+
</div>
|
482
|
+
</body>
|
483
|
+
</html>
|
data/lib/effects.rb
CHANGED
@@ -1,21 +1,31 @@
|
|
1
1
|
|
2
|
+
# Helper method: insert text effects while printing
|
3
|
+
|
2
4
|
def fx(str, *args, bg: nil)
|
3
5
|
eff = RubyText::Effects.new(*args, bg: bg)
|
4
6
|
str.define_singleton_method(:effect) { eff }
|
5
7
|
str # must return str
|
6
8
|
end
|
7
9
|
|
10
|
+
# Hande text effects (bold, normal, reverse, underline)
|
11
|
+
|
8
12
|
class RubyText::Effects # dumb name?
|
13
|
+
|
14
|
+
# Text modes
|
9
15
|
Modes = {bold: Curses::A_BOLD,
|
10
16
|
normal: Curses::A_NORMAL,
|
11
17
|
reverse: Curses::A_REVERSE,
|
12
18
|
under: Curses::A_UNDERLINE}
|
13
19
|
|
20
|
+
# Other text modes "of our own"
|
21
|
+
|
14
22
|
Others = %[:show, :hide] # show/hide cursor; more later??
|
15
23
|
|
16
24
|
attr_reader :value, :fg, :bg
|
17
25
|
|
18
|
-
#
|
26
|
+
# @todo rewrite logic to accommodate color pairs
|
27
|
+
|
28
|
+
# Initialize an Effects object
|
19
29
|
|
20
30
|
def initialize(*args, bg: nil)
|
21
31
|
bits = 0
|
@@ -32,6 +42,8 @@ class RubyText::Effects # dumb name?
|
|
32
42
|
@value = bits
|
33
43
|
end
|
34
44
|
|
45
|
+
# "Turn on" effect to specified window
|
46
|
+
|
35
47
|
def set(win)
|
36
48
|
@old_fg, @old_bg = win.fg, win.bg # Save off current state?
|
37
49
|
attr, fg, bg = self.value, self.fg, self.bg
|
@@ -41,6 +53,8 @@ class RubyText::Effects # dumb name?
|
|
41
53
|
win.set_colors(fg, bg)
|
42
54
|
end
|
43
55
|
|
56
|
+
# "Turn off" effect in specified window
|
57
|
+
|
44
58
|
def reset(win)
|
45
59
|
attr = self.value
|
46
60
|
win.cwin.attroff(attr)
|