dirtravel 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG.rdoc +9 -0
- data/Rakefile +5 -1
- data/doc/DirTravel/DirEntry.html +286 -0
- data/doc/DirTravel/DirTravelError.html +123 -0
- data/doc/DirTravel/Entry.html +1246 -0
- data/doc/DirTravel/FileEntry.html +392 -0
- data/doc/DirTravel/Travel.html +716 -0
- data/doc/DirTravel.html +158 -0
- data/doc/_index.html +172 -0
- data/doc/class_list.html +53 -0
- data/doc/css/common.css +1 -0
- data/doc/css/full_list.css +57 -0
- data/doc/css/style.css +338 -0
- data/doc/file.CHANGELOG.html +86 -0
- data/doc/file.README.html +84 -0
- data/doc/file_list.html +58 -0
- data/doc/frames.html +28 -0
- data/doc/index.html +84 -0
- data/doc/js/app.js +214 -0
- data/doc/js/full_list.js +178 -0
- data/doc/js/jquery.js +4 -0
- data/doc/method_list.html +190 -0
- data/doc/top-level-namespace.html +112 -0
- data/lib/dirtravel.rb +113 -16
- data/test/test_dirtravel.rb +51 -4
- metadata +24 -2
@@ -0,0 +1,716 @@
|
|
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::Travel
|
8
|
+
|
9
|
+
— 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 (T)</a> »
|
35
|
+
<span class='title'><span class='object_link'><a href="../DirTravel.html" title="DirTravel (module)">DirTravel</a></span></span>
|
36
|
+
»
|
37
|
+
<span class="title">Travel</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::Travel
|
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">Object</span>
|
77
|
+
|
78
|
+
<ul class="fullTree">
|
79
|
+
<li>Object</li>
|
80
|
+
|
81
|
+
<li class="next">DirTravel::Travel</li>
|
82
|
+
|
83
|
+
</ul>
|
84
|
+
<a href="#" class="inheritanceTree">show all</a>
|
85
|
+
|
86
|
+
</dd>
|
87
|
+
|
88
|
+
|
89
|
+
|
90
|
+
|
91
|
+
|
92
|
+
|
93
|
+
|
94
|
+
|
95
|
+
|
96
|
+
<dt class="r2 last">Defined in:</dt>
|
97
|
+
<dd class="r2 last">lib/dirtravel.rb</dd>
|
98
|
+
|
99
|
+
</dl>
|
100
|
+
<div class="clear"></div>
|
101
|
+
|
102
|
+
<h2>Overview</h2><div class="docstring">
|
103
|
+
<div class="discussion">
|
104
|
+
|
105
|
+
<p>Create directory recursion tree (with Travel.filetree). Optionally filter
|
106
|
+
with suffix and modify tree building with options Hash (see below).</p>
|
107
|
+
|
108
|
+
<h2>Parameters:</h2>
|
109
|
+
<table class="rdoc-list"><tr><td class="rdoc-term"><p>sort</p></td>
|
110
|
+
<td>
|
111
|
+
<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>
|
117
|
+
<p>Include files to search (default: true).</p>
|
118
|
+
</td></tr><tr><td class="rdoc-term"><p>inclusive</p></td>
|
119
|
+
<td>
|
120
|
+
<p>Basedirs parent becomes the basedir (default: false).</p>
|
121
|
+
</td></tr></table>
|
122
|
+
|
123
|
+
<p>Example:</p>
|
124
|
+
|
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'>=></span> <span class='kw'>true</span><span class='comma'>,</span> <span class='symbol'>:suffix</span> <span class='op'>=></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>
|
126
|
+
|
127
|
+
|
128
|
+
</div>
|
129
|
+
</div>
|
130
|
+
<div class="tags">
|
131
|
+
|
132
|
+
|
133
|
+
</div>
|
134
|
+
|
135
|
+
|
136
|
+
|
137
|
+
<h2>Instance Attribute Summary <small>(<a href="#" class="summary_toggle">collapse</a>)</small></h2>
|
138
|
+
<ul class="summary">
|
139
|
+
|
140
|
+
<li class="public ">
|
141
|
+
<span class="summary_signature">
|
142
|
+
|
143
|
+
<a href="#basedir-instance_method" title="#basedir (instance method)">- (Object) <strong>basedir</strong> </a>
|
144
|
+
|
145
|
+
|
146
|
+
|
147
|
+
</span>
|
148
|
+
|
149
|
+
|
150
|
+
|
151
|
+
|
152
|
+
|
153
|
+
|
154
|
+
|
155
|
+
|
156
|
+
|
157
|
+
|
158
|
+
|
159
|
+
|
160
|
+
<span class="summary_desc"><div class='inline'>
|
161
|
+
<p>Starting directory for Travel.</p>
|
162
|
+
</div></span>
|
163
|
+
|
164
|
+
</li>
|
165
|
+
|
166
|
+
|
167
|
+
<li class="public ">
|
168
|
+
<span class="summary_signature">
|
169
|
+
|
170
|
+
<a href="#defaults-instance_method" title="#defaults (instance method)">- (Object) <strong>defaults</strong> </a>
|
171
|
+
|
172
|
+
|
173
|
+
|
174
|
+
</span>
|
175
|
+
|
176
|
+
|
177
|
+
|
178
|
+
|
179
|
+
|
180
|
+
|
181
|
+
|
182
|
+
|
183
|
+
|
184
|
+
|
185
|
+
|
186
|
+
|
187
|
+
<span class="summary_desc"><div class='inline'>
|
188
|
+
<p>Default options for Travel.</p>
|
189
|
+
</div></span>
|
190
|
+
|
191
|
+
</li>
|
192
|
+
|
193
|
+
|
194
|
+
<li class="public ">
|
195
|
+
<span class="summary_signature">
|
196
|
+
|
197
|
+
<a href="#root-instance_method" title="#root (instance method)">- (Object) <strong>root</strong> </a>
|
198
|
+
|
199
|
+
|
200
|
+
|
201
|
+
</span>
|
202
|
+
|
203
|
+
|
204
|
+
|
205
|
+
|
206
|
+
|
207
|
+
|
208
|
+
|
209
|
+
|
210
|
+
|
211
|
+
|
212
|
+
|
213
|
+
|
214
|
+
<span class="summary_desc"><div class='inline'>
|
215
|
+
<p>Root DirEntry of Travel.</p>
|
216
|
+
</div></span>
|
217
|
+
|
218
|
+
</li>
|
219
|
+
|
220
|
+
|
221
|
+
</ul>
|
222
|
+
|
223
|
+
|
224
|
+
|
225
|
+
|
226
|
+
|
227
|
+
<h2>
|
228
|
+
Class Method Summary
|
229
|
+
<small>(<a href="#" class="summary_toggle">collapse</a>)</small>
|
230
|
+
</h2>
|
231
|
+
|
232
|
+
<ul class="summary">
|
233
|
+
|
234
|
+
<li class="public ">
|
235
|
+
<span class="summary_signature">
|
236
|
+
|
237
|
+
<a href="#filetree-class_method" title="filetree (class method)">+ (DirEntry) <strong>filetree</strong>(basedir = '.', options = {}) </a>
|
238
|
+
|
239
|
+
|
240
|
+
|
241
|
+
</span>
|
242
|
+
|
243
|
+
|
244
|
+
|
245
|
+
|
246
|
+
|
247
|
+
|
248
|
+
|
249
|
+
|
250
|
+
|
251
|
+
<span class="summary_desc"><div class='inline'>
|
252
|
+
<p>Create directory recursion tree.</p>
|
253
|
+
</div></span>
|
254
|
+
|
255
|
+
</li>
|
256
|
+
|
257
|
+
|
258
|
+
</ul>
|
259
|
+
|
260
|
+
<h2>
|
261
|
+
Instance Method Summary
|
262
|
+
<small>(<a href="#" class="summary_toggle">collapse</a>)</small>
|
263
|
+
</h2>
|
264
|
+
|
265
|
+
<ul class="summary">
|
266
|
+
|
267
|
+
<li class="public ">
|
268
|
+
<span class="summary_signature">
|
269
|
+
|
270
|
+
<a href="#initialize-instance_method" title="#initialize (instance method)">- (Travel) <strong>initialize</strong>(basedir = '.', options = {}) </a>
|
271
|
+
|
272
|
+
|
273
|
+
|
274
|
+
</span>
|
275
|
+
|
276
|
+
|
277
|
+
<span class="note title constructor">constructor</span>
|
278
|
+
|
279
|
+
|
280
|
+
|
281
|
+
|
282
|
+
|
283
|
+
|
284
|
+
|
285
|
+
|
286
|
+
<span class="summary_desc"><div class='inline'>
|
287
|
+
<p>A new instance of Travel.</p>
|
288
|
+
</div></span>
|
289
|
+
|
290
|
+
</li>
|
291
|
+
|
292
|
+
|
293
|
+
<li class="public ">
|
294
|
+
<span class="summary_signature">
|
295
|
+
|
296
|
+
<a href="#travel-instance_method" title="#travel (instance method)">- (Object) <strong>travel</strong>(suffix = @defaults[ :suffix ]) </a>
|
297
|
+
|
298
|
+
|
299
|
+
|
300
|
+
</span>
|
301
|
+
|
302
|
+
|
303
|
+
|
304
|
+
|
305
|
+
|
306
|
+
|
307
|
+
|
308
|
+
|
309
|
+
|
310
|
+
<span class="summary_desc"><div class='inline'>
|
311
|
+
<p>Recursively get all files with suffix.</p>
|
312
|
+
</div></span>
|
313
|
+
|
314
|
+
</li>
|
315
|
+
|
316
|
+
|
317
|
+
</ul>
|
318
|
+
|
319
|
+
|
320
|
+
<div id="constructor_details" class="method_details_list">
|
321
|
+
<h2>Constructor Details</h2>
|
322
|
+
|
323
|
+
<div class="method_details first">
|
324
|
+
<h3 class="signature first" id="initialize-instance_method">
|
325
|
+
|
326
|
+
- (<tt><span class='object_link'><a href="" title="DirTravel::Travel (class)">Travel</a></span></tt>) <strong>initialize</strong>(basedir = '.', options = {})
|
327
|
+
|
328
|
+
|
329
|
+
|
330
|
+
|
331
|
+
|
332
|
+
</h3><div class="docstring">
|
333
|
+
<div class="discussion">
|
334
|
+
|
335
|
+
<p>A new instance of Travel</p>
|
336
|
+
|
337
|
+
|
338
|
+
</div>
|
339
|
+
</div>
|
340
|
+
<div class="tags">
|
341
|
+
|
342
|
+
|
343
|
+
</div><table class="source_code">
|
344
|
+
<tr>
|
345
|
+
<td>
|
346
|
+
<pre class="lines">
|
347
|
+
|
348
|
+
|
349
|
+
246
|
350
|
+
247
|
351
|
+
248
|
352
|
+
249
|
353
|
+
250
|
354
|
+
251
|
355
|
+
252
|
356
|
+
253
|
357
|
+
254
|
358
|
+
255
|
359
|
+
256
|
360
|
+
257
|
361
|
+
258
|
362
|
+
259
|
363
|
+
260</pre>
|
364
|
+
</td>
|
365
|
+
<td>
|
366
|
+
<pre class="code"><span class="info file"># File 'lib/dirtravel.rb', line 246</span>
|
367
|
+
|
368
|
+
<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='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>
|
369
|
+
<span class='ivar'>@basedir</span> <span class='op'>=</span> <span class='id identifier rubyid_basedir'>basedir</span>
|
370
|
+
|
371
|
+
<span class='ivar'>@defaults</span> <span class='op'>=</span> <span class='lbrace'>{</span>
|
372
|
+
<span class='symbol'>:suffix</span> <span class='op'>=></span> <span class='kw'>nil</span><span class='comma'>,</span>
|
373
|
+
<span class='symbol'>:sort</span> <span class='op'>=></span> <span class='kw'>false</span><span class='comma'>,</span>
|
374
|
+
<span class='symbol'>:files</span> <span class='op'>=></span> <span class='kw'>true</span><span class='comma'>,</span>
|
375
|
+
<span class='symbol'>:inclusive</span> <span class='op'>=></span> <span class='kw'>false</span><span class='comma'>,</span>
|
376
|
+
<span class='rbrace'>}</span>
|
377
|
+
|
378
|
+
<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>
|
379
|
+
|
380
|
+
<span class='ivar'>@root</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_clean'>clean</span><span class='lparen'>(</span> <span class='ivar'>@basedir</span> <span class='rparen'>)</span><span class='comma'>,</span> <span class='kw'>true</span> <span class='rparen'>)</span>
|
381
|
+
|
382
|
+
<span class='kw'>end</span></pre>
|
383
|
+
</td>
|
384
|
+
</tr>
|
385
|
+
</table>
|
386
|
+
</div>
|
387
|
+
|
388
|
+
</div>
|
389
|
+
|
390
|
+
<div id="instance_attr_details" class="attr_details">
|
391
|
+
<h2>Instance Attribute Details</h2>
|
392
|
+
|
393
|
+
|
394
|
+
<span id="basedir=-instance_method"></span>
|
395
|
+
<div class="method_details first">
|
396
|
+
<h3 class="signature first" id="basedir-instance_method">
|
397
|
+
|
398
|
+
- (<tt>Object</tt>) <strong>basedir</strong>
|
399
|
+
|
400
|
+
|
401
|
+
|
402
|
+
|
403
|
+
|
404
|
+
</h3><div class="docstring">
|
405
|
+
<div class="discussion">
|
406
|
+
|
407
|
+
<p>Starting directory for Travel</p>
|
408
|
+
|
409
|
+
|
410
|
+
</div>
|
411
|
+
</div>
|
412
|
+
<div class="tags">
|
413
|
+
|
414
|
+
|
415
|
+
</div><table class="source_code">
|
416
|
+
<tr>
|
417
|
+
<td>
|
418
|
+
<pre class="lines">
|
419
|
+
|
420
|
+
|
421
|
+
220
|
422
|
+
221
|
423
|
+
222</pre>
|
424
|
+
</td>
|
425
|
+
<td>
|
426
|
+
<pre class="code"><span class="info file"># File 'lib/dirtravel.rb', line 220</span>
|
427
|
+
|
428
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_basedir'>basedir</span>
|
429
|
+
<span class='ivar'>@basedir</span>
|
430
|
+
<span class='kw'>end</span></pre>
|
431
|
+
</td>
|
432
|
+
</tr>
|
433
|
+
</table>
|
434
|
+
</div>
|
435
|
+
|
436
|
+
|
437
|
+
<span id="defaults=-instance_method"></span>
|
438
|
+
<div class="method_details ">
|
439
|
+
<h3 class="signature " id="defaults-instance_method">
|
440
|
+
|
441
|
+
- (<tt>Object</tt>) <strong>defaults</strong>
|
442
|
+
|
443
|
+
|
444
|
+
|
445
|
+
|
446
|
+
|
447
|
+
</h3><div class="docstring">
|
448
|
+
<div class="discussion">
|
449
|
+
|
450
|
+
<p>Default options for Travel.</p>
|
451
|
+
|
452
|
+
|
453
|
+
</div>
|
454
|
+
</div>
|
455
|
+
<div class="tags">
|
456
|
+
|
457
|
+
|
458
|
+
</div><table class="source_code">
|
459
|
+
<tr>
|
460
|
+
<td>
|
461
|
+
<pre class="lines">
|
462
|
+
|
463
|
+
|
464
|
+
217
|
465
|
+
218
|
466
|
+
219</pre>
|
467
|
+
</td>
|
468
|
+
<td>
|
469
|
+
<pre class="code"><span class="info file"># File 'lib/dirtravel.rb', line 217</span>
|
470
|
+
|
471
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_defaults'>defaults</span>
|
472
|
+
<span class='ivar'>@defaults</span>
|
473
|
+
<span class='kw'>end</span></pre>
|
474
|
+
</td>
|
475
|
+
</tr>
|
476
|
+
</table>
|
477
|
+
</div>
|
478
|
+
|
479
|
+
|
480
|
+
<span id="root=-instance_method"></span>
|
481
|
+
<div class="method_details ">
|
482
|
+
<h3 class="signature " id="root-instance_method">
|
483
|
+
|
484
|
+
- (<tt>Object</tt>) <strong>root</strong>
|
485
|
+
|
486
|
+
|
487
|
+
|
488
|
+
|
489
|
+
|
490
|
+
</h3><div class="docstring">
|
491
|
+
<div class="discussion">
|
492
|
+
|
493
|
+
<p>Root DirEntry of Travel.</p>
|
494
|
+
|
495
|
+
|
496
|
+
</div>
|
497
|
+
</div>
|
498
|
+
<div class="tags">
|
499
|
+
|
500
|
+
|
501
|
+
</div><table class="source_code">
|
502
|
+
<tr>
|
503
|
+
<td>
|
504
|
+
<pre class="lines">
|
505
|
+
|
506
|
+
|
507
|
+
214
|
508
|
+
215
|
509
|
+
216</pre>
|
510
|
+
</td>
|
511
|
+
<td>
|
512
|
+
<pre class="code"><span class="info file"># File 'lib/dirtravel.rb', line 214</span>
|
513
|
+
|
514
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_root'>root</span>
|
515
|
+
<span class='ivar'>@root</span>
|
516
|
+
<span class='kw'>end</span></pre>
|
517
|
+
</td>
|
518
|
+
</tr>
|
519
|
+
</table>
|
520
|
+
</div>
|
521
|
+
|
522
|
+
</div>
|
523
|
+
|
524
|
+
|
525
|
+
<div id="class_method_details" class="method_details_list">
|
526
|
+
<h2>Class Method Details</h2>
|
527
|
+
|
528
|
+
|
529
|
+
<div class="method_details first">
|
530
|
+
<h3 class="signature first" id="filetree-class_method">
|
531
|
+
|
532
|
+
+ (<tt><span class='object_link'><a href="DirEntry.html" title="DirTravel::DirEntry (class)">DirEntry</a></span></tt>) <strong>filetree</strong>(basedir = '.', options = {})
|
533
|
+
|
534
|
+
|
535
|
+
|
536
|
+
|
537
|
+
|
538
|
+
</h3><div class="docstring">
|
539
|
+
<div class="discussion">
|
540
|
+
|
541
|
+
<p>Create directory recursion tree.</p>
|
542
|
+
|
543
|
+
|
544
|
+
</div>
|
545
|
+
</div>
|
546
|
+
<div class="tags">
|
547
|
+
<p class="tag_title">Parameters:</p>
|
548
|
+
<ul class="param">
|
549
|
+
|
550
|
+
<li>
|
551
|
+
|
552
|
+
<span class='name'>basedir</span>
|
553
|
+
|
554
|
+
|
555
|
+
<span class='type'>(<tt>String</tt>)</span>
|
556
|
+
|
557
|
+
|
558
|
+
<em class="default">(defaults to: <tt>'.'</tt>)</em>
|
559
|
+
|
560
|
+
|
561
|
+
—
|
562
|
+
<div class='inline'>
|
563
|
+
<p>Starting directory (top).</p>
|
564
|
+
</div>
|
565
|
+
|
566
|
+
</li>
|
567
|
+
|
568
|
+
<li>
|
569
|
+
|
570
|
+
<span class='name'>options</span>
|
571
|
+
|
572
|
+
|
573
|
+
<span class='type'>(<tt>Hash</tt>)</span>
|
574
|
+
|
575
|
+
|
576
|
+
<em class="default">(defaults to: <tt>{}</tt>)</em>
|
577
|
+
|
578
|
+
|
579
|
+
—
|
580
|
+
<div class='inline'>
|
581
|
+
<p>Hash optionally including keys: :sort, :suffix, :files.</p>
|
582
|
+
</div>
|
583
|
+
|
584
|
+
</li>
|
585
|
+
|
586
|
+
</ul>
|
587
|
+
|
588
|
+
<p class="tag_title">Returns:</p>
|
589
|
+
<ul class="return">
|
590
|
+
|
591
|
+
<li>
|
592
|
+
|
593
|
+
|
594
|
+
<span class='type'>(<tt><span class='object_link'><a href="DirEntry.html" title="DirTravel::DirEntry (class)">DirEntry</a></span></tt>)</span>
|
595
|
+
|
596
|
+
|
597
|
+
|
598
|
+
—
|
599
|
+
<div class='inline'>
|
600
|
+
<p>Root item of the file system hierarchy.</p>
|
601
|
+
</div>
|
602
|
+
|
603
|
+
</li>
|
604
|
+
|
605
|
+
</ul>
|
606
|
+
|
607
|
+
</div><table class="source_code">
|
608
|
+
<tr>
|
609
|
+
<td>
|
610
|
+
<pre class="lines">
|
611
|
+
|
612
|
+
|
613
|
+
226
|
614
|
+
227
|
615
|
+
228
|
616
|
+
229
|
617
|
+
230
|
618
|
+
231
|
619
|
+
232
|
620
|
+
233
|
621
|
+
234
|
622
|
+
235
|
623
|
+
236
|
624
|
+
237
|
625
|
+
238
|
626
|
+
239
|
627
|
+
240
|
628
|
+
241
|
629
|
+
242
|
630
|
+
243</pre>
|
631
|
+
</td>
|
632
|
+
<td>
|
633
|
+
<pre class="code"><span class="info file"># File 'lib/dirtravel.rb', line 226</span>
|
634
|
+
|
635
|
+
<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>
|
636
|
+
|
637
|
+
<span class='id identifier rubyid_r'>r</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_options'>options</span> <span class='rparen'>)</span>
|
638
|
+
<span class='id identifier rubyid_r'>r</span><span class='period'>.</span><span class='id identifier rubyid_travel'>travel</span>
|
639
|
+
|
640
|
+
<span class='kw'>if</span> <span class='id identifier rubyid_r'>r</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>
|
641
|
+
<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_dirname'>dirname</span><span class='lparen'>(</span> <span class='id identifier rubyid_r'>r</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>
|
642
|
+
<span class='kw'>if</span> <span class='id identifier rubyid_r'>r</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>
|
643
|
+
<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_path'>path</span> <span class='rparen'>)</span>
|
644
|
+
<span class='kw'>end</span>
|
645
|
+
<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='kw'>true</span> <span class='rparen'>)</span>
|
646
|
+
<span class='id identifier rubyid_r'>r</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_r'>r</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>
|
647
|
+
<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_r'>r</span><span class='period'>.</span><span class='id identifier rubyid_root'>root</span> <span class='rparen'>)</span>
|
648
|
+
<span class='id identifier rubyid_r'>r</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>
|
649
|
+
<span class='kw'>end</span>
|
650
|
+
|
651
|
+
<span class='id identifier rubyid_r'>r</span><span class='period'>.</span><span class='id identifier rubyid_root'>root</span>
|
652
|
+
<span class='kw'>end</span></pre>
|
653
|
+
</td>
|
654
|
+
</tr>
|
655
|
+
</table>
|
656
|
+
</div>
|
657
|
+
|
658
|
+
</div>
|
659
|
+
|
660
|
+
<div id="instance_method_details" class="method_details_list">
|
661
|
+
<h2>Instance Method Details</h2>
|
662
|
+
|
663
|
+
|
664
|
+
<div class="method_details first">
|
665
|
+
<h3 class="signature first" id="travel-instance_method">
|
666
|
+
|
667
|
+
- (<tt>Object</tt>) <strong>travel</strong>(suffix = @defaults[ :suffix ])
|
668
|
+
|
669
|
+
|
670
|
+
|
671
|
+
|
672
|
+
|
673
|
+
</h3><div class="docstring">
|
674
|
+
<div class="discussion">
|
675
|
+
|
676
|
+
<p>Recursively get all files with suffix. Ignore suffix if suffix is nil.</p>
|
677
|
+
|
678
|
+
|
679
|
+
</div>
|
680
|
+
</div>
|
681
|
+
<div class="tags">
|
682
|
+
|
683
|
+
|
684
|
+
</div><table class="source_code">
|
685
|
+
<tr>
|
686
|
+
<td>
|
687
|
+
<pre class="lines">
|
688
|
+
|
689
|
+
|
690
|
+
265
|
691
|
+
266
|
692
|
+
267</pre>
|
693
|
+
</td>
|
694
|
+
<td>
|
695
|
+
<pre class="code"><span class="info file"># File 'lib/dirtravel.rb', line 265</span>
|
696
|
+
|
697
|
+
<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>
|
698
|
+
<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>
|
699
|
+
<span class='kw'>end</span></pre>
|
700
|
+
</td>
|
701
|
+
</tr>
|
702
|
+
</table>
|
703
|
+
</div>
|
704
|
+
|
705
|
+
</div>
|
706
|
+
|
707
|
+
</div>
|
708
|
+
|
709
|
+
<div id="footer">
|
710
|
+
Generated on Sat Jan 18 17:51:33 2014 by
|
711
|
+
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
712
|
+
0.8.6.1 (ruby-1.9.3).
|
713
|
+
</div>
|
714
|
+
|
715
|
+
</body>
|
716
|
+
</html>
|