term_utils 0.4.0 → 0.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (60) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +7 -0
  3. data/COPYING +1 -1
  4. data/Rakefile +6 -0
  5. data/doc/TermUtils/AP/Article.html +13 -13
  6. data/doc/TermUtils/AP/ArticleResult.html +4 -4
  7. data/doc/TermUtils/AP/Flag.html +8 -8
  8. data/doc/TermUtils/AP/Parameter.html +9 -9
  9. data/doc/TermUtils/AP/ParameterResult.html +4 -4
  10. data/doc/TermUtils/AP/ParameterWalkerHooks.html +4 -4
  11. data/doc/TermUtils/AP/ParseError.html +646 -14
  12. data/doc/TermUtils/AP/Parser.html +43 -15
  13. data/doc/TermUtils/AP/Result.html +4 -4
  14. data/doc/TermUtils/AP/Syntax.html +4 -4
  15. data/doc/TermUtils/AP/SyntaxError.html +4 -86
  16. data/doc/TermUtils/AP/Walker.html +4 -4
  17. data/doc/TermUtils/AP.html +16 -16
  18. data/doc/TermUtils/FF/Config.html +8 -8
  19. data/doc/TermUtils/FF/Context.html +4 -4
  20. data/doc/TermUtils/FF/Entry.html +4 -4
  21. data/doc/TermUtils/FF/Finder.html +850 -0
  22. data/doc/TermUtils/FF/FinderEntry.html +1191 -0
  23. data/doc/TermUtils/FF/FinderQuery.html +946 -0
  24. data/doc/TermUtils/FF/Query.html +11 -15
  25. data/doc/TermUtils/FF.html +131 -7
  26. data/doc/TermUtils/PropertyTreeNode.html +6 -6
  27. data/doc/TermUtils/Tab/Column.html +44 -44
  28. data/doc/TermUtils/Tab/Header.html +19 -19
  29. data/doc/TermUtils/Tab/Holder.html +40 -40
  30. data/doc/TermUtils/Tab/Printer.html +4 -4
  31. data/doc/TermUtils/Tab/Table.html +59 -59
  32. data/doc/TermUtils/Tab/TableError.html +4 -86
  33. data/doc/TermUtils/Tab.html +42 -42
  34. data/doc/TermUtils.html +6 -6
  35. data/doc/_index.html +29 -23
  36. data/doc/class_list.html +1 -1
  37. data/doc/css/style.css +1 -0
  38. data/doc/file.README.html +25 -21
  39. data/doc/frames.html +1 -1
  40. data/doc/index.html +25 -21
  41. data/doc/method_list.html +385 -89
  42. data/doc/top-level-namespace.html +4 -4
  43. data/lib/term_utils/ap/article.rb +2 -2
  44. data/lib/term_utils/ap/flag.rb +2 -2
  45. data/lib/term_utils/ap/parameter.rb +2 -2
  46. data/lib/term_utils/ap/parser.rb +16 -15
  47. data/lib/term_utils/ap/result.rb +2 -2
  48. data/lib/term_utils/ap/syntax.rb +2 -2
  49. data/lib/term_utils/ap.rb +66 -22
  50. data/lib/term_utils/ff/config.rb +3 -3
  51. data/lib/term_utils/ff/entry.rb +2 -2
  52. data/lib/term_utils/ff/finder.rb +255 -0
  53. data/lib/term_utils/ff/query.rb +6 -8
  54. data/lib/term_utils/ff.rb +4 -3
  55. data/lib/term_utils/property_tree_node.rb +3 -3
  56. data/lib/term_utils/tab.rb +14 -13
  57. data/lib/term_utils.rb +2 -2
  58. data/term_utils.gemspec +2 -2
  59. metadata +8 -5
  60. data/doc/TermUtils/AP/NoSuchValueError.html +0 -217
