dirtravel 0.0.5 → 0.0.6

Sign up to get free protection for your applications and to get access to all the features.
@@ -6,7 +6,7 @@
6
6
  <title>
7
7
  Class: DirTravel::FileEntry
8
8
 
9
- &mdash; Documentation by YARD 0.8.6.1
9
+ &mdash; Documentation by YARD 0.8.7.6
10
10
 
11
11
  </title>
12
12
 
@@ -17,7 +17,7 @@
17
17
  <script type="text/javascript" charset="utf-8">
18
18
  hasFrames = window.top.frames.main ? true : false;
19
19
  relpath = '../';
20
- framesUrl = "../frames.html#!" + escape(window.location.href);
20
+ framesUrl = "../frames.html#!DirTravel/FileEntry.html";
21
21
  </script>
22
22
 
23
23
 
@@ -217,7 +217,7 @@
217
217
 
218
218
 
219
219
  <span class="summary_desc"><div class='inline'>
220
- <p>A new instance of FileEntry.</p>
220
+ <p>Set name, suffix, and basename.</p>
221
221
  </div></span>
222
222
 
223
223
  </li>
@@ -253,13 +253,33 @@
253
253
  </h3><div class="docstring">
254
254
  <div class="discussion">
255
255
 
256
- <p>A new instance of FileEntry</p>
256
+ <p>Set name, suffix, and basename.</p>
257
257
 
258
258
 
259
259
  </div>
260
260
  </div>
261
261
  <div class="tags">
262
+ <p class="tag_title">Parameters:</p>
263
+ <ul class="param">
262
264
 
265
+ <li>
266
+
267
+ <span class='name'>name</span>
268
+
269
+
270
+ <span class='type'>(<tt>String</tt>)</span>
271
+
272
+
273
+
274
+ &mdash;
275
+ <div class='inline'>
276
+ <p>File name.</p>
277
+ </div>
278
+
279
+ </li>
280
+
281
+ </ul>
282
+
263
283
 
264
284
  </div><table class="source_code">
265
285
  <tr>
@@ -267,14 +287,14 @@
267
287
  <pre class="lines">
268
288
 
269
289
 
270
- 179
271
- 180
272
- 181
273
- 182
274
- 183</pre>
290
+ 191
291
+ 192
292
+ 193
293
+ 194
294
+ 195</pre>
275
295
  </td>
276
296
  <td>
277
- <pre class="code"><span class="info file"># File 'lib/dirtravel.rb', line 179</span>
297
+ <pre class="code"><span class="info file"># File 'lib/dirtravel.rb', line 191</span>
278
298
 
279
299
  <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>
280
300
  <span class='kw'>super</span><span class='lparen'>(</span> <span class='id identifier rubyid_name'>name</span> <span class='rparen'>)</span>
@@ -319,12 +339,12 @@
319
339
  <pre class="lines">
320
340
 
321
341
 
322
- 177
323
- 178
324
- 179</pre>
342
+ 186
343
+ 187
344
+ 188</pre>
325
345
  </td>
326
346
  <td>
327
- <pre class="code"><span class="info file"># File 'lib/dirtravel.rb', line 177</span>
347
+ <pre class="code"><span class="info file"># File 'lib/dirtravel.rb', line 186</span>
328
348
 
329
349
  <span class='kw'>def</span> <span class='id identifier rubyid_basename'>basename</span>
330
350
  <span class='ivar'>@basename</span>
@@ -362,12 +382,12 @@
362
382
  <pre class="lines">
363
383
 
364
384
 
365
- 177
366
- 178
367
- 179</pre>
385
+ 186
386
+ 187
387
+ 188</pre>
368
388
  </td>
369
389
  <td>
370
- <pre class="code"><span class="info file"># File 'lib/dirtravel.rb', line 177</span>
390
+ <pre class="code"><span class="info file"># File 'lib/dirtravel.rb', line 186</span>
371
391
 
372
392
  <span class='kw'>def</span> <span class='id identifier rubyid_suffix'>suffix</span>
373
393
  <span class='ivar'>@suffix</span>
@@ -383,9 +403,9 @@
383
403
  </div>
384
404
 
385
405
  <div id="footer">
386
- Generated on Thu Jan 23 19:01:13 2014 by
406
+ Generated on Sun Apr 19 15:01:50 2015 by
387
407
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
388
- 0.8.6.1 (ruby-1.9.3).
408
+ 0.8.7.6 (ruby-2.1.2).
389
409
  </div>
390
410
 
391
411
  </body>
@@ -6,7 +6,7 @@
6
6
  <title>
7
7
  Class: DirTravel::Travel
8
8
 
9
- &mdash; Documentation by YARD 0.8.6.1
9
+ &mdash; Documentation by YARD 0.8.7.6
10
10
 
11
11
  </title>
12
12
 
