dirtravel 0.0.2 → 0.0.3

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.
@@ -0,0 +1,1246 @@
1
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
2
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
4
+ <head>
5
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
6
+ <title>
7
+ Class: DirTravel::Entry
8
+
9
+ &mdash; Documentation by YARD 0.8.6.1
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
+ hasFrames = window.top.frames.main ? true : false;
19
+ relpath = '../';
20
+ framesUrl = "../frames.html#!" + escape(window.location.href);
21
+ </script>
22
+
23
+
24
+ <script type="text/javascript" charset="utf-8" src="../js/jquery.js"></script>
25
+
26
+ <script type="text/javascript" charset="utf-8" src="../js/app.js"></script>
27
+
28
+
29
+ </head>
30
+ <body>
31
+ <div id="header">
32
+ <div id="menu">
33
+
34
+ <a href="../_index.html">Index (E)</a> &raquo;
35
+ <span class='title'><span class='object_link'><a href="../DirTravel.html" title="DirTravel (module)">DirTravel</a></span></span>
36
+ &raquo;
37
+ <span class="title">Entry</span>
38
+
39
+
40
+ <div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
41
+ </div>
42
+
43
+ <div id="search">
44
+
45
+ <a class="full_list_link" id="class_list_link"
46
+ href="../class_list.html">
47
+ Class List
48
+ </a>
49
+
50
+ <a class="full_list_link" id="method_list_link"
51
+ href="../method_list.html">
52
+ Method List
53
+ </a>
54
+
55
+ <a class="full_list_link" id="file_list_link"
56
+ href="../file_list.html">
57
+ File List
58
+ </a>
59
+
60
+ </div>
61
+ <div class="clear"></div>
62
+ </div>
63
+
64
+ <iframe id="search_frame"></iframe>
65
+
66
+ <div id="content"><h1>Class: DirTravel::Entry
67
+
68
+
69
+
70
+ </h1>
71
+
72
+ <dl class="box">
73
+
74
+ <dt class="r1">Inherits:</dt>
75
+ <dd class="r1">
76
+ <span class="inheritName">Tree::TreeNode</span>
77
+
78
+ <ul class="fullTree">
79
+ <li>Object</li>
80
+
81
+ <li class="next">Tree::TreeNode</li>
82
+
83
+ <li class="next">DirTravel::Entry</li>
84
+
85
+ </ul>
86
+ <a href="#" class="inheritanceTree">show all</a>
87
+
88
+ </dd>
89
+
90
+
91
+
92
+
93
+
94
+
95
+
96
+
97
+
98
+ <dt class="r2 last">Defined in:</dt>
99
+ <dd class="r2 last">lib/dirtravel.rb</dd>
100
+
101
+ </dl>
102
+ <div class="clear"></div>
103
+
104
+ <h2>Overview</h2><div class="docstring">
105
+ <div class="discussion">
106
+
107
+ <p>Extend RubyTree base class with file and directory features.</p>
108
+
109
+
110
+ </div>
111
+ </div>
112
+ <div class="tags">
113
+
114
+
115
+ </div><div id="subclasses">
116
+ <h2>Direct Known Subclasses</h2>
117
+ <p class="children"><span class='object_link'><a href="DirEntry.html" title="DirTravel::DirEntry (class)">DirEntry</a></span>, <span class='object_link'><a href="FileEntry.html" title="DirTravel::FileEntry (class)">FileEntry</a></span></p>
118
+ </div>
119
+
120
+
121
+
122
+
123
+ <h2>Instance Attribute Summary <small>(<a href="#" class="summary_toggle">collapse</a>)</small></h2>
124
+ <ul class="summary">
125
+
126
+ <li class="public ">
127
+ <span class="summary_signature">
128
+
129
+ <a href="#name-instance_method" title="#name (instance method)">- (Object) <strong>name</strong> </a>
130
+
131
+
132
+
133
+ </span>
134
+
135
+
136
+
137
+
138
+
139
+
140
+
141
+
142
+
143
+
144
+
145
+
146
+ <span class="summary_desc"><div class='inline'>
147
+ <p>Returns the value of attribute name.</p>
148
+ </div></span>
149
+
150
+ </li>
151
+
152
+
153
+ </ul>
154
+
155
+
156
+
157
+
158
+
159
+ <h2>
160
+ Instance Method Summary
161
+ <small>(<a href="#" class="summary_toggle">collapse</a>)</small>
162
+ </h2>
163
+
164
+ <ul class="summary">
165
+
166
+ <li class="public ">
167
+ <span class="summary_signature">
168
+
169
+ <a href="#abspath-instance_method" title="#abspath (instance method)">- (Object) <strong>abspath</strong> </a>
170
+
171
+
172
+
173
+ </span>
174
+
175
+
176
+
177
+
178
+
179
+
180
+
181
+
182
+
183
+ <span class="summary_desc"><div class='inline'>
184
+ <p>Absolute path.</p>
185
+ </div></span>
186
+
187
+ </li>
188
+
189
+
190
+ <li class="public ">
191
+ <span class="summary_signature">
192
+
193
+ <a href="#dir-instance_method" title="#dir (instance method)">- (String) <strong>dir</strong>(basedir = self) </a>
194
+
195
+
196
+
197
+ </span>
198
+
199
+
200
+
201
+
202
+
203
+
204
+
205
+
206
+
207
+ <span class="summary_desc"><div class='inline'>
208
+ <p>Relative path of parenting directory.</p>
209
+ </div></span>
210
+
211
+ </li>
212
+
213
+
214
+ <li class="public ">
215
+ <span class="summary_signature">
216
+
217
+ <a href="#files-instance_method" title="#files (instance method)">- (Object) <strong>files</strong> </a>
218
+
219
+
220
+
221
+ </span>
222
+
223
+
224
+
225
+
226
+
227
+
228
+
229
+
230
+
231
+ <span class="summary_desc"><div class='inline'>
232
+ <p>Return all file entries in hierarchy.</p>
233
+ </div></span>
234
+
235
+ </li>
236
+
237
+
238
+ <li class="public ">
239
+ <span class="summary_signature">
240
+
241
+ <a href="#initialize-instance_method" title="#initialize (instance method)">- (Entry) <strong>initialize</strong>(name) </a>
242
+
243
+
244
+
245
+ </span>
246
+
247
+
248
+ <span class="note title constructor">constructor</span>
249
+
250
+
251
+
252
+
253
+
254
+
255
+
256
+
257
+ <span class="summary_desc"><div class='inline'>
258
+ <p>A new instance of Entry.</p>
259
+ </div></span>
260
+
261
+ </li>
262
+
263
+
264
+ <li class="public ">
265
+ <span class="summary_signature">
266
+
267
+ <a href="#parts-instance_method" title="#parts (instance method)">- (Array) <strong>parts</strong>(basedir = self) </a>
268
+
269
+
270
+
271
+ (also: #pathArray)
272
+
273
+ </span>
274
+
275
+
276
+
277
+
278
+
279
+
280
+
281
+
282
+
283
+ <span class="summary_desc"><div class='inline'>
284
+ <p>Return path components as Array.</p>
285
+ </div></span>
286
+
287
+ </li>
288
+
289
+
290
+ <li class="public ">
291
+ <span class="summary_signature">
292
+
293
+ <a href="#path-instance_method" title="#path (instance method)">- (Object) <strong>path</strong> </a>
294
+
295
+
296
+
297
+ </span>
298
+
299
+
300
+
301
+
302
+
303
+
304
+
305
+
306
+
307
+ <span class="summary_desc"><div class='inline'>
308
+ <p>Relative path.</p>
309
+ </div></span>
310
+
311
+ </li>
312
+
313
+
314
+ <li class="public ">
315
+ <span class="summary_signature">
316
+
317
+ <a href="#relative%3F-instance_method" title="#relative? (instance method)">- (Boolean) <strong>relative?</strong> </a>
318
+
319
+
320
+
321
+ </span>
322
+
323
+
324
+
325
+
326
+
327
+
328
+
329
+
330
+
331
+ <span class="summary_desc"><div class='inline'>
332
+ <p>Relative path Entry.</p>
333
+ </div></span>
334
+
335
+ </li>
336
+
337
+
338
+ <li class="public ">
339
+ <span class="summary_signature">
340
+
341
+ <a href="#rename-instance_method" title="#rename (instance method)">- (Object) <strong>rename</strong>(name) </a>
342
+
343
+
344
+
345
+ </span>
346
+
347
+
348
+
349
+
350
+
351
+
352
+
353
+
354
+
355
+ <span class="summary_desc"><div class='inline'>
356
+ <p>Rename node.</p>
357
+ </div></span>
358
+
359
+ </li>
360
+
361
+
362
+ <li class="public ">
363
+ <span class="summary_signature">
364
+
365
+ <a href="#select_level-instance_method" title="#select_level (instance method)">- (Array) <strong>select_level</strong>(level) </a>
366
+
367
+
368
+
369
+ </span>
370
+
371
+
372
+
373
+
374
+
375
+
376
+
377
+
378
+
379
+ <span class="summary_desc"><div class='inline'>
380
+ <p>Select all siblings from given node depth.</p>
381
+ </div></span>
382
+
383
+ </li>
384
+
385
+
386
+ <li class="public ">
387
+ <span class="summary_signature">
388
+
389
+ <a href="#stat-instance_method" title="#stat (instance method)">- (Object) <strong>stat</strong> </a>
390
+
391
+
392
+
393
+ </span>
394
+
395
+
396
+
397
+
398
+
399
+
400
+
401
+
402
+
403
+ <span class="summary_desc"><div class='inline'>
404
+ <p>File.stat data for the Entry.</p>
405
+ </div></span>
406
+
407
+ </li>
408
+
409
+
410
+ <li class="public ">
411
+ <span class="summary_signature">
412
+
413
+ <a href="#subpath-instance_method" title="#subpath (instance method)">- (Object) <strong>subpath</strong>(level = 1) </a>
414
+
415
+
416
+
417
+ </span>
418
+
419
+
420
+
421
+
422
+
423
+
424
+
425
+
426
+
427
+ <span class="summary_desc"><div class='inline'>
428
+ <p>Relative path under root.</p>
429
+ </div></span>
430
+
431
+ </li>
432
+
433
+
434
+ <li class="public ">
435
+ <span class="summary_signature">
436
+
437
+ <a href="#tip-instance_method" title="#tip (instance method)">- (Object) <strong>tip</strong> </a>
438
+
439
+
440
+
441
+ </span>
442
+
443
+
444
+
445
+
446
+
447
+
448
+
449
+
450
+
451
+ <span class="summary_desc"><div class='inline'>
452
+ <p>Top directory name (usually same as name).</p>
453
+ </div></span>
454
+
455
+ </li>
456
+
457
+
458
+ </ul>
459
+
460
+
461
+
462
+ <div id="constructor_details" class="method_details_list">
463
+ <h2>Constructor Details</h2>
464
+
465
+ <div class="method_details first">
466
+ <h3 class="signature first" id="initialize-instance_method">
467
+
468
+ - (<tt><span class='object_link'><a href="" title="DirTravel::Entry (class)">Entry</a></span></tt>) <strong>initialize</strong>(name)
469
+
470
+
471
+
472
+
473
+
474
+ </h3><div class="docstring">
475
+ <div class="discussion">
476
+
477
+ <p>A new instance of Entry</p>
478
+
479
+
480
+ </div>
481
+ </div>
482
+ <div class="tags">
483
+
484
+
485
+ </div><table class="source_code">
486
+ <tr>
487
+ <td>
488
+ <pre class="lines">
489
+
490
+
491
+ 49
492
+ 50
493
+ 51
494
+ 52</pre>
495
+ </td>
496
+ <td>
497
+ <pre class="code"><span class="info file"># File 'lib/dirtravel.rb', line 49</span>
498
+
499
+ <span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span><span class='lparen'>(</span> <span class='id identifier rubyid_name'>name</span> <span class='rparen'>)</span>
500
+ <span class='kw'>super</span><span class='lparen'>(</span> <span class='id identifier rubyid_name'>name</span><span class='comma'>,</span> <span class='kw'>nil</span> <span class='rparen'>)</span>
501
+ <span class='ivar'>@abspath</span> <span class='op'>=</span> <span class='kw'>nil</span>
502
+ <span class='kw'>end</span></pre>
503
+ </td>
504
+ </tr>
505
+ </table>
506
+ </div>
507
+
508
+ </div>
509
+
510
+ <div id="instance_attr_details" class="attr_details">
511
+ <h2>Instance Attribute Details</h2>
512
+
513
+
514
+ <span id="name=-instance_method"></span>
515
+ <div class="method_details first">
516
+ <h3 class="signature first" id="name-instance_method">
517
+
518
+ - (<tt>Object</tt>) <strong>name</strong>
519
+
520
+
521
+
522
+
523
+
524
+ </h3><div class="docstring">
525
+ <div class="discussion">
526
+
527
+ <p>Returns the value of attribute name</p>
528
+
529
+
530
+ </div>
531
+ </div>
532
+ <div class="tags">
533
+
534
+
535
+ </div><table class="source_code">
536
+ <tr>
537
+ <td>
538
+ <pre class="lines">
539
+
540
+
541
+ 47
542
+ 48
543
+ 49</pre>
544
+ </td>
545
+ <td>
546
+ <pre class="code"><span class="info file"># File 'lib/dirtravel.rb', line 47</span>
547
+
548
+ <span class='kw'>def</span> <span class='id identifier rubyid_name'>name</span>
549
+ <span class='ivar'>@name</span>
550
+ <span class='kw'>end</span></pre>
551
+ </td>
552
+ </tr>
553
+ </table>
554
+ </div>
555
+
556
+ </div>
557
+
558
+
559
+ <div id="instance_method_details" class="method_details_list">
560
+ <h2>Instance Method Details</h2>
561
+
562
+
563
+ <div class="method_details first">
564
+ <h3 class="signature first" id="abspath-instance_method">
565
+
566
+ - (<tt>Object</tt>) <strong>abspath</strong>
567
+
568
+
569
+
570
+
571
+
572
+ </h3><div class="docstring">
573
+ <div class="discussion">
574
+
575
+ <p>Absolute path.</p>
576
+
577
+
578
+ </div>
579
+ </div>
580
+ <div class="tags">
581
+
582
+
583
+ </div><table class="source_code">
584
+ <tr>
585
+ <td>
586
+ <pre class="lines">
587
+
588
+
589
+ 90
590
+ 91
591
+ 92
592
+ 93
593
+ 94
594
+ 95
595
+ 96
596
+ 97
597
+ 98</pre>
598
+ </td>
599
+ <td>
600
+ <pre class="code"><span class="info file"># File 'lib/dirtravel.rb', line 90</span>
601
+
602
+ <span class='kw'>def</span> <span class='id identifier rubyid_abspath'>abspath</span>
603
+ <span class='kw'>if</span> <span class='ivar'>@abspath</span>
604
+ <span class='ivar'>@abspath</span>
605
+ <span class='kw'>elsif</span> <span class='kw'>self</span> <span class='op'>==</span> <span class='id identifier rubyid_root'>root</span>
606
+ <span class='const'>Dir</span><span class='period'>.</span><span class='id identifier rubyid_pwd'>pwd</span>
607
+ <span class='kw'>else</span>
608
+ <span class='id identifier rubyid_root'>root</span><span class='period'>.</span><span class='id identifier rubyid_abspath'>abspath</span> <span class='op'>+</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>/</span><span class='tstring_end'>'</span></span> <span class='op'>+</span> <span class='id identifier rubyid_subpath'>subpath</span>
609
+ <span class='kw'>end</span>
610
+ <span class='kw'>end</span></pre>
611
+ </td>
612
+ </tr>
613
+ </table>
614
+ </div>
615
+
616
+ <div class="method_details ">
617
+ <h3 class="signature " id="dir-instance_method">
618
+
619
+ - (<tt>String</tt>) <strong>dir</strong>(basedir = self)
620
+
621
+
622
+
623
+
624
+
625
+ </h3><div class="docstring">
626
+ <div class="discussion">
627
+
628
+ <p>Relative path of parenting directory.</p>
629
+
630
+
631
+ </div>
632
+ </div>
633
+ <div class="tags">
634
+ <p class="tag_title">Parameters:</p>
635
+ <ul class="param">
636
+
637
+ <li>
638
+
639
+ <span class='name'>basedir</span>
640
+
641
+
642
+ <span class='type'>(<tt><span class='object_link'><a href="" title="DirTravel::Entry (class)">Entry</a></span></tt>)</span>
643
+
644
+
645
+ <em class="default">(defaults to: <tt>self</tt>)</em>
646
+
647
+
648
+ &mdash;
649
+ <div class='inline'>
650
+ <p>Starting level for the hierarchy.</p>
651
+ </div>
652
+
653
+ </li>
654
+
655
+ </ul>
656
+
657
+ <p class="tag_title">Returns:</p>
658
+ <ul class="return">
659
+
660
+ <li>
661
+
662
+
663
+ <span class='type'>(<tt>String</tt>)</span>
664
+
665
+
666
+
667
+ &mdash;
668
+ <div class='inline'>
669
+ <p>Containing directory.</p>
670
+ </div>
671
+
672
+ </li>
673
+
674
+ </ul>
675
+
676
+ </div><table class="source_code">
677
+ <tr>
678
+ <td>
679
+ <pre class="lines">
680
+
681
+
682
+ 111
683
+ 112
684
+ 113</pre>
685
+ </td>
686
+ <td>
687
+ <pre class="code"><span class="info file"># File 'lib/dirtravel.rb', line 111</span>
688
+
689
+ <span class='kw'>def</span> <span class='id identifier rubyid_dir'>dir</span><span class='lparen'>(</span> <span class='id identifier rubyid_basedir'>basedir</span> <span class='op'>=</span> <span class='kw'>self</span> <span class='rparen'>)</span>
690
+ <span class='id identifier rubyid_parts'>parts</span><span class='lparen'>(</span> <span class='id identifier rubyid_basedir'>basedir</span><span class='period'>.</span><span class='id identifier rubyid_parent'>parent</span> <span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_join'>join</span><span class='lparen'>(</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>/</span><span class='tstring_end'>'</span></span> <span class='rparen'>)</span>
691
+ <span class='kw'>end</span></pre>
692
+ </td>
693
+ </tr>
694
+ </table>
695
+ </div>
696
+
697
+ <div class="method_details ">
698
+ <h3 class="signature " id="files-instance_method">
699
+
700
+ - (<tt>Object</tt>) <strong>files</strong>
701
+
702
+
703
+
704
+
705
+
706
+ </h3><div class="docstring">
707
+ <div class="discussion">
708
+
709
+ <p>Return all file entries in hierarchy.</p>
710
+
711
+
712
+ </div>
713
+ </div>
714
+ <div class="tags">
715
+
716
+
717
+ </div><table class="source_code">
718
+ <tr>
719
+ <td>
720
+ <pre class="lines">
721
+
722
+
723
+ 127
724
+ 128
725
+ 129</pre>
726
+ </td>
727
+ <td>
728
+ <pre class="code"><span class="info file"># File 'lib/dirtravel.rb', line 127</span>
729
+
730
+ <span class='kw'>def</span> <span class='id identifier rubyid_files'>files</span>
731
+ <span class='id identifier rubyid_select'>select</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_i'>i</span><span class='op'>|</span> <span class='id identifier rubyid_i'>i</span><span class='period'>.</span><span class='id identifier rubyid_kind_of?'>kind_of?</span><span class='lparen'>(</span> <span class='const'>FileEntry</span> <span class='rparen'>)</span> <span class='kw'>end</span>
732
+ <span class='kw'>end</span></pre>
733
+ </td>
734
+ </tr>
735
+ </table>
736
+ </div>
737
+
738
+ <div class="method_details ">
739
+ <h3 class="signature " id="parts-instance_method">
740
+
741
+ - (<tt>Array</tt>) <strong>parts</strong>(basedir = self)
742
+
743
+
744
+
745
+ <span class="aliases">Also known as:
746
+ <span class="names"><span id='pathArray-instance_method'>pathArray</span></span>
747
+ </span>
748
+
749
+
750
+
751
+ </h3><div class="docstring">
752
+ <div class="discussion">
753
+
754
+ <p>Return path components as Array.</p>
755
+
756
+
757
+ </div>
758
+ </div>
759
+ <div class="tags">
760
+ <p class="tag_title">Parameters:</p>
761
+ <ul class="param">
762
+
763
+ <li>
764
+
765
+ <span class='name'>basedir</span>
766
+
767
+
768
+ <span class='type'>(<tt><span class='object_link'><a href="" title="DirTravel::Entry (class)">Entry</a></span></tt>)</span>
769
+
770
+
771
+ <em class="default">(defaults to: <tt>self</tt>)</em>
772
+
773
+
774
+ &mdash;
775
+ <div class='inline'>
776
+ <p>Starting level for the hierarchy.</p>
777
+ </div>
778
+
779
+ </li>
780
+
781
+ </ul>
782
+
783
+ <p class="tag_title">Returns:</p>
784
+ <ul class="return">
785
+
786
+ <li>
787
+
788
+
789
+ <span class='type'>(<tt>Array</tt>)</span>
790
+
791
+
792
+
793
+ &mdash;
794
+ <div class='inline'>
795
+ <p>Array of names in hierarchy.</p>
796
+ </div>
797
+
798
+ </li>
799
+
800
+ </ul>
801
+
802
+ </div><table class="source_code">
803
+ <tr>
804
+ <td>
805
+ <pre class="lines">
806
+
807
+
808
+ 59
809
+ 60
810
+ 61
811
+ 62
812
+ 63
813
+ 64
814
+ 65
815
+ 66</pre>
816
+ </td>
817
+ <td>
818
+ <pre class="code"><span class="info file"># File 'lib/dirtravel.rb', line 59</span>
819
+
820
+ <span class='kw'>def</span> <span class='id identifier rubyid_parts'>parts</span><span class='lparen'>(</span> <span class='id identifier rubyid_basedir'>basedir</span> <span class='op'>=</span> <span class='kw'>self</span> <span class='rparen'>)</span>
821
+ <span class='id identifier rubyid_parents'>parents</span> <span class='op'>=</span> <span class='lbracket'>[</span><span class='rbracket'>]</span>
822
+ <span class='kw'>while</span> <span class='id identifier rubyid_basedir'>basedir</span>
823
+ <span class='id identifier rubyid_parents'>parents</span><span class='period'>.</span><span class='id identifier rubyid_push'>push</span> <span class='id identifier rubyid_basedir'>basedir</span><span class='period'>.</span><span class='id identifier rubyid_tip'>tip</span>
824
+ <span class='id identifier rubyid_basedir'>basedir</span> <span class='op'>=</span> <span class='id identifier rubyid_basedir'>basedir</span><span class='period'>.</span><span class='id identifier rubyid_parent'>parent</span>
825
+ <span class='kw'>end</span>
826
+ <span class='id identifier rubyid_parents'>parents</span><span class='period'>.</span><span class='id identifier rubyid_reverse'>reverse</span>
827
+ <span class='kw'>end</span></pre>
828
+ </td>
829
+ </tr>
830
+ </table>
831
+ </div>
832
+
833
+ <div class="method_details ">
834
+ <h3 class="signature " id="path-instance_method">
835
+
836
+ - (<tt>Object</tt>) <strong>path</strong>
837
+
838
+
839
+
840
+
841
+
842
+ </h3><div class="docstring">
843
+ <div class="discussion">
844
+
845
+ <p>Relative path.</p>
846
+
847
+
848
+ </div>
849
+ </div>
850
+ <div class="tags">
851
+
852
+
853
+ </div><table class="source_code">
854
+ <tr>
855
+ <td>
856
+ <pre class="lines">
857
+
858
+
859
+ 72
860
+ 73
861
+ 74</pre>
862
+ </td>
863
+ <td>
864
+ <pre class="code"><span class="info file"># File 'lib/dirtravel.rb', line 72</span>
865
+
866
+ <span class='kw'>def</span> <span class='id identifier rubyid_path'>path</span>
867
+ <span class='id identifier rubyid_parts'>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'>'</span><span class='tstring_content'>/</span><span class='tstring_end'>'</span></span> <span class='rparen'>)</span>
868
+ <span class='kw'>end</span></pre>
869
+ </td>
870
+ </tr>
871
+ </table>
872
+ </div>
873
+
874
+ <div class="method_details ">
875
+ <h3 class="signature " id="relative?-instance_method">
876
+
877
+ - (<tt>Boolean</tt>) <strong>relative?</strong>
878
+
879
+
880
+
881
+
882
+
883
+ </h3><div class="docstring">
884
+ <div class="discussion">
885
+
886
+ <p>Relative path Entry.</p>
887
+
888
+
889
+ </div>
890
+ </div>
891
+ <div class="tags">
892
+
893
+ <p class="tag_title">Returns:</p>
894
+ <ul class="return">
895
+
896
+ <li>
897
+
898
+
899
+ <span class='type'>(<tt>Boolean</tt>)</span>
900
+
901
+
902
+
903
+ </li>
904
+
905
+ </ul>
906
+
907
+ </div><table class="source_code">
908
+ <tr>
909
+ <td>
910
+ <pre class="lines">
911
+
912
+
913
+ 138
914
+ 139
915
+ 140</pre>
916
+ </td>
917
+ <td>
918
+ <pre class="code"><span class="info file"># File 'lib/dirtravel.rb', line 138</span>
919
+
920
+ <span class='kw'>def</span> <span class='id identifier rubyid_relative?'>relative?</span>
921
+ <span class='ivar'>@name</span><span class='lbracket'>[</span><span class='int'>0</span><span class='rbracket'>]</span> <span class='op'>!=</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>/</span><span class='tstring_end'>'</span></span>
922
+ <span class='kw'>end</span></pre>
923
+ </td>
924
+ </tr>
925
+ </table>
926
+ </div>
927
+
928
+ <div class="method_details ">
929
+ <h3 class="signature " id="rename-instance_method">
930
+
931
+ - (<tt>Object</tt>) <strong>rename</strong>(name)
932
+
933
+
934
+
935
+
936
+
937
+ </h3><div class="docstring">
938
+ <div class="discussion">
939
+
940
+ <p>Rename node.</p>
941
+
942
+
943
+ </div>
944
+ </div>
945
+ <div class="tags">
946
+ <p class="tag_title">Parameters:</p>
947
+ <ul class="param">
948
+
949
+ <li>
950
+
951
+ <span class='name'>name</span>
952
+
953
+
954
+ <span class='type'>(<tt>String</tt>)</span>
955
+
956
+
957
+
958
+ &mdash;
959
+ <div class='inline'>
960
+ <p>If name is abspath then Entry becomes abspath.</p>
961
+ </div>
962
+
963
+ </li>
964
+
965
+ </ul>
966
+
967
+
968
+ </div><table class="source_code">
969
+ <tr>
970
+ <td>
971
+ <pre class="lines">
972
+
973
+
974
+ 146
975
+ 147
976
+ 148
977
+ 149
978
+ 150
979
+ 151
980
+ 152
981
+ 153
982
+ 154
983
+ 155</pre>
984
+ </td>
985
+ <td>
986
+ <pre class="code"><span class="info file"># File 'lib/dirtravel.rb', line 146</span>
987
+
988
+ <span class='kw'>def</span> <span class='id identifier rubyid_rename'>rename</span><span class='lparen'>(</span> <span class='id identifier rubyid_name'>name</span> <span class='rparen'>)</span>
989
+ <span class='ivar'>@name</span> <span class='op'>=</span> <span class='id identifier rubyid_name'>name</span>
990
+
991
+ <span class='comment'># Absolute or relative path?
992
+ </span> <span class='kw'>if</span> <span class='id identifier rubyid_name'>name</span><span class='lbracket'>[</span><span class='int'>0</span><span class='rbracket'>]</span> <span class='op'>==</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>/</span><span class='tstring_end'>&quot;</span></span>
993
+ <span class='ivar'>@abspath</span> <span class='op'>=</span> <span class='id identifier rubyid_name'>name</span>
994
+ <span class='kw'>else</span>
995
+ <span class='ivar'>@abspath</span> <span class='op'>=</span> <span class='kw'>nil</span>
996
+ <span class='kw'>end</span>
997
+ <span class='kw'>end</span></pre>
998
+ </td>
999
+ </tr>
1000
+ </table>
1001
+ </div>
1002
+
1003
+ <div class="method_details ">
1004
+ <h3 class="signature " id="select_level-instance_method">
1005
+
1006
+ - (<tt>Array</tt>) <strong>select_level</strong>(level)
1007
+
1008
+
1009
+
1010
+
1011
+
1012
+ </h3><div class="docstring">
1013
+ <div class="discussion">
1014
+
1015
+ <p>Select all siblings from given node depth.</p>
1016
+
1017
+
1018
+ </div>
1019
+ </div>
1020
+ <div class="tags">
1021
+ <p class="tag_title">Parameters:</p>
1022
+ <ul class="param">
1023
+
1024
+ <li>
1025
+
1026
+ <span class='name'>level</span>
1027
+
1028
+
1029
+ <span class='type'>(<tt>Integer</tt>)</span>
1030
+
1031
+
1032
+
1033
+ &mdash;
1034
+ <div class='inline'>
1035
+ <p>Selected level in hierachy. Level is number of steps down in hierarhcy.</p>
1036
+ </div>
1037
+
1038
+ </li>
1039
+
1040
+ </ul>
1041
+
1042
+ <p class="tag_title">Returns:</p>
1043
+ <ul class="return">
1044
+
1045
+ <li>
1046
+
1047
+
1048
+ <span class='type'>(<tt>Array</tt>)</span>
1049
+
1050
+
1051
+
1052
+ &mdash;
1053
+ <div class='inline'>
1054
+ <p>Array of siblings in selected hierarchy.</p>
1055
+ </div>
1056
+
1057
+ </li>
1058
+
1059
+ </ul>
1060
+
1061
+ </div><table class="source_code">
1062
+ <tr>
1063
+ <td>
1064
+ <pre class="lines">
1065
+
1066
+
1067
+ 121
1068
+ 122
1069
+ 123</pre>
1070
+ </td>
1071
+ <td>
1072
+ <pre class="code"><span class="info file"># File 'lib/dirtravel.rb', line 121</span>
1073
+
1074
+ <span class='kw'>def</span> <span class='id identifier rubyid_select_level'>select_level</span><span class='lparen'>(</span> <span class='id identifier rubyid_level'>level</span> <span class='rparen'>)</span>
1075
+ <span class='id identifier rubyid_select'>select</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_i'>i</span><span class='op'>|</span> <span class='id identifier rubyid_i'>i</span><span class='period'>.</span><span class='id identifier rubyid_node_depth'>node_depth</span> <span class='op'>==</span> <span class='id identifier rubyid_level'>level</span><span class='semicolon'>;</span> <span class='kw'>end</span>
1076
+ <span class='kw'>end</span></pre>
1077
+ </td>
1078
+ </tr>
1079
+ </table>
1080
+ </div>
1081
+
1082
+ <div class="method_details ">
1083
+ <h3 class="signature " id="stat-instance_method">
1084
+
1085
+ - (<tt>Object</tt>) <strong>stat</strong>
1086
+
1087
+
1088
+
1089
+
1090
+
1091
+ </h3><div class="docstring">
1092
+ <div class="discussion">
1093
+
1094
+ <p>File.stat data for the Entry.</p>
1095
+
1096
+
1097
+ </div>
1098
+ </div>
1099
+ <div class="tags">
1100
+
1101
+
1102
+ </div><table class="source_code">
1103
+ <tr>
1104
+ <td>
1105
+ <pre class="lines">
1106
+
1107
+
1108
+ 133
1109
+ 134
1110
+ 135</pre>
1111
+ </td>
1112
+ <td>
1113
+ <pre class="code"><span class="info file"># File 'lib/dirtravel.rb', line 133</span>
1114
+
1115
+ <span class='kw'>def</span> <span class='id identifier rubyid_stat'>stat</span>
1116
+ <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_path'>path</span> <span class='rparen'>)</span>
1117
+ <span class='kw'>end</span></pre>
1118
+ </td>
1119
+ </tr>
1120
+ </table>
1121
+ </div>
1122
+
1123
+ <div class="method_details ">
1124
+ <h3 class="signature " id="subpath-instance_method">
1125
+
1126
+ - (<tt>Object</tt>) <strong>subpath</strong>(level = 1)
1127
+
1128
+
1129
+
1130
+
1131
+
1132
+ </h3><div class="docstring">
1133
+ <div class="discussion">
1134
+
1135
+ <p>Relative path under root.</p>
1136
+
1137
+
1138
+ </div>
1139
+ </div>
1140
+ <div class="tags">
1141
+ <p class="tag_title">Parameters:</p>
1142
+ <ul class="param">
1143
+
1144
+ <li>
1145
+
1146
+ <span class='name'>level</span>
1147
+
1148
+
1149
+ <span class='type'>(<tt>Integer</tt>)</span>
1150
+
1151
+
1152
+ <em class="default">(defaults to: <tt>1</tt>)</em>
1153
+
1154
+
1155
+ &mdash;
1156
+ <div class='inline'>
1157
+ <p>Level down from root.</p>
1158
+ </div>
1159
+
1160
+ </li>
1161
+
1162
+ </ul>
1163
+
1164
+
1165
+ </div><table class="source_code">
1166
+ <tr>
1167
+ <td>
1168
+ <pre class="lines">
1169
+
1170
+
1171
+ 80
1172
+ 81
1173
+ 82
1174
+ 83
1175
+ 84
1176
+ 85
1177
+ 86</pre>
1178
+ </td>
1179
+ <td>
1180
+ <pre class="code"><span class="info file"># File 'lib/dirtravel.rb', line 80</span>
1181
+
1182
+ <span class='kw'>def</span> <span class='id identifier rubyid_subpath'>subpath</span><span class='lparen'>(</span> <span class='id identifier rubyid_level'>level</span> <span class='op'>=</span> <span class='int'>1</span> <span class='rparen'>)</span>
1183
+ <span class='id identifier rubyid_pa'>pa</span> <span class='op'>=</span> <span class='id identifier rubyid_parts'>parts</span>
1184
+ <span class='kw'>if</span> <span class='id identifier rubyid_level'>level</span> <span class='op'>&lt;</span> <span class='int'>0</span> <span class='op'>||</span> <span class='id identifier rubyid_level'>level</span> <span class='op'>&gt;</span> <span class='id identifier rubyid_pa'>pa</span><span class='period'>.</span><span class='id identifier rubyid_length'>length</span>
1185
+ <span class='id identifier rubyid_raise'>raise</span> <span class='const'>DirTravelError</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>Invalid index for subpath level!</span><span class='tstring_end'>&quot;</span></span>
1186
+ <span class='kw'>end</span>
1187
+ <span class='id identifier rubyid_pa'>pa</span><span class='lbracket'>[</span> <span class='id identifier rubyid_level'>level</span> <span class='op'>..</span> <span class='op'>-</span><span class='int'>1</span> <span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_join'>join</span><span class='lparen'>(</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>/</span><span class='tstring_end'>'</span></span> <span class='rparen'>)</span>
1188
+ <span class='kw'>end</span></pre>
1189
+ </td>
1190
+ </tr>
1191
+ </table>
1192
+ </div>
1193
+
1194
+ <div class="method_details ">
1195
+ <h3 class="signature " id="tip-instance_method">
1196
+
1197
+ - (<tt>Object</tt>) <strong>tip</strong>
1198
+
1199
+
1200
+
1201
+
1202
+
1203
+ </h3><div class="docstring">
1204
+ <div class="discussion">
1205
+
1206
+ <p>Top directory name (usually same as name).</p>
1207
+
1208
+
1209
+ </div>
1210
+ </div>
1211
+ <div class="tags">
1212
+
1213
+
1214
+ </div><table class="source_code">
1215
+ <tr>
1216
+ <td>
1217
+ <pre class="lines">
1218
+
1219
+
1220
+ 102
1221
+ 103
1222
+ 104</pre>
1223
+ </td>
1224
+ <td>
1225
+ <pre class="code"><span class="info file"># File 'lib/dirtravel.rb', line 102</span>
1226
+
1227
+ <span class='kw'>def</span> <span class='id identifier rubyid_tip'>tip</span>
1228
+ <span class='ivar'>@name</span><span class='period'>.</span><span class='id identifier rubyid_split'>split</span><span class='lparen'>(</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>/</span><span class='tstring_end'>&quot;</span></span> <span class='rparen'>)</span><span class='lbracket'>[</span><span class='op'>-</span><span class='int'>1</span><span class='rbracket'>]</span>
1229
+ <span class='kw'>end</span></pre>
1230
+ </td>
1231
+ </tr>
1232
+ </table>
1233
+ </div>
1234
+
1235
+ </div>
1236
+
1237
+ </div>
1238
+
1239
+ <div id="footer">
1240
+ Generated on Sat Jan 18 17:51:32 2014 by
1241
+ <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
1242
+ 0.8.6.1 (ruby-1.9.3).
1243
+ </div>
1244
+
1245
+ </body>
1246
+ </html>