term_utils 0.1.1 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
data/README.md ADDED
@@ -0,0 +1,58 @@
1
+ # term_utils
2
+
3
+ Terminal utilities for Ruby.
4
+
5
+ ## Purpose
6
+
7
+ Provides terminal utilities like table formatting.
8
+
9
+ ## Content
10
+
11
+ ### Table formatting
12
+
13
+ Take the following table:
14
+
15
+ id string8 string16
16
+ ---- -------- ----------------
17
+ 1 Fiat Lux Fiat Lux
18
+ 2 Alea ... Alea jacta est
19
+ 3 Audac... Audaces fortuna juvat
20
+ ---- -------- ----------------
21
+ id string8 string16
22
+
23
+ You can produice it with the following code:
24
+
25
+ require 'term_utils/tab'
26
+
27
+ TermUtils::Tab.define_table(:foo) do |t|
28
+ t.define_column :id, :width => 4, :align => :right
29
+ t.define_column :string8, :fixed => true, :ellipsis => "..."
30
+ t.define_column :string16, :width => 16
31
+ end
32
+
33
+ data = []
34
+ data << [1, "Fiat Lux", "Fiat Lux"]
35
+ data << [2, "Alea jacta est", "Alea jacta est"]
36
+ data << [3, "Audaces fortuna juvat", "Audaces fortuna juvat"]
37
+
38
+ TermUtils::Tab.printer :foo, $stdout, :offset => 2 do |tpr|
39
+ tpr.line
40
+ tpr.header
41
+ tpr.separator
42
+ data.each do |d|
43
+ tpr.data d
44
+ end
45
+ tpr.separator
46
+ tpr.header
47
+ tpr.line
48
+ end
49
+
50
+ ### File Finder
51
+
52
+ The File Finder module provides a way to query the filesystem.
53
+
54
+ See the samples.
55
+
56
+ ## License
57
+
58
+ GPL-3.0-only.
data/Rakefile ADDED
@@ -0,0 +1,46 @@
1
+ # Rakefile for tab
2
+
3
+ require 'rubygems'
4
+
5
+ GEM_SPEC = Gem::Specification::load("term_utils.gemspec")
6
+ GEM_NAME = GEM_SPEC.name
7
+ GEM_VERSION = GEM_SPEC.version
8
+
9
+ GEM = "#{GEM_NAME}-#{GEM_VERSION}.gem"
10
+
11
+ task :default => :build
12
+
13
+ task :help do
14
+ puts <<-EOS
15
+ usage: rake TARGET...
16
+
17
+ Available targets:
18
+ build Build gem.
19
+ clean Remove gem.
20
+ install Install gem.
21
+ uninstall Uninstall gem.
22
+
23
+ EOS
24
+ end
25
+
26
+ task :build => GEM
27
+
28
+ task :doc do
29
+ sh "yardoc"
30
+ end
31
+
32
+ file GEM => :doc do
33
+ sh "gem build #{GEM_NAME}"
34
+ end
35
+
36
+ task :install => :build do
37
+ sh "gem install #{GEM}"
38
+ end
39
+
40
+ task :uninstall do
41
+ sh "gem uninstall #{GEM_NAME} --version #{GEM_VERSION}"
42
+ end
43
+
44
+ task :clean do
45
+ sh "rm -rf doc #{GEM}"
46
+ end
@@ -0,0 +1,606 @@
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
+ Class: TermUtils::FF::Config
8
+
9
+ &mdash; Documentation by YARD 0.9.20
10
+
11
+ </title>
12
+
13
+ <link rel="stylesheet" href="../../css/style.css" type="text/css" charset="utf-8" />
14
+
15
+ <link rel="stylesheet" href="../../css/common.css" type="text/css" charset="utf-8" />
16
+
17
+ <script type="text/javascript" charset="utf-8">
18
+ pathId = "TermUtils::FF::Config";
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 (C)</a> &raquo;
40
+ <span class='title'><span class='object_link'><a href="../../TermUtils.html" title="TermUtils (module)">TermUtils</a></span></span> &raquo; <span class='title'><span class='object_link'><a href="../FF.html" title="TermUtils::FF (module)">FF</a></span></span>
41
+ &raquo;
42
+ <span class="title">Config</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>Class: TermUtils::FF::Config
63
+
64
+
65
+
66
+ </h1>
67
+ <div class="box_info">
68
+
69
+ <dl>
70
+ <dt>Inherits:</dt>
71
+ <dd>
72
+ <span class="inheritName">Object</span>
73
+
74
+ <ul class="fullTree">
75
+ <li>Object</li>
76
+
77
+ <li class="next">TermUtils::FF::Config</li>
78
+
79
+ </ul>
80
+ <a href="#" class="inheritanceTree">show all</a>
81
+
82
+ </dd>
83
+ </dl>
84
+
85
+
86
+
87
+
88
+
89
+
90
+
91
+
92
+
93
+
94
+
95
+ <dl>
96
+ <dt>Defined in:</dt>
97
+ <dd>lib/term_utils/ff/config.rb</dd>
98
+ </dl>
99
+
100
+ </div>
101
+
102
+ <h2>Overview</h2><div class="docstring">
103
+ <div class="discussion">
104
+
105
+ <p>Represents a query configuration.</p>
106
+
107
+
108
+ </div>
109
+ </div>
110
+ <div class="tags">
111
+
112
+
113
+ </div>
114
+
115
+
116
+
117
+ <h2>Instance Attribute Summary <small><a href="#" class="summary_toggle">collapse</a></small></h2>
118
+ <ul class="summary">
119
+
120
+ <li class="public ">
121
+ <span class="summary_signature">
122
+
123
+ <a href="#ignore_list-instance_method" title="#ignore_list (instance method)">#<strong>ignore_list</strong> &#x21d2; Array&lt;Regexp&gt; </a>
124
+
125
+
126
+
127
+ </span>
128
+
129
+
130
+
131
+
132
+
133
+
134
+
135
+
136
+
137
+
138
+
139
+
140
+ <span class="summary_desc"><div class='inline'></div></span>
141
+
142
+ </li>
143
+
144
+
145
+ <li class="public ">
146
+ <span class="summary_signature">
147
+
148
+ <a href="#max_depth-instance_method" title="#max_depth (instance method)">#<strong>max_depth</strong> &#x21d2; Integer </a>
149
+
150
+
151
+
152
+ </span>
153
+
154
+
155
+
156
+
157
+
158
+
159
+
160
+
161
+
162
+
163
+
164
+
165
+ <span class="summary_desc"><div class='inline'></div></span>
166
+
167
+ </li>
168
+
169
+
170
+ <li class="public ">
171
+ <span class="summary_signature">
172
+
173
+ <a href="#min_depth-instance_method" title="#min_depth (instance method)">#<strong>min_depth</strong> &#x21d2; Integer </a>
174
+
175
+
176
+
177
+ </span>
178
+
179
+
180
+
181
+
182
+
183
+
184
+
185
+
186
+
187
+
188
+
189
+
190
+ <span class="summary_desc"><div class='inline'></div></span>
191
+
192
+ </li>
193
+
194
+
195
+ <li class="public ">
196
+ <span class="summary_signature">
197
+
198
+ <a href="#sorted-instance_method" title="#sorted (instance method)">#<strong>sorted</strong> &#x21d2; Boolean </a>
199
+
200
+
201
+
202
+ </span>
203
+
204
+
205
+
206
+
207
+
208
+
209
+
210
+
211
+
212
+
213
+
214
+
215
+ <span class="summary_desc"><div class='inline'></div></span>
216
+
217
+ </li>
218
+
219
+
220
+ </ul>
221
+
222
+
223
+
224
+
225
+
226
+ <h2>
227
+ Instance Method Summary
228
+ <small><a href="#" class="summary_toggle">collapse</a></small>
229
+ </h2>
230
+
231
+ <ul class="summary">
232
+
233
+ <li class="public ">
234
+ <span class="summary_signature">
235
+
236
+ <a href="#initialize-instance_method" title="#initialize (instance method)">#<strong>initialize</strong> &#x21d2; Config </a>
237
+
238
+
239
+
240
+ </span>
241
+
242
+
243
+ <span class="note title constructor">constructor</span>
244
+
245
+
246
+
247
+
248
+
249
+
250
+
251
+
252
+ <span class="summary_desc"><div class='inline'>
253
+ <p>A new instance of Config.</p>
254
+ </div></span>
255
+
256
+ </li>
257
+
258
+
259
+ <li class="public ">
260
+ <span class="summary_signature">
261
+
262
+ <a href="#initialize_copy-instance_method" title="#initialize_copy (instance method)">#<strong>initialize_copy</strong>(other) &#x21d2; Object </a>
263
+
264
+
265
+
266
+ </span>
267
+
268
+
269
+
270
+
271
+
272
+
273
+
274
+
275
+
276
+ <span class="summary_desc"><div class='inline'></div></span>
277
+
278
+ </li>
279
+
280
+
281
+ </ul>
282
+
283
+
284
+ <div id="constructor_details" class="method_details_list">
285
+ <h2>Constructor Details</h2>
286
+
287
+ <div class="method_details first">
288
+ <h3 class="signature first" id="initialize-instance_method">
289
+
290
+ #<strong>initialize</strong> &#x21d2; <tt><span class='object_link'><a href="" title="TermUtils::FF::Config (class)">Config</a></span></tt>
291
+
292
+
293
+
294
+
295
+
296
+ </h3><div class="docstring">
297
+ <div class="discussion">
298
+
299
+ <p>Returns a new instance of Config</p>
300
+
301
+
302
+ </div>
303
+ </div>
304
+ <div class="tags">
305
+
306
+
307
+ </div><table class="source_code">
308
+ <tr>
309
+ <td>
310
+ <pre class="lines">
311
+
312
+
313
+ 31
314
+ 32
315
+ 33
316
+ 34
317
+ 35
318
+ 36</pre>
319
+ </td>
320
+ <td>
321
+ <pre class="code"><span class="info file"># File 'lib/term_utils/ff/config.rb', line 31</span>
322
+
323
+ <span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span>
324
+ <span class='ivar'>@ignore_list</span> <span class='op'>=</span> <span class='lbracket'>[</span><span class='rbracket'>]</span>
325
+ <span class='ivar'>@min_depth</span> <span class='op'>=</span> <span class='kw'>nil</span>
326
+ <span class='ivar'>@max_depth</span> <span class='op'>=</span> <span class='kw'>nil</span>
327
+ <span class='ivar'>@sorted</span> <span class='op'>=</span> <span class='kw'>false</span>
328
+ <span class='kw'>end</span></pre>
329
+ </td>
330
+ </tr>
331
+ </table>
332
+ </div>
333
+
334
+ </div>
335
+
336
+ <div id="instance_attr_details" class="attr_details">
337
+ <h2>Instance Attribute Details</h2>
338
+
339
+
340
+ <span id="ignore_list=-instance_method"></span>
341
+ <div class="method_details first">
342
+ <h3 class="signature first" id="ignore_list-instance_method">
343
+
344
+ #<strong>ignore_list</strong> &#x21d2; <tt>Array&lt;Regexp&gt;</tt>
345
+
346
+
347
+
348
+
349
+
350
+ </h3><div class="docstring">
351
+ <div class="discussion">
352
+
353
+
354
+ </div>
355
+ </div>
356
+ <div class="tags">
357
+
358
+ <p class="tag_title">Returns:</p>
359
+ <ul class="return">
360
+
361
+ <li>
362
+
363
+
364
+ <span class='type'>(<tt>Array&lt;Regexp&gt;</tt>)</span>
365
+
366
+
367
+
368
+ </li>
369
+
370
+ </ul>
371
+
372
+ </div><table class="source_code">
373
+ <tr>
374
+ <td>
375
+ <pre class="lines">
376
+
377
+
378
+ 24
379
+ 25
380
+ 26</pre>
381
+ </td>
382
+ <td>
383
+ <pre class="code"><span class="info file"># File 'lib/term_utils/ff/config.rb', line 24</span>
384
+
385
+ <span class='kw'>def</span> <span class='id identifier rubyid_ignore_list'>ignore_list</span>
386
+ <span class='ivar'>@ignore_list</span>
387
+ <span class='kw'>end</span></pre>
388
+ </td>
389
+ </tr>
390
+ </table>
391
+ </div>
392
+
393
+
394
+ <span id="max_depth=-instance_method"></span>
395
+ <div class="method_details ">
396
+ <h3 class="signature " id="max_depth-instance_method">
397
+
398
+ #<strong>max_depth</strong> &#x21d2; <tt>Integer</tt>
399
+
400
+
401
+
402
+
403
+
404
+ </h3><div class="docstring">
405
+ <div class="discussion">
406
+
407
+
408
+ </div>
409
+ </div>
410
+ <div class="tags">
411
+
412
+ <p class="tag_title">Returns:</p>
413
+ <ul class="return">
414
+
415
+ <li>
416
+
417
+
418
+ <span class='type'>(<tt>Integer</tt>)</span>
419
+
420
+
421
+
422
+ </li>
423
+
424
+ </ul>
425
+
426
+ </div><table class="source_code">
427
+ <tr>
428
+ <td>
429
+ <pre class="lines">
430
+
431
+
432
+ 28
433
+ 29
434
+ 30</pre>
435
+ </td>
436
+ <td>
437
+ <pre class="code"><span class="info file"># File 'lib/term_utils/ff/config.rb', line 28</span>
438
+
439
+ <span class='kw'>def</span> <span class='id identifier rubyid_max_depth'>max_depth</span>
440
+ <span class='ivar'>@max_depth</span>
441
+ <span class='kw'>end</span></pre>
442
+ </td>
443
+ </tr>
444
+ </table>
445
+ </div>
446
+
447
+
448
+ <span id="min_depth=-instance_method"></span>
449
+ <div class="method_details ">
450
+ <h3 class="signature " id="min_depth-instance_method">
451
+
452
+ #<strong>min_depth</strong> &#x21d2; <tt>Integer</tt>
453
+
454
+
455
+
456
+
457
+
458
+ </h3><div class="docstring">
459
+ <div class="discussion">
460
+
461
+
462
+ </div>
463
+ </div>
464
+ <div class="tags">
465
+
466
+ <p class="tag_title">Returns:</p>
467
+ <ul class="return">
468
+
469
+ <li>
470
+
471
+
472
+ <span class='type'>(<tt>Integer</tt>)</span>
473
+
474
+
475
+
476
+ </li>
477
+
478
+ </ul>
479
+
480
+ </div><table class="source_code">
481
+ <tr>
482
+ <td>
483
+ <pre class="lines">
484
+
485
+
486
+ 26
487
+ 27
488
+ 28</pre>
489
+ </td>
490
+ <td>
491
+ <pre class="code"><span class="info file"># File 'lib/term_utils/ff/config.rb', line 26</span>
492
+
493
+ <span class='kw'>def</span> <span class='id identifier rubyid_min_depth'>min_depth</span>
494
+ <span class='ivar'>@min_depth</span>
495
+ <span class='kw'>end</span></pre>
496
+ </td>
497
+ </tr>
498
+ </table>
499
+ </div>
500
+
501
+
502
+ <span id="sorted=-instance_method"></span>
503
+ <div class="method_details ">
504
+ <h3 class="signature " id="sorted-instance_method">
505
+
506
+ #<strong>sorted</strong> &#x21d2; <tt>Boolean</tt>
507
+
508
+
509
+
510
+
511
+
512
+ </h3><div class="docstring">
513
+ <div class="discussion">
514
+
515
+
516
+ </div>
517
+ </div>
518
+ <div class="tags">
519
+
520
+ <p class="tag_title">Returns:</p>
521
+ <ul class="return">
522
+
523
+ <li>
524
+
525
+
526
+ <span class='type'>(<tt>Boolean</tt>)</span>
527
+
528
+
529
+
530
+ </li>
531
+
532
+ </ul>
533
+
534
+ </div><table class="source_code">
535
+ <tr>
536
+ <td>
537
+ <pre class="lines">
538
+
539
+
540
+ 30
541
+ 31
542
+ 32</pre>
543
+ </td>
544
+ <td>
545
+ <pre class="code"><span class="info file"># File 'lib/term_utils/ff/config.rb', line 30</span>
546
+
547
+ <span class='kw'>def</span> <span class='id identifier rubyid_sorted'>sorted</span>
548
+ <span class='ivar'>@sorted</span>
549
+ <span class='kw'>end</span></pre>
550
+ </td>
551
+ </tr>
552
+ </table>
553
+ </div>
554
+
555
+ </div>
556
+
557
+
558
+ <div id="instance_method_details" class="method_details_list">
559
+ <h2>Instance Method Details</h2>
560
+
561
+
562
+ <div class="method_details first">
563
+ <h3 class="signature first" id="initialize_copy-instance_method">
564
+
565
+ #<strong>initialize_copy</strong>(other) &#x21d2; <tt>Object</tt>
566
+
567
+
568
+
569
+
570
+
571
+ </h3><table class="source_code">
572
+ <tr>
573
+ <td>
574
+ <pre class="lines">
575
+
576
+
577
+ 37
578
+ 38
579
+ 39
580
+ 40</pre>
581
+ </td>
582
+ <td>
583
+ <pre class="code"><span class="info file"># File 'lib/term_utils/ff/config.rb', line 37</span>
584
+
585
+ <span class='kw'>def</span> <span class='id identifier rubyid_initialize_copy'>initialize_copy</span><span class='lparen'>(</span><span class='id identifier rubyid_other'>other</span><span class='rparen'>)</span>
586
+ <span class='ivar'>@ignore_list</span> <span class='op'>=</span> <span class='id identifier rubyid_other'>other</span><span class='period'>.</span><span class='id identifier rubyid_ignore_list'>ignore_list</span><span class='period'>.</span><span class='id identifier rubyid_dup'>dup</span>
587
+ <span class='kw'>super</span>
588
+ <span class='kw'>end</span></pre>
589
+ </td>
590
+ </tr>
591
+ </table>
592
+ </div>
593
+
594
+ </div>
595
+
596
+ </div>
597
+
598
+ <div id="footer">
599
+ Generated on Thu Oct 17 22:50:58 2019 by
600
+ <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
601
+ 0.9.20 (ruby-2.6.5).
602
+ </div>
603
+
604
+ </div>
605
+ </body>
606
+ </html>