@@ -17,7 +17,7 @@
17
17
  <script type="text/javascript" charset="utf-8">
18
18
  hasFrames = window.top.frames.main ? true : false;
19
19
  relpath = '../';
20
- framesUrl = "../frames.html#!" + escape(window.location.href);
20
+ framesUrl = "../frames.html#!DirTravel/Travel.html";
21
21
  </script>
22
22
 
23
23
 
@@ -102,27 +102,32 @@
102
102
  <h2>Overview</h2><div class="docstring">
103
103
  <div class="discussion">
104
104
 
105
- <p>Create directory recursion tree (with Travel.filetree). Optionally filter
105
+ <p>Create directory recursion tree (with <span class='object_link'><a href="#filetree-class_method" title="DirTravel::Travel.filetree (method)">Travel.filetree</a></span>). Optionally filter
106
106
  with suffix and modify tree building with options Hash (see below).</p>
107
107
 
108
- <h2>Parameters:</h2>
109
- <table class="rdoc-list"><tr><td class="rdoc-term"><p>sort</p></td>
110
- <td>
108
+ <p>If basedir is absolute path, the root name is the search path. If basedir
109
+ is relative path, before search the current directory is changed to
110
+ referenced directory and root name is the current directory, single level.</p>
111
+
112
+ <h2 id="label-Parameters%3A">Parameters:</h2>
113
+ <dl class="rdoc-list note-list"><dt>sort
114
+ <dd>
111
115
  <p>Sort directory entries (default: false).</p>
112
- </td></tr><tr><td class="rdoc-term"><p>suffix</p></td>
113
- <td>
114
- <p>Limit search to files with "suffix" (default: nil).</p>
115
- </td></tr><tr><td class="rdoc-term"><p>files</p></td>
116
- <td>
116
+ </dd><dt>suffix
117
+ <dd>
118
+ <p>Limit search to files with suffix (default: nil).</p>
119
+ </dd><dt>files
120
+ <dd>
117
121
  <p>Include files to search (default: true).</p>
118
- </td></tr><tr><td class="rdoc-term"><p>inclusive</p></td>
119
- <td>
122
+ </dd><dt>inclusive
123
+ <dd>
120
124
  <p>Basedirs parent becomes the basedir (default: false).</p>
121
- </td></tr></table>
125
+ </dd></dl>
122
126
 
123
127
  <p>Example:</p>
124
128
 