@@ -0,0 +1,850 @@
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::Finder
8
+
9
+ &mdash; Documentation by YARD 0.9.34
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 = "TermUtils::FF::Finder";
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 (F)</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">Finder</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::Finder
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::Finder</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/finder.rb</dd>
98
+ </dl>
99
+
100
+ </div>
101
+
102
+ <h2>Overview</h2><div class="docstring">
103
+ <div class="discussion">
104
+
105
+ <p>Represents the find method engine.</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="#query-instance_method" title="#query (instance method)">#<strong>query</strong> &#x21d2; Object </a>
124
+
125
+
126
+
127
+ </span>
128
+
129
+
130
+
131
+
132
+ <span class="note title readonly">readonly</span>
133
+
134
+
135
+
136
+
137
+
138
+
139
+
140
+
141
+
142
+ <span class="summary_desc"><div class='inline'>
143
+ <p>Returns the value of attribute query.</p>
144
+ </div></span>
145
+
146
+ </li>
147
+
148
+
149
+ </ul>
150
+
151
+
152
+
153
+
154
+
155
+ <h2>
156
+ Instance Method Summary
157
+ <small><a href="#" class="summary_toggle">collapse</a></small>
158
+ </h2>
159
+
160
+ <ul class="summary">
161
+
162
+ <li class="public ">
163
+ <span class="summary_signature">
164
+
165
+ <a href="#enter%3F-instance_method" title="#enter? (instance method)">#<strong>enter?</strong>(entry) &#x21d2; Boolean </a>
166
+
167
+
168
+
169
+ </span>
170
+
171
+
172
+
173
+
174
+
175
+
176
+
177
+
178
+
179
+ <span class="summary_desc"><div class='inline'></div></span>
180
+
181
+ </li>
182
+
183
+
184
+ <li class="public ">
185
+ <span class="summary_signature">
186
+
187
+ <a href="#exec-instance_method" title="#exec (instance method)">#<strong>exec</strong> &#x21d2; Object </a>
188
+
189
+
190
+
191
+ </span>
192
+
193
+
194
+
195
+
196
+
197
+
198
+
199
+
200
+
201
+ <span class="summary_desc"><div class='inline'></div></span>
202
+
203
+ </li>
204
+
205
+
206
+ <li class="public ">
207
+ <span class="summary_signature">
208
+
209
+ <a href="#include%3F-instance_method" title="#include? (instance method)">#<strong>include?</strong>(entry) &#x21d2; Boolean </a>
210
+
211
+
212
+
213
+ </span>
214
+
215
+
216
+
217
+
218
+
219
+
220
+
221
+
222
+
223
+ <span class="summary_desc"><div class='inline'></div></span>
224
+
225
+ </li>
226
+
227
+
228
+ <li class="public ">
229
+ <span class="summary_signature">
230
+
231
+ <a href="#initialize-instance_method" title="#initialize (instance method)">#<strong>initialize</strong>(paths) &#x21d2; Finder </a>
232
+
233
+
234
+
235
+ </span>
236
+
237
+
238
+ <span class="note title constructor">constructor</span>
239
+
240
+
241
+
242
+
243
+
244
+
245
+
246
+
247
+ <span class="summary_desc"><div class='inline'>
248
+ <p>A new instance of Finder.</p>
249
+ </div></span>
250
+
251
+ </li>
252
+
253
+
254
+ <li class="public ">
255
+ <span class="summary_signature">
256
+
257
+ <a href="#list-instance_method" title="#list (instance method)">#<strong>list</strong>(ctx) &#x21d2; Object </a>
258
+
259
+
260
+
261
+ </span>
262
+
263
+
264
+
265
+
266
+
267
+
268
+
269
+
270
+
271
+ <span class="summary_desc"><div class='inline'></div></span>
272
+
273
+ </li>
274
+
275
+
276
+ <li class="public ">
277
+ <span class="summary_signature">
278
+
279
+ <a href="#list_start-instance_method" title="#list_start (instance method)">#<strong>list_start</strong>(ctx) &#x21d2; Object </a>
280
+
281
+
282
+
283
+ </span>
284
+
285
+
286
+
287
+
288
+
289
+
290
+
291
+
292
+
293
+ <span class="summary_desc"><div class='inline'></div></span>
294
+
295
+ </li>
296
+
297
+
298
+ <li class="public ">
299
+ <span class="summary_signature">
300
+
301
+ <a href="#match%3F-instance_method" title="#match? (instance method)">#<strong>match?</strong>(entry) &#x21d2; Boolean </a>
302
+
303
+
304
+
305
+ </span>
306
+
307
+
308
+
309
+
310
+
311
+
312
+
313
+
314
+
315
+ <span class="summary_desc"><div class='inline'></div></span>
316
+
317
+ </li>
318
+
319
+
320
+ </ul>
321
+
322
+
323
+ <div id="constructor_details" class="method_details_list">
324
+ <h2>Constructor Details</h2>
325
+
326
+ <div class="method_details first">
327
+ <h3 class="signature first" id="initialize-instance_method">
328
+
329
+ #<strong>initialize</strong>(paths) &#x21d2; <tt><span class='object_link'><a href="" title="TermUtils::FF::Finder (class)">Finder</a></span></tt>
330
+
331
+
332
+
333
+
334
+
335
+ </h3><div class="docstring">
336
+ <div class="discussion">
337
+
338
+ <p>Returns a new instance of Finder.</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
+ 127
353
+ 128
354
+ 129
355
+ 130</pre>
356
+ </td>
357
+ <td>
358
+ <pre class="code"><span class="info file"># File 'lib/term_utils/ff/finder.rb', line 127</span>
359
+
360
+ <span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span><span class='lparen'>(</span><span class='id identifier rubyid_paths'>paths</span><span class='rparen'>)</span>
361
+ <span class='ivar'>@paths</span> <span class='op'>=</span> <span class='id identifier rubyid_paths'>paths</span><span class='period'>.</span><span class='id identifier rubyid_dup'>dup</span>
362
+ <span class='ivar'>@query</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="FinderQuery.html" title="TermUtils::FF::FinderQuery (class)">FinderQuery</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="FinderQuery.html#initialize-instance_method" title="TermUtils::FF::FinderQuery#initialize (method)">new</a></span></span>
363
+ <span class='kw'>end</span></pre>
364
+ </td>
365
+ </tr>
366
+ </table>
367
+ </div>
368
+
369
+ </div>
370
+
371
+ <div id="instance_attr_details" class="attr_details">
372
+ <h2>Instance Attribute Details</h2>
373
+
374
+
375
+ <span id=""></span>
376
+ <div class="method_details first">
377
+ <h3 class="signature first" id="query-instance_method">
378
+
379
+ #<strong>query</strong> &#x21d2; <tt>Object</tt> <span class="extras">(readonly)</span>
380
+
381
+
382
+
383
+
384
+
385
+ </h3><div class="docstring">
386
+ <div class="discussion">
387
+
388
+ <p>Returns the value of attribute query.</p>
389
+
390
+
391
+ </div>
392
+ </div>
393
+ <div class="tags">
394
+
395
+
396
+ </div><table class="source_code">
397
+ <tr>
398
+ <td>
399
+ <pre class="lines">
400
+
401
+
402
+ 125
403
+ 126
404
+ 127</pre>
405
+ </td>
406
+ <td>
407
+ <pre class="code"><span class="info file"># File 'lib/term_utils/ff/finder.rb', line 125</span>
408
+
409
+ <span class='kw'>def</span> <span class='id identifier rubyid_query'>query</span>
410
+ <span class='ivar'>@query</span>
411
+ <span class='kw'>end</span></pre>
412
+ </td>
413
+ </tr>
414
+ </table>
415
+ </div>
416
+
417
+ </div>
418
+
419
+
420
+ <div id="instance_method_details" class="method_details_list">
421
+ <h2>Instance Method Details</h2>
422
+
423
+
424
+ <div class="method_details first">
425
+ <h3 class="signature first" id="enter?-instance_method">
426
+
427
+ #<strong>enter?</strong>(entry) &#x21d2; <tt>Boolean</tt>
428
+
429
+
430
+
431
+
432
+
433
+ </h3><div class="docstring">
434
+ <div class="discussion">
435
+
436
+
437
+ </div>
438
+ </div>
439
+ <div class="tags">
440
+
441
+ <p class="tag_title">Returns:</p>
442
+ <ul class="return">
443
+
444
+ <li>
445
+
446
+
447
+ <span class='type'>(<tt>Boolean</tt>)</span>
448
+
449
+
450
+
451
+ </li>
452
+
453
+ </ul>
454
+
455
+ </div><table class="source_code">
456
+ <tr>
457
+ <td>
458
+ <pre class="lines">
459
+
460
+
461
+ 210
462
+ 211
463
+ 212
464
+ 213
465
+ 214
466
+ 215
467
+ 216
468
+ 217
469
+ 218
470
+ 219
471
+ 220
472
+ 221
473
+ 222
474
+ 223
475
+ 224
476
+ 225
477
+ 226</pre>
478
+ </td>
479
+ <td>
480
+ <pre class="code"><span class="info file"># File 'lib/term_utils/ff/finder.rb', line 210</span>
481
+
482
+ <span class='kw'>def</span> <span class='id identifier rubyid_enter?'>enter?</span><span class='lparen'>(</span><span class='id identifier rubyid_entry'>entry</span><span class='rparen'>)</span>
483
+ <span class='kw'>unless</span> <span class='ivar'>@query</span><span class='period'>.</span><span class='id identifier rubyid_use_stat'>use_stat</span>
484
+ <span class='kw'>return</span> <span class='const'>File</span><span class='period'>.</span><span class='id identifier rubyid_directory?'>directory?</span><span class='lparen'>(</span><span class='id identifier rubyid_entry'>entry</span><span class='period'>.</span><span class='id identifier rubyid_path'>path</span><span class='rparen'>)</span>
485
+ <span class='kw'>end</span>
486
+
487
+ <span class='kw'>return</span> <span class='kw'>false</span> <span class='kw'>unless</span> <span class='id identifier rubyid_entry'>entry</span><span class='period'>.</span><span class='id identifier rubyid_directory?'>directory?</span>
488
+
489
+ <span class='ivar'>@query</span><span class='period'>.</span><span class='id identifier rubyid_each_filter'>each_filter</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_f'>f</span><span class='op'>|</span>
490
+ <span class='kw'>case</span> <span class='id identifier rubyid_f'>f</span><span class='lbracket'>[</span><span class='symbol'>:kind</span><span class='rbracket'>]</span>
491
+ <span class='kw'>when</span> <span class='symbol'>:enter</span>
492
+ <span class='kw'>return</span> <span class='kw'>true</span> <span class='kw'>if</span> <span class='id identifier rubyid_f'>f</span><span class='lbracket'>[</span><span class='symbol'>:block</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_call'>call</span><span class='lparen'>(</span><span class='id identifier rubyid_entry'>entry</span><span class='rparen'>)</span>
493
+ <span class='kw'>when</span> <span class='symbol'>:skip</span>
494
+ <span class='kw'>return</span> <span class='kw'>false</span> <span class='kw'>if</span> <span class='id identifier rubyid_f'>f</span><span class='lbracket'>[</span><span class='symbol'>:block</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_call'>call</span><span class='lparen'>(</span><span class='id identifier rubyid_entry'>entry</span><span class='rparen'>)</span>
495
+ <span class='kw'>end</span>
496
+ <span class='kw'>end</span>
497
+ <span class='kw'>true</span>
498
+ <span class='kw'>end</span></pre>
499
+ </td>
500
+ </tr>
501
+ </table>
502
+ </div>
503
+
504
+ <div class="method_details ">
505
+ <h3 class="signature " id="exec-instance_method">
506
+
507
+ #<strong>exec</strong> &#x21d2; <tt>Object</tt>
508
+
509
+
510
+
511
+
512
+
513
+ </h3><table class="source_code">
514
+ <tr>
515
+ <td>
516
+ <pre class="lines">
517
+
518
+
519
+ 132
520
+ 133
521
+ 134
522
+ 135
523
+ 136
524
+ 137</pre>
525
+ </td>
526
+ <td>
527
+ <pre class="code"><span class="info file"># File 'lib/term_utils/ff/finder.rb', line 132</span>
528
+
529
+ <span class='kw'>def</span> <span class='id identifier rubyid_exec'>exec</span>
530
+ <span class='ivar'>@paths</span><span class='period'>.</span><span class='id identifier rubyid_each_with_object'>each_with_object</span><span class='lparen'>(</span><span class='lbracket'>[</span><span class='rbracket'>]</span><span class='rparen'>)</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_path'>path</span><span class='comma'>,</span> <span class='id identifier rubyid_obj'>obj</span><span class='op'>|</span>
531
+ <span class='id identifier rubyid_ctx'>ctx</span> <span class='op'>=</span> <span class='lbrace'>{</span> <span class='label'>entries:</span> <span class='id identifier rubyid_obj'>obj</span><span class='comma'>,</span> <span class='label'>basedir:</span> <span class='id identifier rubyid_path'>path</span> <span class='rbrace'>}</span>
532
+ <span class='id identifier rubyid_list_start'>list_start</span><span class='lparen'>(</span><span class='id identifier rubyid_ctx'>ctx</span><span class='rparen'>)</span>
533
+ <span class='kw'>end</span>
534
+ <span class='kw'>end</span></pre>
535
+ </td>
536
+ </tr>
537
+ </table>
538
+ </div>
539
+
540
+ <div class="method_details ">
541
+ <h3 class="signature " id="include?-instance_method">
542
+
543
+ #<strong>include?</strong>(entry) &#x21d2; <tt>Boolean</tt>
544
+
545
+
546
+
547
+
548
+
549
+ </h3><div class="docstring">
550
+ <div class="discussion">
551
+
552
+
553
+ </div>
554
+ </div>
555
+ <div class="tags">
556
+
557
+ <p class="tag_title">Returns:</p>
558
+ <ul class="return">
559
+
560
+ <li>
561
+
562
+
563
+ <span class='type'>(<tt>Boolean</tt>)</span>
564
+
565
+
566
+
567
+ </li>
568
+
569
+ </ul>
570
+
571
+ </div><table class="source_code">
572
+ <tr>
573
+ <td>
574
+ <pre class="lines">
575
+
576
+
577
+ 228
578
+ 229
579
+ 230
580
+ 231
581
+ 232
582
+ 233
583
+ 234
584
+ 235
585
+ 236
586
+ 237
587
+ 238</pre>
588
+ </td>
589
+ <td>
590
+ <pre class="code"><span class="info file"># File 'lib/term_utils/ff/finder.rb', line 228</span>
591
+
592
+ <span class='kw'>def</span> <span class='id identifier rubyid_include?'>include?</span><span class='lparen'>(</span><span class='id identifier rubyid_entry'>entry</span><span class='rparen'>)</span>
593
+ <span class='ivar'>@query</span><span class='period'>.</span><span class='id identifier rubyid_each_filter'>each_filter</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_f'>f</span><span class='op'>|</span>
594
+ <span class='kw'>case</span> <span class='id identifier rubyid_f'>f</span><span class='lbracket'>[</span><span class='symbol'>:kind</span><span class='rbracket'>]</span>
595
+ <span class='kw'>when</span> <span class='symbol'>:include</span>
596
+ <span class='kw'>return</span> <span class='kw'>true</span> <span class='kw'>if</span> <span class='id identifier rubyid_f'>f</span><span class='lbracket'>[</span><span class='symbol'>:block</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_call'>call</span><span class='lparen'>(</span><span class='id identifier rubyid_entry'>entry</span><span class='rparen'>)</span>
597
+ <span class='kw'>when</span> <span class='symbol'>:exclude</span>
598
+ <span class='kw'>return</span> <span class='kw'>false</span> <span class='kw'>if</span> <span class='id identifier rubyid_f'>f</span><span class='lbracket'>[</span><span class='symbol'>:block</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_call'>call</span><span class='lparen'>(</span><span class='id identifier rubyid_entry'>entry</span><span class='rparen'>)</span>
599
+ <span class='kw'>end</span>
600
+ <span class='kw'>end</span>
601
+ <span class='kw'>true</span>
602
+ <span class='kw'>end</span></pre>
603
+ </td>
604
+ </tr>
605
+ </table>
606
+ </div>
607
+
608
+ <div class="method_details ">
609
+ <h3 class="signature " id="list-instance_method">
610
+
611
+ #<strong>list</strong>(ctx) &#x21d2; <tt>Object</tt>
612
+
613
+
614
+
615
+
616
+
617
+ </h3><table class="source_code">
618
+ <tr>
619
+ <td>
620
+ <pre class="lines">
621
+
622
+
623
+ 160
624
+ 161
625
+ 162
626
+ 163
627
+ 164
628
+ 165
629
+ 166
630
+ 167
631
+ 168
632
+ 169
633
+ 170
634
+ 171
635
+ 172
636
+ 173
637
+ 174
638
+ 175
639
+ 176
640
+ 177
641
+ 178
642
+ 179
643
+ 180
644
+ 181
645
+ 182
646
+ 183
647
+ 184
648
+ 185
649
+ 186
650
+ 187
651
+ 188
652
+ 189
653
+ 190
654
+ 191</pre>
655
+ </td>
656
+ <td>
657
+ <pre class="code"><span class="info file"># File 'lib/term_utils/ff/finder.rb', line 160</span>
658
+
659
+ <span class='kw'>def</span> <span class='id identifier rubyid_list'>list</span><span class='lparen'>(</span><span class='id identifier rubyid_ctx'>ctx</span><span class='rparen'>)</span>
660
+ <span class='id identifier rubyid_path_parts'>path_parts</span> <span class='op'>=</span> <span class='id identifier rubyid_ctx'>ctx</span><span class='period'>.</span><span class='id identifier rubyid_fetch'>fetch</span><span class='lparen'>(</span><span class='symbol'>:path_parts</span><span class='comma'>,</span> <span class='lbracket'>[</span><span class='rbracket'>]</span><span class='rparen'>)</span>
661
+ <span class='id identifier rubyid_absolute_path'>absolute_path</span> <span class='op'>=</span>
662
+ <span class='kw'>if</span> <span class='id identifier rubyid_path_parts'>path_parts</span><span class='period'>.</span><span class='id identifier rubyid_empty?'>empty?</span>
663
+ <span class='id identifier rubyid_ctx'>ctx</span><span class='lbracket'>[</span><span class='symbol'>:basedir</span><span class='rbracket'>]</span>
664
+ <span class='kw'>else</span>
665
+ <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_ctx'>ctx</span><span class='lbracket'>[</span><span class='symbol'>:basedir</span><span class='rbracket'>]</span><span class='embexpr_end'>}</span><span class='tstring_content'>/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_path_parts'>path_parts</span><span class='period'>.</span><span class='id identifier rubyid_join'>join</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>/</span><span class='tstring_end'>&#39;</span></span><span class='rparen'>)</span><span class='embexpr_end'>}</span><span class='tstring_end'>&quot;</span></span>
666
+ <span class='kw'>end</span>
667
+ <span class='id identifier rubyid_entries'>entries</span> <span class='op'>=</span> <span class='const'>Dir</span><span class='period'>.</span><span class='id identifier rubyid_entries'>entries</span><span class='lparen'>(</span><span class='id identifier rubyid_absolute_path'>absolute_path</span><span class='rparen'>)</span>
668
+ <span class='id identifier rubyid_entries'>entries</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_name'>name</span><span class='op'>|</span>
669
+ <span class='kw'>next</span> <span class='kw'>if</span> <span class='qwords_beg'>%w[</span><span class='tstring_content'>.</span><span class='words_sep'> </span><span class='tstring_content'>..</span><span class='tstring_end'>]</span></span><span class='period'>.</span><span class='id identifier rubyid_include?'>include?</span><span class='lparen'>(</span><span class='id identifier rubyid_name'>name</span><span class='rparen'>)</span>
670
+
671
+ <span class='id identifier rubyid_entry'>entry</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="FinderEntry.html" title="TermUtils::FF::FinderEntry (class)">FinderEntry</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="FinderEntry.html#initialize-instance_method" title="TermUtils::FF::FinderEntry#initialize (method)">new</a></span></span><span class='period'>.</span><span class='id identifier rubyid_tap'>tap</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_e'>e</span><span class='op'>|</span>
672
+ <span class='id identifier rubyid_e'>e</span><span class='period'>.</span><span class='id identifier rubyid_index'>index</span> <span class='op'>=</span> <span class='id identifier rubyid_ctx'>ctx</span><span class='lbracket'>[</span><span class='symbol'>:entries</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_length'>length</span>
673
+ <span class='id identifier rubyid_e'>e</span><span class='period'>.</span><span class='id identifier rubyid_name'>name</span> <span class='op'>=</span> <span class='id identifier rubyid_name'>name</span>
674
+ <span class='kw'>if</span> <span class='ivar'>@query</span><span class='period'>.</span><span class='id identifier rubyid_use_stat'>use_stat</span>
675
+ <span class='id identifier rubyid_st'>st</span> <span class='op'>=</span> <span class='const'>File</span><span class='period'>.</span><span class='id identifier rubyid_stat'>stat</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_absolute_path'>absolute_path</span><span class='embexpr_end'>}</span><span class='tstring_content'>/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_name'>name</span><span class='embexpr_end'>}</span><span class='tstring_end'>&quot;</span></span><span class='rparen'>)</span>
676
+ <span class='id identifier rubyid_e'>e</span><span class='period'>.</span><span class='id identifier rubyid_kind'>kind</span> <span class='op'>=</span> <span class='id identifier rubyid_st'>st</span><span class='period'>.</span><span class='id identifier rubyid_ftype'>ftype</span>
677
+ <span class='id identifier rubyid_e'>e</span><span class='period'>.</span><span class='id identifier rubyid_uid'>uid</span> <span class='op'>=</span> <span class='id identifier rubyid_st'>st</span><span class='period'>.</span><span class='id identifier rubyid_uid'>uid</span>
678
+ <span class='id identifier rubyid_e'>e</span><span class='period'>.</span><span class='id identifier rubyid_gid'>gid</span> <span class='op'>=</span> <span class='id identifier rubyid_st'>st</span><span class='period'>.</span><span class='id identifier rubyid_gid'>gid</span>
679
+ <span class='id identifier rubyid_e'>e</span><span class='period'>.</span><span class='id identifier rubyid_mode'>mode</span> <span class='op'>=</span> <span class='id identifier rubyid_st'>st</span><span class='period'>.</span><span class='id identifier rubyid_mode'>mode</span>
680
+ <span class='id identifier rubyid_e'>e</span><span class='period'>.</span><span class='id identifier rubyid_size'>size</span> <span class='op'>=</span> <span class='id identifier rubyid_st'>st</span><span class='period'>.</span><span class='id identifier rubyid_size'>size</span>
681
+ <span class='kw'>end</span>
682
+ <span class='id identifier rubyid_e'>e</span><span class='period'>.</span><span class='id identifier rubyid_path_parts'>path_parts</span> <span class='op'>=</span> <span class='id identifier rubyid_path_parts'>path_parts</span><span class='period'>.</span><span class='id identifier rubyid_dup'>dup</span> <span class='op'>+</span> <span class='lbracket'>[</span><span class='id identifier rubyid_name'>name</span><span class='rbracket'>]</span>
683
+ <span class='id identifier rubyid_e'>e</span><span class='period'>.</span><span class='id identifier rubyid_path'>path</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_ctx'>ctx</span><span class='lbracket'>[</span><span class='symbol'>:basedir</span><span class='rbracket'>]</span><span class='embexpr_end'>}</span><span class='tstring_content'>/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_e'>e</span><span class='period'>.</span><span class='id identifier rubyid_path_parts'>path_parts</span><span class='period'>.</span><span class='id identifier rubyid_join'>join</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>/</span><span class='tstring_end'>&#39;</span></span><span class='rparen'>)</span><span class='embexpr_end'>}</span><span class='tstring_end'>&quot;</span></span>
684
+ <span class='kw'>end</span>
685
+ <span class='id identifier rubyid_ctx'>ctx</span><span class='lbracket'>[</span><span class='symbol'>:entries</span><span class='rbracket'>]</span> <span class='op'>&lt;&lt;</span> <span class='id identifier rubyid_entry'>entry</span> <span class='kw'>if</span> <span class='id identifier rubyid_match?'>match?</span><span class='lparen'>(</span><span class='id identifier rubyid_entry'>entry</span><span class='rparen'>)</span> <span class='op'>&amp;&amp;</span> <span class='id identifier rubyid_include?'>include?</span><span class='lparen'>(</span><span class='id identifier rubyid_entry'>entry</span><span class='rparen'>)</span>
686
+ <span class='kw'>if</span> <span class='id identifier rubyid_enter?'>enter?</span><span class='lparen'>(</span><span class='id identifier rubyid_entry'>entry</span><span class='rparen'>)</span>
687
+ <span class='id identifier rubyid_list'>list</span><span class='lparen'>(</span><span class='id identifier rubyid_ctx'>ctx</span><span class='period'>.</span><span class='id identifier rubyid_merge'>merge</span><span class='lparen'>(</span><span class='lbrace'>{</span> <span class='label'>path_parts:</span> <span class='id identifier rubyid_entry'>entry</span><span class='period'>.</span><span class='id identifier rubyid_path_parts'>path_parts</span> <span class='rbrace'>}</span><span class='rparen'>)</span><span class='rparen'>)</span>
688
+ <span class='kw'>end</span>
689
+ <span class='kw'>end</span>
690
+ <span class='kw'>end</span></pre>
691
+ </td>
692
+ </tr>
693
+ </table>
694
+ </div>
695
+
696
+ <div class="method_details ">
697
+ <h3 class="signature " id="list_start-instance_method">
698
+
699
+ #<strong>list_start</strong>(ctx) &#x21d2; <tt>Object</tt>
700
+
701
+
702
+
703
+
704
+
705
+ </h3><table class="source_code">
706
+ <tr>
707
+ <td>
708
+ <pre class="lines">
709
+
710
+
711
+ 139
712
+ 140
713
+ 141
714
+ 142
715
+ 143
716
+ 144
717
+ 145
718
+ 146
719
+ 147
720
+ 148
721
+ 149
722
+ 150
723
+ 151
724
+ 152
725
+ 153
726
+ 154
727
+ 155
728
+ 156
729
+ 157
730
+ 158</pre>
731
+ </td>
732
+ <td>
733
+ <pre class="code"><span class="info file"># File 'lib/term_utils/ff/finder.rb', line 139</span>
734
+
735
+ <span class='kw'>def</span> <span class='id identifier rubyid_list_start'>list_start</span><span class='lparen'>(</span><span class='id identifier rubyid_ctx'>ctx</span><span class='rparen'>)</span>
736
+ <span class='id identifier rubyid_entry'>entry</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="FinderEntry.html" title="TermUtils::FF::FinderEntry (class)">FinderEntry</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="FinderEntry.html#initialize-instance_method" title="TermUtils::FF::FinderEntry#initialize (method)">new</a></span></span><span class='period'>.</span><span class='id identifier rubyid_tap'>tap</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_e'>e</span><span class='op'>|</span>
737
+ <span class='id identifier rubyid_e'>e</span><span class='period'>.</span><span class='id identifier rubyid_index'>index</span> <span class='op'>=</span> <span class='id identifier rubyid_ctx'>ctx</span><span class='lbracket'>[</span><span class='symbol'>:entries</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_length'>length</span>
738
+ <span class='id identifier rubyid_e'>e</span><span class='period'>.</span><span class='id identifier rubyid_name'>name</span> <span class='op'>=</span> <span class='const'>File</span><span class='period'>.</span><span class='id identifier rubyid_basename'>basename</span><span class='lparen'>(</span><span class='id identifier rubyid_ctx'>ctx</span><span class='lbracket'>[</span><span class='symbol'>:basedir</span><span class='rbracket'>]</span><span class='rparen'>)</span>
739
+ <span class='kw'>if</span> <span class='ivar'>@query</span><span class='period'>.</span><span class='id identifier rubyid_use_stat'>use_stat</span>
740
+ <span class='id identifier rubyid_st'>st</span> <span class='op'>=</span> <span class='const'>File</span><span class='period'>.</span><span class='id identifier rubyid_stat'>stat</span><span class='lparen'>(</span><span class='id identifier rubyid_ctx'>ctx</span><span class='lbracket'>[</span><span class='symbol'>:basedir</span><span class='rbracket'>]</span><span class='rparen'>)</span>
741
+ <span class='id identifier rubyid_e'>e</span><span class='period'>.</span><span class='id identifier rubyid_kind'>kind</span> <span class='op'>=</span> <span class='id identifier rubyid_st'>st</span><span class='period'>.</span><span class='id identifier rubyid_ftype'>ftype</span>
742
+ <span class='id identifier rubyid_e'>e</span><span class='period'>.</span><span class='id identifier rubyid_uid'>uid</span> <span class='op'>=</span> <span class='id identifier rubyid_st'>st</span><span class='period'>.</span><span class='id identifier rubyid_uid'>uid</span>
743
+ <span class='id identifier rubyid_e'>e</span><span class='period'>.</span><span class='id identifier rubyid_gid'>gid</span> <span class='op'>=</span> <span class='id identifier rubyid_st'>st</span><span class='period'>.</span><span class='id identifier rubyid_gid'>gid</span>
744
+ <span class='id identifier rubyid_e'>e</span><span class='period'>.</span><span class='id identifier rubyid_mode'>mode</span> <span class='op'>=</span> <span class='id identifier rubyid_st'>st</span><span class='period'>.</span><span class='id identifier rubyid_mode'>mode</span>
745
+ <span class='id identifier rubyid_e'>e</span><span class='period'>.</span><span class='id identifier rubyid_size'>size</span> <span class='op'>=</span> <span class='id identifier rubyid_st'>st</span><span class='period'>.</span><span class='id identifier rubyid_size'>size</span>
746
+ <span class='kw'>end</span>
747
+ <span class='id identifier rubyid_e'>e</span><span class='period'>.</span><span class='id identifier rubyid_path_parts'>path_parts</span> <span class='op'>=</span> <span class='lbracket'>[</span><span class='rbracket'>]</span>
748
+ <span class='id identifier rubyid_e'>e</span><span class='period'>.</span><span class='id identifier rubyid_path'>path</span> <span class='op'>=</span> <span class='id identifier rubyid_ctx'>ctx</span><span class='lbracket'>[</span><span class='symbol'>:basedir</span><span class='rbracket'>]</span>
749
+ <span class='kw'>end</span>
750
+ <span class='id identifier rubyid_ctx'>ctx</span><span class='lbracket'>[</span><span class='symbol'>:entries</span><span class='rbracket'>]</span> <span class='op'>&lt;&lt;</span> <span class='id identifier rubyid_entry'>entry</span> <span class='kw'>if</span> <span class='id identifier rubyid_match?'>match?</span><span class='lparen'>(</span><span class='id identifier rubyid_entry'>entry</span><span class='rparen'>)</span> <span class='op'>&amp;&amp;</span> <span class='id identifier rubyid_include?'>include?</span><span class='lparen'>(</span><span class='id identifier rubyid_entry'>entry</span><span class='rparen'>)</span>
751
+ <span class='kw'>return</span> <span class='kw'>unless</span> <span class='id identifier rubyid_enter?'>enter?</span><span class='lparen'>(</span><span class='id identifier rubyid_entry'>entry</span><span class='rparen'>)</span>
752
+
753
+ <span class='id identifier rubyid_list'>list</span><span class='lparen'>(</span><span class='id identifier rubyid_ctx'>ctx</span><span class='rparen'>)</span>
754
+ <span class='kw'>end</span></pre>
755
+ </td>
756
+ </tr>
757
+ </table>
758
+ </div>
759
+
760
+ <div class="method_details ">
761
+ <h3 class="signature " id="match?-instance_method">
762
+
763
+ #<strong>match?</strong>(entry) &#x21d2; <tt>Boolean</tt>
764
+
765
+
766
+
767
+
768
+
769
+ </h3><div class="docstring">
770
+ <div class="discussion">
771
+
772
+
773
+ </div>
774
+ </div>
775
+ <div class="tags">
776
+
777
+ <p class="tag_title">Returns:</p>
778
+ <ul class="return">
779
+
780
+ <li>
781
+
782
+
783
+ <span class='type'>(<tt>Boolean</tt>)</span>
784
+
785
+
786
+
787
+ </li>
788
+
789
+ </ul>
790
+
791
+ </div><table class="source_code">
792
+ <tr>
793
+ <td>
794
+ <pre class="lines">
795
+
796
+
797
+ 193
798
+ 194
799
+ 195
800
+ 196
801
+ 197
802
+ 198
803
+ 199
804
+ 200
805
+ 201
806
+ 202
807
+ 203
808
+ 204
809
+ 205
810
+ 206
811
+ 207
812
+ 208</pre>
813
+ </td>
814
+ <td>
815
+ <pre class="code"><span class="info file"># File 'lib/term_utils/ff/finder.rb', line 193</span>
816
+
817
+ <span class='kw'>def</span> <span class='id identifier rubyid_match?'>match?</span><span class='lparen'>(</span><span class='id identifier rubyid_entry'>entry</span><span class='rparen'>)</span>
818
+ <span class='comment'># (1of2) Depth
819
+ </span> <span class='kw'>return</span> <span class='kw'>false</span> <span class='kw'>if</span> <span class='id identifier rubyid_entry'>entry</span><span class='period'>.</span><span class='id identifier rubyid_depth'>depth</span> <span class='op'>&lt;</span> <span class='ivar'>@query</span><span class='period'>.</span><span class='id identifier rubyid_min_depth'>min_depth</span>
820
+ <span class='kw'>return</span> <span class='kw'>false</span> <span class='kw'>if</span> <span class='op'>!</span><span class='ivar'>@query</span><span class='period'>.</span><span class='id identifier rubyid_max_depth'>max_depth</span><span class='period'>.</span><span class='id identifier rubyid_nil?'>nil?</span> <span class='op'>&amp;&amp;</span> <span class='id identifier rubyid_entry'>entry</span><span class='period'>.</span><span class='id identifier rubyid_depth'>depth</span> <span class='op'>&gt;</span> <span class='ivar'>@query</span><span class='period'>.</span><span class='id identifier rubyid_max_depth'>max_depth</span>
821
+
822
+ <span class='comment'># (2of2) Entry kind.
823
+ </span> <span class='kw'>if</span> <span class='ivar'>@query</span><span class='period'>.</span><span class='id identifier rubyid_entry_kind'>entry_kind</span><span class='period'>.</span><span class='id identifier rubyid_nil?'>nil?</span>
824
+ <span class='kw'>true</span>
825
+ <span class='kw'>elsif</span> <span class='ivar'>@query</span><span class='period'>.</span><span class='id identifier rubyid_entry_kind'>entry_kind</span><span class='period'>.</span><span class='id identifier rubyid_is_a?'>is_a?</span><span class='lparen'>(</span><span class='const'>String</span><span class='rparen'>)</span>
826
+ <span class='id identifier rubyid_entry'>entry</span><span class='period'>.</span><span class='id identifier rubyid_kind'>kind</span> <span class='op'>==</span> <span class='ivar'>@query</span><span class='period'>.</span><span class='id identifier rubyid_entry_kind'>entry_kind</span>
827
+ <span class='kw'>elsif</span> <span class='ivar'>@query</span><span class='period'>.</span><span class='id identifier rubyid_entry_kind'>entry_kind</span><span class='period'>.</span><span class='id identifier rubyid_is_a?'>is_a?</span><span class='lparen'>(</span><span class='const'>Array</span><span class='rparen'>)</span>
828
+ <span class='ivar'>@query</span><span class='period'>.</span><span class='id identifier rubyid_entry_kind'>entry_kind</span><span class='period'>.</span><span class='id identifier rubyid_include?'>include?</span><span class='lparen'>(</span><span class='id identifier rubyid_entry'>entry</span><span class='period'>.</span><span class='id identifier rubyid_kind'>kind</span><span class='rparen'>)</span>
829
+ <span class='kw'>else</span>
830
+ <span class='kw'>false</span>
831
+ <span class='kw'>end</span>
832
+ <span class='kw'>end</span></pre>
833
+ </td>
834
+ </tr>
835
+ </table>
836
+ </div>
837
+
838
+ </div>
839
+
840
+ </div>
841
+
842
+ <div id="footer">
843
+ Generated on Wed Aug 9 17:34:27 2023 by
844
+ <a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
845
+ 0.9.34 (ruby-3.2.2).
846
+ </div>
847
+
848
+ </div>
849
+ </body>
850
+ </html>