125
- <pre class="code ruby"><code class="ruby"><span class='id identifier rubyid_d1'>d1</span> <span class='op'>=</span> <span class='const'>DirTravel</span><span class='op'>::</span><span class='const'>Travel</span><span class='period'>.</span><span class='id identifier rubyid_filetree'>filetree</span><span class='lparen'>(</span> <span class='id identifier rubyid_dir1'>dir1</span><span class='comma'>,</span> <span class='lbrace'>{</span> <span class='symbol'>:sort</span> <span class='op'>=&gt;</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='symbol'>:suffix</span> <span class='op'>=&gt;</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>.mp3</span><span class='tstring_end'>'</span></span> <span class='rbrace'>}</span> <span class='rparen'>)</span></code></pre>
129
+ <pre class="code ruby"><code class="ruby"><span class='id identifier rubyid_d1'>d1</span> <span class='op'>=</span> <span class='const'>DirTravel</span><span class='op'>::</span><span class='const'>Travel</span><span class='period'>.</span><span class='id identifier rubyid_filetree'>filetree</span><span class='lparen'>(</span> <span class='id identifier rubyid_dir1'>dir1</span><span class='comma'>,</span> <span class='lbrace'>{</span> <span class='symbol'>:sort</span> <span class='op'>=&gt;</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='symbol'>:suffix</span> <span class='op'>=&gt;</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>.mp3</span><span class='tstring_end'>&#39;</span></span> <span class='rbrace'>}</span> <span class='rparen'>)</span>
130
+ </code></pre>
126
131
 
127
132
 
128
133
  </div>
@@ -185,7 +190,7 @@ with suffix and modify tree building with options Hash (see below).</p>
185
190
 
186
191
 
187
192
  <span class="summary_desc"><div class='inline'>
188
- <p>Starting directory for Travel.</p>
193
+ <p>Starting directory for <span class='object_link'><a href="" title="DirTravel::Travel (class)">Travel</a></span>.</p>
189
194
  </div></span>
190
195
 
191
196
  </li>
@@ -212,7 +217,7 @@ with suffix and modify tree building with options Hash (see below).</p>
212
217
 
213
218
 
214
219
  <span class="summary_desc"><div class='inline'>
215
- <p>Default options for Travel.</p>
220
+ <p>Default options for <span class='object_link'><a href="" title="DirTravel::Travel (class)">Travel</a></span>.</p>
216
221
  </div></span>
217
222
 
218
223
  </li>
@@ -239,7 +244,7 @@ with suffix and modify tree building with options Hash (see below).</p>
239
244
 
240
245
 
241
246
  <span class="summary_desc"><div class='inline'>
242
- <p>Root DirEntry of Travel.</p>
247
+ <p>Root <span class='object_link'><a href="DirEntry.html" title="DirTravel::DirEntry (class)">DirEntry</a></span> of <span class='object_link'><a href="" title="DirTravel::Travel (class)">Travel</a></span>.</p>
243
248
  </div></span>
244
249
 
245
250
  </li>
@@ -261,7 +266,7 @@ with suffix and modify tree building with options Hash (see below).</p>
261
266
  <li class="public ">
262
267
  <span class="summary_signature">
263
268
 
264
- <a href="#filetree-class_method" title="filetree (class method)">+ (DirEntry) <strong>filetree</strong>(basedir = '.', options = {}) </a>
269
+ <a href="#filetree-class_method" title="filetree (class method)">+ (DirEntry) <strong>filetree</strong>(basedir = &#39;.&#39;, options = {}) </a>
265
270
 
266
271
 
267
272
 
@@ -276,7 +281,7 @@ with suffix and modify tree building with options Hash (see below).</p>
276
281
 
277
282
 
278
283
  <span class="summary_desc"><div class='inline'>
279
- <p>Create directory recursion tree.</p>
284
+ <p>Create directory recursion tree and return root.</p>
280
285
  </div></span>
281
286
 
282
287
  </li>
@@ -311,7 +316,7 @@ with suffix and modify tree building with options Hash (see below).</p>
311
316
 
312
317
 
313
318
  <span class="summary_desc"><div class='inline'>
314
- <p>A new instance of Travel.</p>
319
+ <p>Create directory recursion object.</p>
315
320
  </div></span>
316
321
 
317
322
  </li>
@@ -359,13 +364,68 @@ with suffix and modify tree building with options Hash (see below).</p>
359
364
  </h3><div class="docstring">
360
365
  <div class="discussion">
361
366
 
362
- <p>A new instance of Travel</p>
367
+ <p>Create directory recursion object. Overlay options on top of defaults.
368
+ Initialize root <span class='object_link'><a href="DirEntry.html" title="DirTravel::DirEntry (class)">DirEntry</a></span>.</p>
363
369
 
364
370
 
365
371
  </div>
366
372
  </div>
367
373
  <div class="tags">
374
+ <p class="tag_title">Parameters:</p>
375
+ <ul class="param">
376
+
377
+ <li>
378
+
379
+ <span class='name'>basedir</span>
380
+
381
+
382
+ <span class='type'>(<tt>String</tt>)</span>
383
+
384
+
385
+
386
+ &mdash;
387
+ <div class='inline'>
388
+ <p>Starting directory (top).</p>
389
+ </div>
390
+
391
+ </li>
392
+
393
+ <li>
394
+
395
+ <span class='name'>abspath</span>
396
+
397
+
398
+ <span class='type'>(<tt>String</tt>)</span>
399
+
400
+
401
+
402
+ &mdash;
403
+ <div class='inline'>
404
+ <p>Absolute path for root.</p>
405
+ </div>
406
+
407
+ </li>
408
+
409
+ <li>
410
+
411
+ <span class='name'>options</span>
412
+
413
+
414
+ <span class='type'>(<tt>Hash</tt>)</span>
415
+
416
+
417
+ <em class="default">(defaults to: <tt>{}</tt>)</em>
418
+
419
+
420
+ &mdash;
421
+ <div class='inline'>
422
+ <p><span class='object_link'><a href="" title="DirTravel::Travel (class)">DirTravel::Travel</a></span> options.</p>
423
+ </div>
424
+
425
+ </li>
368
426
 
427
+ </ul>
428
+
369
429
 
370
430
  </div><table class="source_code">
371
431
  <tr>
@@ -373,35 +433,35 @@ with suffix and modify tree building with options Hash (see below).</p>
373
433
  <pre class="lines">
374
434
 
375
435
 
376
- 256
377
- 257
378
- 258
379
- 259
380
- 260
381
- 261
382
- 262
383
- 263
384
- 264
385
- 265
386
- 266
387
- 267
388
- 268
389
- 269
390
- 270</pre>
436
+ 312
437
+ 313
438
+ 314
439
+ 315
440
+ 316
441
+ 317
442
+ 318
443
+ 319
444
+ 320
445
+ 321
446
+ 322
447
+ 323
448
+ 324
449
+ 325
450
+ 326</pre>
391
451
  </td>
392
452
  <td>
393
- <pre class="code"><span class="info file"># File 'lib/dirtravel.rb', line 256</span>
453
+ <pre class="code"><span class="info file"># File 'lib/dirtravel.rb', line 312</span>
394
454
 
395
455
  <span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span><span class='lparen'>(</span> <span class='id identifier rubyid_basedir'>basedir</span><span class='comma'>,</span> <span class='id identifier rubyid_abspath'>abspath</span><span class='comma'>,</span> <span class='id identifier rubyid_options'>options</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span> <span class='rparen'>)</span>
396
456
  <span class='ivar'>@basedir</span> <span class='op'>=</span> <span class='id identifier rubyid_basedir'>basedir</span>
397
457
  <span class='ivar'>@abspath</span> <span class='op'>=</span> <span class='id identifier rubyid_abspath'>abspath</span>
398
458
 
399
459
  <span class='ivar'>@defaults</span> <span class='op'>=</span> <span class='lbrace'>{</span>
400
- <span class='symbol'>:suffix</span> <span class='op'>=&gt;</span> <span class='kw'>nil</span><span class='comma'>,</span>
401
- <span class='symbol'>:sort</span> <span class='op'>=&gt;</span> <span class='kw'>false</span><span class='comma'>,</span>
402
- <span class='symbol'>:files</span> <span class='op'>=&gt;</span> <span class='kw'>true</span><span class='comma'>,</span>
403
- <span class='symbol'>:inclusive</span> <span class='op'>=&gt;</span> <span class='kw'>false</span><span class='comma'>,</span>
404
- <span class='rbrace'>}</span>
460
+ <span class='symbol'>:suffix</span> <span class='op'>=&gt;</span> <span class='kw'>nil</span><span class='comma'>,</span>
461
+ <span class='symbol'>:sort</span> <span class='op'>=&gt;</span> <span class='kw'>false</span><span class='comma'>,</span>
462
+ <span class='symbol'>:files</span> <span class='op'>=&gt;</span> <span class='kw'>true</span><span class='comma'>,</span>
463
+ <span class='symbol'>:inclusive</span> <span class='op'>=&gt;</span> <span class='kw'>false</span><span class='comma'>,</span>
464
+ <span class='rbrace'>}</span>
405
465
 
406
466
  <span class='ivar'>@defaults</span><span class='period'>.</span><span class='id identifier rubyid_merge!'>merge!</span><span class='lparen'>(</span> <span class='id identifier rubyid_options'>options</span> <span class='rparen'>)</span>
407
467
 
@@ -445,12 +505,12 @@ with suffix and modify tree building with options Hash (see below).</p>
445
505
  <pre class="lines">
446
506
 
447
507
 
448
- 215
449
- 216
450
- 217</pre>
508
+ 232
509
+ 233
510
+ 234</pre>
451
511
  </td>
452
512
  <td>
453
- <pre class="code"><span class="info file"># File 'lib/dirtravel.rb', line 215</span>
513
+ <pre class="code"><span class="info file"># File 'lib/dirtravel.rb', line 232</span>
454
514
 
455
515
  <span class='kw'>def</span> <span class='id identifier rubyid_abspath'>abspath</span>
456
516
  <span class='ivar'>@abspath</span>
@@ -474,7 +534,7 @@ with suffix and modify tree building with options Hash (see below).</p>
474
534
  </h3><div class="docstring">
475
535
  <div class="discussion">
476
536
 
477
- <p>Starting directory for Travel.</p>
537
+ <p>Starting directory for <span class='object_link'><a href="" title="DirTravel::Travel (class)">DirTravel::Travel</a></span>.</p>
478
538
 
479
539
 
480
540
  </div>
@@ -488,12 +548,12 @@ with suffix and modify tree building with options Hash (see below).</p>
488
548
  <pre class="lines">
489
549
 
490
550
 
491
- 214
492
- 215
493
- 216</pre>
551
+ 231
552
+ 232
553
+ 233</pre>
494
554
  </td>
495
555
  <td>
496
- <pre class="code"><span class="info file"># File 'lib/dirtravel.rb', line 214</span>
556
+ <pre class="code"><span class="info file"># File 'lib/dirtravel.rb', line 231</span>
497
557
 
498
558
  <span class='kw'>def</span> <span class='id identifier rubyid_basedir'>basedir</span>
499
559
  <span class='ivar'>@basedir</span>
@@ -517,7 +577,7 @@ with suffix and modify tree building with options Hash (see below).</p>
517
577
  </h3><div class="docstring">
518
578
  <div class="discussion">
519
579
 
520
- <p>Default options for Travel.</p>
580
+ <p>Default options for <span class='object_link'><a href="" title="DirTravel::Travel (class)">DirTravel::Travel</a></span>.</p>
521
581
 
522
582
 
523
583
  </div>
@@ -531,12 +591,12 @@ with suffix and modify tree building with options Hash (see below).</p>
531
591
  <pre class="lines">
532
592
 
533
593
 
534
- 211
535
- 212
536
- 213</pre>
594
+ 228
595
+ 229
596
+ 230</pre>
537
597
  </td>
538
598
  <td>
539
- <pre class="code"><span class="info file"># File 'lib/dirtravel.rb', line 211</span>
599
+ <pre class="code"><span class="info file"># File 'lib/dirtravel.rb', line 228</span>
540
600
 
541
601
  <span class='kw'>def</span> <span class='id identifier rubyid_defaults'>defaults</span>
542
602
  <span class='ivar'>@defaults</span>
@@ -560,7 +620,7 @@ with suffix and modify tree building with options Hash (see below).</p>
560
620
  </h3><div class="docstring">
561
621
  <div class="discussion">
562
622
 
563
- <p>Root DirEntry of Travel.</p>
623
+ <p>Root <span class='object_link'><a href="DirEntry.html" title="DirTravel::DirEntry (class)">DirEntry</a></span> of <span class='object_link'><a href="" title="DirTravel::Travel (class)">DirTravel::Travel</a></span>.</p>
564
624
 
565
625
 
566
626
  </div>
@@ -574,12 +634,12 @@ with suffix and modify tree building with options Hash (see below).</p>
574
634
  <pre class="lines">
575
635
 
576
636
 
577
- 208
578
- 209
579
- 210</pre>
637
+ 225
638
+ 226
639
+ 227</pre>
580
640
  </td>
581
641
  <td>
582
- <pre class="code"><span class="info file"># File 'lib/dirtravel.rb', line 208</span>
642
+ <pre class="code"><span class="info file"># File 'lib/dirtravel.rb', line 225</span>
583
643
 
584
644
  <span class='kw'>def</span> <span class='id identifier rubyid_root'>root</span>
585
645
  <span class='ivar'>@root</span>
@@ -599,7 +659,7 @@ with suffix and modify tree building with options Hash (see below).</p>
599
659
  <div class="method_details first">
600
660
  <h3 class="signature first" id="filetree-class_method">
601
661
 
602
- + (<tt><span class='object_link'><a href="DirEntry.html" title="DirTravel::DirEntry (class)">DirEntry</a></span></tt>) <strong>filetree</strong>(basedir = '.', options = {})
662
+ + (<tt><span class='object_link'><a href="DirEntry.html" title="DirTravel::DirEntry (class)">DirEntry</a></span></tt>) <strong>filetree</strong>(basedir = &#39;.&#39;, options = {})
603
663
 
604
664
 
605
665
 
@@ -608,7 +668,7 @@ with suffix and modify tree building with options Hash (see below).</p>
608
668
  </h3><div class="docstring">
609
669
  <div class="discussion">
610
670
 
611
- <p>Create directory recursion tree.</p>
671
+ <p>Create directory recursion tree and return root.</p>
612
672
 
613
673
 
614
674
  </div>
@@ -625,7 +685,7 @@ with suffix and modify tree building with options Hash (see below).</p>
625
685
  <span class='type'>(<tt>String</tt>)</span>
626
686
 
627
687
 
628
- <em class="default">(defaults to: <tt>'.'</tt>)</em>
688
+ <em class="default">(defaults to: <tt>&#39;.&#39;</tt>)</em>
629
689
 
630
690
 
631
691
  &mdash;
@@ -648,7 +708,7 @@ with suffix and modify tree building with options Hash (see below).</p>
648
708
 
649
709
  &mdash;
650
710
  <div class='inline'>
651
- <p>Hash optionally including keys: :sort, :suffix, :files.</p>
711
+ <p><span class='object_link'><a href="" title="DirTravel::Travel (class)">DirTravel::Travel</a></span> options.</p>
652
712
  </div>
653
713
 
654
714
  </li>
@@ -667,7 +727,7 @@ with suffix and modify tree building with options Hash (see below).</p>
667
727
 
668
728
  &mdash;
669
729
  <div class='inline'>
670
- <p>Root item of the file system hierarchy.</p>
730
+ <p>Root of the file travel hierarchy.</p>
671
731
  </div>
672
732
 
673
733
  </li>
@@ -680,25 +740,6 @@ with suffix and modify tree building with options Hash (see below).</p>
680
740
  <pre class="lines">
681
741
 
682
742
 
683
- 221
684
- 222
685
- 223
686
- 224
687
- 225
688
- 226
689
- 227
690
- 228
691
- 229
692
- 230
693
- 231
694
- 232
695
- 233
696
- 234
697
- 235
698
- 236
699
- 237
700
- 238
701
- 239
702
743
  240
703
744
  241
704
745
  242
@@ -712,43 +753,124 @@ with suffix and modify tree building with options Hash (see below).</p>
712
753
  250
713
754
  251
714
755
  252
715
- 253</pre>
756
+ 253
757
+ 254
758
+ 255
759
+ 256
760
+ 257
761
+ 258
762
+ 259
763
+ 260
764
+ 261
765
+ 262
766
+ 263
767
+ 264
768
+ 265
769
+ 266
770
+ 267
771
+ 268
772
+ 269
773
+ 270
774
+ 271
775
+ 272
776
+ 273
777
+ 274
778
+ 275
779
+ 276
780
+ 277
781
+ 278
782
+ 279
783
+ 280
784
+ 281
785
+ 282
786
+ 283
787
+ 284
788
+ 285
789
+ 286
790
+ 287
791
+ 288
792
+ 289
793
+ 290
794
+ 291
795
+ 292
796
+ 293
797
+ 294
798
+ 295
799
+ 296
800
+ 297
801
+ 298
802
+ 299
803
+ 300
804
+ 301
805
+ 302
806
+ 303</pre>
716
807
  </td>
717
808
  <td>
718
- <pre class="code"><span class="info file"># File 'lib/dirtravel.rb', line 221</span>
809
+ <pre class="code"><span class="info file"># File 'lib/dirtravel.rb', line 240</span>
810
+
811
+ <span class='kw'>def</span> <span class='const'>Travel</span><span class='period'>.</span><span class='id identifier rubyid_filetree'>filetree</span><span class='lparen'>(</span> <span class='id identifier rubyid_basedir'>basedir</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>.</span><span class='tstring_end'>&#39;</span></span><span class='comma'>,</span> <span class='id identifier rubyid_options'>options</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span> <span class='rparen'>)</span>
719
812
 
720
- <span class='kw'>def</span> <span class='const'>Travel</span><span class='period'>.</span><span class='id identifier rubyid_filetree'>filetree</span><span class='lparen'>(</span> <span class='id identifier rubyid_basedir'>basedir</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='comma'>,</span> <span class='id identifier rubyid_options'>options</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span> <span class='rparen'>)</span>
813
+ <span class='comment'># Non-nil if directory needs to be changed.
814
+ </span> <span class='id identifier rubyid_pwd'>pwd</span> <span class='op'>=</span> <span class='kw'>nil</span>
721
815
 
722
- <span class='id identifier rubyid_pwd'>pwd</span> <span class='op'>=</span> <span class='kw'>nil</span>
816
+ <span class='kw'>if</span> <span class='id identifier rubyid_basedir'>basedir</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'>&#39;</span><span class='tstring_content'>/</span><span class='tstring_end'>&#39;</span></span>
723
817
 
724
- <span class='kw'>if</span> <span class='id identifier rubyid_basedir'>basedir</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>
725
- <span class='id identifier rubyid_t'>t</span> <span class='op'>=</span> <span class='const'>Travel</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span> <span class='id identifier rubyid_basedir'>basedir</span><span class='comma'>,</span> <span class='id identifier rubyid_basedir'>basedir</span><span class='comma'>,</span> <span class='id identifier rubyid_options'>options</span> <span class='rparen'>)</span>
818
+ <span class='comment'># Absolue path.
819
+ </span> <span class='id identifier rubyid_t'>t</span> <span class='op'>=</span> <span class='const'>Travel</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span> <span class='id identifier rubyid_basedir'>basedir</span><span class='comma'>,</span> <span class='id identifier rubyid_basedir'>basedir</span><span class='comma'>,</span> <span class='id identifier rubyid_options'>options</span> <span class='rparen'>)</span>
726
820
  <span class='id identifier rubyid_t'>t</span><span class='period'>.</span><span class='id identifier rubyid_travel'>travel</span>
821
+
727
822
  <span class='kw'>else</span>
728
- <span class='id identifier rubyid_pwd'>pwd</span> <span class='op'>=</span> <span class='const'>Dir</span><span class='period'>.</span><span class='id identifier rubyid_pwd'>pwd</span>
729
- <span class='id identifier rubyid_full'>full</span> <span class='op'>=</span> <span class='const'>File</span><span class='period'>.</span><span class='id identifier rubyid_absolute_path'>absolute_path</span><span class='lparen'>(</span> <span class='id identifier rubyid_basedir'>basedir</span> <span class='rparen'>)</span>
823
+
824
+ <span class='comment'># Relative path.
825
+ </span>
826
+ <span class='comment'># Store current directory before chdir.
827
+ </span> <span class='id identifier rubyid_pwd'>pwd</span> <span class='op'>=</span> <span class='const'>Dir</span><span class='period'>.</span><span class='id identifier rubyid_pwd'>pwd</span>
828
+
829
+ <span class='comment'># Generate target directory for chdir. One up from
830
+ </span> <span class='comment'># the reference.
831
+ </span> <span class='id identifier rubyid_full'>full</span> <span class='op'>=</span> <span class='const'>File</span><span class='period'>.</span><span class='id identifier rubyid_absolute_path'>absolute_path</span><span class='lparen'>(</span> <span class='id identifier rubyid_basedir'>basedir</span> <span class='rparen'>)</span>
730
832
  <span class='id identifier rubyid_base'>base</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_full'>full</span> <span class='rparen'>)</span>
731
833
  <span class='id identifier rubyid_dir'>dir</span> <span class='op'>=</span> <span class='const'>File</span><span class='period'>.</span><span class='id identifier rubyid_dirname'>dirname</span><span class='lparen'>(</span> <span class='id identifier rubyid_full'>full</span> <span class='rparen'>)</span>
732
- <span class='const'>Dir</span><span class='period'>.</span><span class='id identifier rubyid_chdir'>chdir</span><span class='lparen'>(</span> <span class='id identifier rubyid_dir'>dir</span> <span class='rparen'>)</span>
834
+
835
+ <span class='comment'># Goto target.
836
+ </span> <span class='const'>Dir</span><span class='period'>.</span><span class='id identifier rubyid_chdir'>chdir</span><span class='lparen'>(</span> <span class='id identifier rubyid_dir'>dir</span> <span class='rparen'>)</span>
837
+
733
838
  <span class='id identifier rubyid_t'>t</span> <span class='op'>=</span> <span class='const'>Travel</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span> <span class='id identifier rubyid_base'>base</span><span class='comma'>,</span> <span class='id identifier rubyid_full'>full</span><span class='comma'>,</span> <span class='id identifier rubyid_options'>options</span> <span class='rparen'>)</span>
734
839
  <span class='id identifier rubyid_t'>t</span><span class='period'>.</span><span class='id identifier rubyid_travel'>travel</span>
735
840
  <span class='kw'>end</span>
736
841
 
842
+
737
843
  <span class='kw'>if</span> <span class='id identifier rubyid_t'>t</span><span class='period'>.</span><span class='id identifier rubyid_defaults'>defaults</span><span class='lbracket'>[</span> <span class='symbol'>:inclusive</span> <span class='rbracket'>]</span>
738
- <span class='id identifier rubyid_uppath'>uppath</span> <span class='op'>=</span> <span class='const'>File</span><span class='period'>.</span><span class='id identifier rubyid_dirname'>dirname</span><span class='lparen'>(</span> <span class='id identifier rubyid_t'>t</span><span class='period'>.</span><span class='id identifier rubyid_root'>root</span><span class='period'>.</span><span class='id identifier rubyid_abspath'>abspath</span> <span class='rparen'>)</span>
739
- <span class='id identifier rubyid_path'>path</span> <span class='op'>=</span> <span class='id identifier rubyid_uppath'>uppath</span>
844
+
845
+ <span class='comment'># With inclusive the root is changed to one-up from
846
+ </span> <span class='comment'># target.
847
+ </span>
848
+ <span class='comment'># One up from root.
849
+ </span> <span class='id identifier rubyid_uppath'>uppath</span> <span class='op'>=</span> <span class='const'>File</span><span class='period'>.</span><span class='id identifier rubyid_dirname'>dirname</span><span class='lparen'>(</span> <span class='id identifier rubyid_t'>t</span><span class='period'>.</span><span class='id identifier rubyid_root'>root</span><span class='period'>.</span><span class='id identifier rubyid_abspath'>abspath</span> <span class='rparen'>)</span>
740
850
  <span class='kw'>if</span> <span class='id identifier rubyid_t'>t</span><span class='period'>.</span><span class='id identifier rubyid_root'>root</span><span class='period'>.</span><span class='id identifier rubyid_relative?'>relative?</span>
741
851
  <span class='id identifier rubyid_path'>path</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_uppath'>uppath</span> <span class='rparen'>)</span>
852
+ <span class='kw'>else</span>
853
+ <span class='id identifier rubyid_path'>path</span> <span class='op'>=</span> <span class='id identifier rubyid_uppath'>uppath</span>
742
854
  <span class='kw'>end</span>
743
- <span class='id identifier rubyid_newRoot'>newRoot</span> <span class='op'>=</span> <span class='const'>DirEntry</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span> <span class='id identifier rubyid_path'>path</span><span class='comma'>,</span> <span class='id identifier rubyid_uppath'>uppath</span> <span class='rparen'>)</span>
744
- <span class='id identifier rubyid_t'>t</span><span class='period'>.</span><span class='id identifier rubyid_root'>root</span><span class='period'>.</span><span class='id identifier rubyid_rename'>rename</span><span class='lparen'>(</span> <span class='id identifier rubyid_t'>t</span><span class='period'>.</span><span class='id identifier rubyid_root'>root</span><span class='period'>.</span><span class='id identifier rubyid_tip'>tip</span> <span class='rparen'>)</span>
745
- <span class='id identifier rubyid_newRoot'>newRoot</span><span class='period'>.</span><span class='id identifier rubyid_add'>add</span><span class='lparen'>(</span> <span class='id identifier rubyid_t'>t</span><span class='period'>.</span><span class='id identifier rubyid_root'>root</span> <span class='rparen'>)</span>
746
- <span class='id identifier rubyid_t'>t</span><span class='period'>.</span><span class='id identifier rubyid_root'>root</span> <span class='op'>=</span> <span class='id identifier rubyid_newRoot'>newRoot</span>
855
+
856
+ <span class='comment'># Create the &quot;one-up&quot; root.
857
+ </span> <span class='id identifier rubyid_newRoot'>newRoot</span> <span class='op'>=</span> <span class='const'>DirEntry</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span> <span class='id identifier rubyid_path'>path</span><span class='comma'>,</span> <span class='id identifier rubyid_uppath'>uppath</span> <span class='rparen'>)</span>
858
+
859
+ <span class='comment'># Rename old root.
860
+ </span> <span class='id identifier rubyid_t'>t</span><span class='period'>.</span><span class='id identifier rubyid_root'>root</span><span class='period'>.</span><span class='id identifier rubyid_rename'>rename</span><span class='lparen'>(</span> <span class='id identifier rubyid_t'>t</span><span class='period'>.</span><span class='id identifier rubyid_root'>root</span><span class='period'>.</span><span class='id identifier rubyid_tip'>tip</span> <span class='rparen'>)</span>
861
+
862
+ <span class='comment'># Add to one-up root.
863
+ </span> <span class='id identifier rubyid_newRoot'>newRoot</span><span class='period'>.</span><span class='id identifier rubyid_add'>add</span><span class='lparen'>(</span> <span class='id identifier rubyid_t'>t</span><span class='period'>.</span><span class='id identifier rubyid_root'>root</span> <span class='rparen'>)</span>
864
+
865
+ <span class='comment'># Set root to one-up root.
866
+ </span> <span class='id identifier rubyid_t'>t</span><span class='period'>.</span><span class='id identifier rubyid_root'>root</span> <span class='op'>=</span> <span class='id identifier rubyid_newRoot'>newRoot</span>
747
867
  <span class='kw'>end</span>
748
868
 
749
- <span class='const'>Dir</span><span class='period'>.</span><span class='id identifier rubyid_chdir'>chdir</span><span class='lparen'>(</span> <span class='id identifier rubyid_pwd'>pwd</span> <span class='rparen'>)</span> <span class='kw'>if</span> <span class='id identifier rubyid_pwd'>pwd</span>
869
+ <span class='comment'># Return back to start directory if dir changed.
870
+ </span> <span class='const'>Dir</span><span class='period'>.</span><span class='id identifier rubyid_chdir'>chdir</span><span class='lparen'>(</span> <span class='id identifier rubyid_pwd'>pwd</span> <span class='rparen'>)</span> <span class='kw'>if</span> <span class='id identifier rubyid_pwd'>pwd</span>
750
871
 
751
- <span class='id identifier rubyid_t'>t</span><span class='period'>.</span><span class='id identifier rubyid_root'>root</span>
872
+ <span class='comment'># Return root {DirEntry}.
873
+ </span> <span class='id identifier rubyid_t'>t</span><span class='period'>.</span><span class='id identifier rubyid_root'>root</span>
752
874
  <span class='kw'>end</span></pre>
753
875
  </td>
754
876
  </tr>
@@ -787,12 +909,12 @@ with suffix and modify tree building with options Hash (see below).</p>
787
909
  <pre class="lines">
788
910
 
789
911
 
790
- 275
791
- 276
792
- 277</pre>
912
+ 331
913
+ 332
914
+ 333</pre>
793
915
  </td>
794
916
  <td>
795
- <pre class="code"><span class="info file"># File 'lib/dirtravel.rb', line 275</span>
917
+ <pre class="code"><span class="info file"># File 'lib/dirtravel.rb', line 331</span>
796
918
 
797
919
  <span class='kw'>def</span> <span class='id identifier rubyid_travel'>travel</span><span class='lparen'>(</span> <span class='id identifier rubyid_suffix'>suffix</span> <span class='op'>=</span> <span class='ivar'>@defaults</span><span class='lbracket'>[</span> <span class='symbol'>:suffix</span> <span class='rbracket'>]</span> <span class='rparen'>)</span>
798
920
  <span class='id identifier rubyid_entriesIn'>entriesIn</span><span class='lparen'>(</span> <span class='ivar'>@basedir</span><span class='comma'>,</span> <span class='ivar'>@root</span><span class='comma'>,</span> <span class='id identifier rubyid_suffix'>suffix</span> <span class='rparen'>)</span>
@@ -807,9 +929,9 @@ with suffix and modify tree building with options Hash (see below).</p>
807
929
  </div>
808
930
 
809
931
  <div id="footer">
810
- Generated on Thu Jan 23 19:01:13 2014 by
932
+ Generated on Sun Apr 19 15:01:50 2015 by
811
933
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
812
- 0.8.6.1 (ruby-1.9.3).
934
+ 0.8.7.6 (ruby-2.1.2).
813
935
  </div>
814
936
 
815
937
  </body>