imp 0.2.2 → 0.2.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.
- checksums.yaml +4 -4
- data/README.md +6 -0
- data/doc/Imp.html +235 -0
- data/doc/Imp/Commands.html +1211 -0
- data/doc/Imp/Crypto.html +684 -0
- data/doc/Imp/EncryptedFile.html +539 -0
- data/doc/Imp/EncryptedTree.html +1108 -0
- data/doc/Imp/Tree.html +1073 -0
- data/doc/Imp/UI.html +528 -0
- data/doc/Imp/Util.html +359 -0
- data/doc/PasswdManage.html +153 -0
- data/doc/PasswdManage/Commands.html +1086 -0
- data/doc/PasswdManage/Crypto.html +684 -0
- data/doc/PasswdManage/EncryptedFile.html +533 -0
- data/doc/PasswdManage/EncryptedTree.html +1108 -0
- data/doc/PasswdManage/Tree.html +1063 -0
- data/doc/PasswdManage/UI.html +538 -0
- data/doc/PasswdManage/Util.html +224 -0
- data/doc/_index.html +191 -0
- data/doc/class_list.html +54 -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.README.html +98 -0
- data/doc/file_list.html +56 -0
- data/doc/frames.html +26 -0
- data/doc/index.html +98 -0
- data/doc/js/app.js +219 -0
- data/doc/js/full_list.js +178 -0
- data/doc/js/jquery.js +4 -0
- data/doc/method_list.html +311 -0
- data/doc/top-level-namespace.html +112 -0
- data/imp.gemspec +1 -1
- data/lib/imp.rb +1 -1
- data/lib/imp/commands.rb +14 -1
- metadata +33 -3
@@ -0,0 +1,1063 @@
|
|
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: PasswdManage::Tree
|
8
|
+
|
9
|
+
— Documentation by YARD 0.8.7.3
|
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="../PasswdManage.html" title="PasswdManage (module)">PasswdManage</a></span></span>
|
36
|
+
»
|
37
|
+
<span class="title">Tree</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: PasswdManage::Tree
|
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">PasswdManage::Tree</li>
|
82
|
+
|
83
|
+
</ul>
|
84
|
+
<a href="#" class="inheritanceTree">show all</a>
|
85
|
+
|
86
|
+
</dd>
|
87
|
+
|
88
|
+
|
89
|
+
|
90
|
+
|
91
|
+
|
92
|
+
|
93
|
+
<dt class="r2">Includes:</dt>
|
94
|
+
<dd class="r2">Enumerable</dd>
|
95
|
+
|
96
|
+
|
97
|
+
|
98
|
+
|
99
|
+
|
100
|
+
<dt class="r1 last">Defined in:</dt>
|
101
|
+
<dd class="r1 last">lib/passwd_manage/tree.rb</dd>
|
102
|
+
|
103
|
+
</dl>
|
104
|
+
<div class="clear"></div>
|
105
|
+
|
106
|
+
<h2>Overview</h2><div class="docstring">
|
107
|
+
<div class="discussion">
|
108
|
+
|
109
|
+
<p>A directory-esque tree with labeled nodes and edges.</p>
|
110
|
+
|
111
|
+
|
112
|
+
</div>
|
113
|
+
</div>
|
114
|
+
<div class="tags">
|
115
|
+
|
116
|
+
|
117
|
+
</div>
|
118
|
+
|
119
|
+
|
120
|
+
|
121
|
+
<h2>Instance Attribute Summary <small>(<a href="#" class="summary_toggle">collapse</a>)</small></h2>
|
122
|
+
<ul class="summary">
|
123
|
+
|
124
|
+
<li class="public ">
|
125
|
+
<span class="summary_signature">
|
126
|
+
|
127
|
+
<a href="#val-instance_method" title="#val (instance method)">- (Object) <strong>val</strong> </a>
|
128
|
+
|
129
|
+
|
130
|
+
|
131
|
+
</span>
|
132
|
+
|
133
|
+
|
134
|
+
|
135
|
+
|
136
|
+
|
137
|
+
|
138
|
+
|
139
|
+
|
140
|
+
|
141
|
+
|
142
|
+
|
143
|
+
|
144
|
+
<span class="summary_desc"><div class='inline'>
|
145
|
+
<p>The value of the current node in the tree.</p>
|
146
|
+
</div></span>
|
147
|
+
|
148
|
+
</li>
|
149
|
+
|
150
|
+
|
151
|
+
</ul>
|
152
|
+
|
153
|
+
|
154
|
+
|
155
|
+
|
156
|
+
|
157
|
+
<h2>
|
158
|
+
Instance Method Summary
|
159
|
+
<small>(<a href="#" class="summary_toggle">collapse</a>)</small>
|
160
|
+
</h2>
|
161
|
+
|
162
|
+
<ul class="summary">
|
163
|
+
|
164
|
+
<li class="public ">
|
165
|
+
<span class="summary_signature">
|
166
|
+
|
167
|
+
<a href="#%5B%5D-instance_method" title="#[] (instance method)">- (Tree<sup>?</sup>) <strong>[]</strong>(key, create = false) </a>
|
168
|
+
|
169
|
+
|
170
|
+
|
171
|
+
</span>
|
172
|
+
|
173
|
+
|
174
|
+
|
175
|
+
|
176
|
+
|
177
|
+
|
178
|
+
|
179
|
+
|
180
|
+
|
181
|
+
<span class="summary_desc"><div class='inline'>
|
182
|
+
<p>Gets a subtree by the label of the edge leading to it.</p>
|
183
|
+
</div></span>
|
184
|
+
|
185
|
+
</li>
|
186
|
+
|
187
|
+
|
188
|
+
<li class="public ">
|
189
|
+
<span class="summary_signature">
|
190
|
+
|
191
|
+
<a href="#delete-instance_method" title="#delete (instance method)">- (Object) <strong>delete</strong>(key) </a>
|
192
|
+
|
193
|
+
|
194
|
+
|
195
|
+
</span>
|
196
|
+
|
197
|
+
|
198
|
+
|
199
|
+
|
200
|
+
|
201
|
+
|
202
|
+
|
203
|
+
|
204
|
+
|
205
|
+
<span class="summary_desc"><div class='inline'>
|
206
|
+
<p>Removes a subtree by the label of the edge leading to it.</p>
|
207
|
+
</div></span>
|
208
|
+
|
209
|
+
</li>
|
210
|
+
|
211
|
+
|
212
|
+
<li class="public ">
|
213
|
+
<span class="summary_signature">
|
214
|
+
|
215
|
+
<a href="#descendant-instance_method" title="#descendant (instance method)">- (Tree<sup>?</sup>) <strong>descendant</strong>(key, create = false) </a>
|
216
|
+
|
217
|
+
|
218
|
+
|
219
|
+
</span>
|
220
|
+
|
221
|
+
|
222
|
+
|
223
|
+
|
224
|
+
|
225
|
+
|
226
|
+
|
227
|
+
|
228
|
+
|
229
|
+
<span class="summary_desc"><div class='inline'>
|
230
|
+
<p>Gets a (more distant descendant of the current node..</p>
|
231
|
+
</div></span>
|
232
|
+
|
233
|
+
</li>
|
234
|
+
|
235
|
+
|
236
|
+
<li class="public ">
|
237
|
+
<span class="summary_signature">
|
238
|
+
|
239
|
+
<a href="#each-instance_method" title="#each (instance method)">- (Object) <strong>each</strong> {|String, Tree| ... }</a>
|
240
|
+
|
241
|
+
|
242
|
+
|
243
|
+
</span>
|
244
|
+
|
245
|
+
|
246
|
+
|
247
|
+
|
248
|
+
|
249
|
+
|
250
|
+
|
251
|
+
|
252
|
+
|
253
|
+
<span class="summary_desc"><div class='inline'>
|
254
|
+
<p>Iterates over (edge, node) pairs.</p>
|
255
|
+
</div></span>
|
256
|
+
|
257
|
+
</li>
|
258
|
+
|
259
|
+
|
260
|
+
<li class="public ">
|
261
|
+
<span class="summary_signature">
|
262
|
+
|
263
|
+
<a href="#include%3F-instance_method" title="#include? (instance method)">- (Boolean) <strong>include?</strong>(item) </a>
|
264
|
+
|
265
|
+
|
266
|
+
|
267
|
+
</span>
|
268
|
+
|
269
|
+
|
270
|
+
|
271
|
+
|
272
|
+
|
273
|
+
|
274
|
+
|
275
|
+
|
276
|
+
|
277
|
+
<span class="summary_desc"><div class='inline'>
|
278
|
+
<p>Checks if an edge is included.</p>
|
279
|
+
</div></span>
|
280
|
+
|
281
|
+
</li>
|
282
|
+
|
283
|
+
|
284
|
+
<li class="public ">
|
285
|
+
<span class="summary_signature">
|
286
|
+
|
287
|
+
<a href="#initialize-instance_method" title="#initialize (instance method)">- (Tree) <strong>initialize</strong>(val = nil) </a>
|
288
|
+
|
289
|
+
|
290
|
+
|
291
|
+
</span>
|
292
|
+
|
293
|
+
|
294
|
+
<span class="note title constructor">constructor</span>
|
295
|
+
|
296
|
+
|
297
|
+
|
298
|
+
|
299
|
+
|
300
|
+
|
301
|
+
|
302
|
+
|
303
|
+
<span class="summary_desc"><div class='inline'>
|
304
|
+
<p>Creates a new Tree.</p>
|
305
|
+
</div></span>
|
306
|
+
|
307
|
+
</li>
|
308
|
+
|
309
|
+
|
310
|
+
<li class="public ">
|
311
|
+
<span class="summary_signature">
|
312
|
+
|
313
|
+
<a href="#leaf%3F-instance_method" title="#leaf? (instance method)">- (Boolean) <strong>leaf?</strong> </a>
|
314
|
+
|
315
|
+
|
316
|
+
|
317
|
+
</span>
|
318
|
+
|
319
|
+
|
320
|
+
|
321
|
+
|
322
|
+
|
323
|
+
|
324
|
+
|
325
|
+
|
326
|
+
|
327
|
+
<span class="summary_desc"><div class='inline'>
|
328
|
+
<p>Checks if this is a leaf node.</p>
|
329
|
+
</div></span>
|
330
|
+
|
331
|
+
</li>
|
332
|
+
|
333
|
+
|
334
|
+
<li class="public ">
|
335
|
+
<span class="summary_signature">
|
336
|
+
|
337
|
+
<a href="#to_s-instance_method" title="#to_s (instance method)">- (String) <strong>to_s</strong>(indent = 0) </a>
|
338
|
+
|
339
|
+
|
340
|
+
|
341
|
+
</span>
|
342
|
+
|
343
|
+
|
344
|
+
|
345
|
+
|
346
|
+
|
347
|
+
|
348
|
+
|
349
|
+
|
350
|
+
|
351
|
+
<span class="summary_desc"><div class='inline'>
|
352
|
+
<p>Prints the skeleton of the tree.</p>
|
353
|
+
</div></span>
|
354
|
+
|
355
|
+
</li>
|
356
|
+
|
357
|
+
|
358
|
+
</ul>
|
359
|
+
|
360
|
+
|
361
|
+
|
362
|
+
<div id="constructor_details" class="method_details_list">
|
363
|
+
<h2>Constructor Details</h2>
|
364
|
+
|
365
|
+
<div class="method_details first">
|
366
|
+
<h3 class="signature first" id="initialize-instance_method">
|
367
|
+
|
368
|
+
- (<tt><span class='object_link'><a href="" title="PasswdManage::Tree (class)">Tree</a></span></tt>) <strong>initialize</strong>(val = nil)
|
369
|
+
|
370
|
+
|
371
|
+
|
372
|
+
|
373
|
+
|
374
|
+
</h3><div class="docstring">
|
375
|
+
<div class="discussion">
|
376
|
+
|
377
|
+
<p>Creates a new Tree.</p>
|
378
|
+
|
379
|
+
|
380
|
+
</div>
|
381
|
+
</div>
|
382
|
+
<div class="tags">
|
383
|
+
<p class="tag_title">Parameters:</p>
|
384
|
+
<ul class="param">
|
385
|
+
|
386
|
+
<li>
|
387
|
+
|
388
|
+
<span class='name'>val</span>
|
389
|
+
|
390
|
+
|
391
|
+
<span class='type'>(<tt>Object</tt>)</span>
|
392
|
+
|
393
|
+
|
394
|
+
<em class="default">(defaults to: <tt>nil</tt>)</em>
|
395
|
+
|
396
|
+
|
397
|
+
—
|
398
|
+
<div class='inline'>
|
399
|
+
<p>The node label of the tree.</p>
|
400
|
+
</div>
|
401
|
+
|
402
|
+
</li>
|
403
|
+
|
404
|
+
</ul>
|
405
|
+
|
406
|
+
|
407
|
+
</div><table class="source_code">
|
408
|
+
<tr>
|
409
|
+
<td>
|
410
|
+
<pre class="lines">
|
411
|
+
|
412
|
+
|
413
|
+
17
|
414
|
+
18
|
415
|
+
19
|
416
|
+
20</pre>
|
417
|
+
</td>
|
418
|
+
<td>
|
419
|
+
<pre class="code"><span class="info file"># File 'lib/passwd_manage/tree.rb', line 17</span>
|
420
|
+
|
421
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span><span class='lparen'>(</span><span class='id identifier rubyid_val'>val</span> <span class='op'>=</span> <span class='kw'>nil</span><span class='rparen'>)</span>
|
422
|
+
<span class='ivar'>@val</span> <span class='op'>=</span> <span class='id identifier rubyid_val'>val</span>
|
423
|
+
<span class='ivar'>@succ</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span>
|
424
|
+
<span class='kw'>end</span></pre>
|
425
|
+
</td>
|
426
|
+
</tr>
|
427
|
+
</table>
|
428
|
+
</div>
|
429
|
+
|
430
|
+
</div>
|
431
|
+
|
432
|
+
<div id="instance_attr_details" class="attr_details">
|
433
|
+
<h2>Instance Attribute Details</h2>
|
434
|
+
|
435
|
+
|
436
|
+
<span id="val=-instance_method"></span>
|
437
|
+
<div class="method_details first">
|
438
|
+
<h3 class="signature first" id="val-instance_method">
|
439
|
+
|
440
|
+
- (<tt>Object</tt>) <strong>val</strong>
|
441
|
+
|
442
|
+
|
443
|
+
|
444
|
+
|
445
|
+
|
446
|
+
</h3><div class="docstring">
|
447
|
+
<div class="discussion">
|
448
|
+
|
449
|
+
<p>The value of the current node in the tree.</p>
|
450
|
+
|
451
|
+
|
452
|
+
</div>
|
453
|
+
</div>
|
454
|
+
<div class="tags">
|
455
|
+
|
456
|
+
|
457
|
+
</div><table class="source_code">
|
458
|
+
<tr>
|
459
|
+
<td>
|
460
|
+
<pre class="lines">
|
461
|
+
|
462
|
+
|
463
|
+
12
|
464
|
+
13
|
465
|
+
14</pre>
|
466
|
+
</td>
|
467
|
+
<td>
|
468
|
+
<pre class="code"><span class="info file"># File 'lib/passwd_manage/tree.rb', line 12</span>
|
469
|
+
|
470
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_val'>val</span>
|
471
|
+
<span class='ivar'>@val</span>
|
472
|
+
<span class='kw'>end</span></pre>
|
473
|
+
</td>
|
474
|
+
</tr>
|
475
|
+
</table>
|
476
|
+
</div>
|
477
|
+
|
478
|
+
</div>
|
479
|
+
|
480
|
+
|
481
|
+
<div id="instance_method_details" class="method_details_list">
|
482
|
+
<h2>Instance Method Details</h2>
|
483
|
+
|
484
|
+
|
485
|
+
<div class="method_details first">
|
486
|
+
<h3 class="signature first" id="[]-instance_method">
|
487
|
+
|
488
|
+
- (<tt><span class='object_link'><a href="" title="PasswdManage::Tree (class)">Tree</a></span></tt><sup>?</sup>) <strong>[]</strong>(key, create = false)
|
489
|
+
|
490
|
+
|
491
|
+
|
492
|
+
|
493
|
+
|
494
|
+
</h3><div class="docstring">
|
495
|
+
<div class="discussion">
|
496
|
+
|
497
|
+
<p>Gets a subtree by the label of the edge leading to it.</p>
|
498
|
+
|
499
|
+
|
500
|
+
</div>
|
501
|
+
</div>
|
502
|
+
<div class="tags">
|
503
|
+
<p class="tag_title">Parameters:</p>
|
504
|
+
<ul class="param">
|
505
|
+
|
506
|
+
<li>
|
507
|
+
|
508
|
+
<span class='name'>key</span>
|
509
|
+
|
510
|
+
|
511
|
+
<span class='type'>(<tt>String</tt>)</span>
|
512
|
+
|
513
|
+
|
514
|
+
|
515
|
+
—
|
516
|
+
<div class='inline'>
|
517
|
+
<p>The edge label.</p>
|
518
|
+
</div>
|
519
|
+
|
520
|
+
</li>
|
521
|
+
|
522
|
+
<li>
|
523
|
+
|
524
|
+
<span class='name'>create</span>
|
525
|
+
|
526
|
+
|
527
|
+
<span class='type'>(<tt>Boolean</tt>)</span>
|
528
|
+
|
529
|
+
|
530
|
+
<em class="default">(defaults to: <tt>false</tt>)</em>
|
531
|
+
|
532
|
+
|
533
|
+
—
|
534
|
+
<div class='inline'>
|
535
|
+
<p>Whether or not the create a new Node if there is no edge with the label
|
536
|
+
given.</p>
|
537
|
+
</div>
|
538
|
+
|
539
|
+
</li>
|
540
|
+
|
541
|
+
</ul>
|
542
|
+
|
543
|
+
<p class="tag_title">Returns:</p>
|
544
|
+
<ul class="return">
|
545
|
+
|
546
|
+
<li>
|
547
|
+
|
548
|
+
|
549
|
+
<span class='type'>(<tt><span class='object_link'><a href="" title="PasswdManage::Tree (class)">Tree</a></span></tt>, <tt>nil</tt>)</span>
|
550
|
+
|
551
|
+
|
552
|
+
|
553
|
+
—
|
554
|
+
<div class='inline'>
|
555
|
+
<p>The tree at the edge, or nil if it didn't exist annd create was false.</p>
|
556
|
+
</div>
|
557
|
+
|
558
|
+
</li>
|
559
|
+
|
560
|
+
</ul>
|
561
|
+
|
562
|
+
</div><table class="source_code">
|
563
|
+
<tr>
|
564
|
+
<td>
|
565
|
+
<pre class="lines">
|
566
|
+
|
567
|
+
|
568
|
+
29
|
569
|
+
30
|
570
|
+
31
|
571
|
+
32
|
572
|
+
33
|
573
|
+
34
|
574
|
+
35</pre>
|
575
|
+
</td>
|
576
|
+
<td>
|
577
|
+
<pre class="code"><span class="info file"># File 'lib/passwd_manage/tree.rb', line 29</span>
|
578
|
+
|
579
|
+
<span class='kw'>def</span> <span class='op'>[]</span><span class='lparen'>(</span><span class='id identifier rubyid_key'>key</span><span class='comma'>,</span> <span class='id identifier rubyid_create'>create</span> <span class='op'>=</span> <span class='kw'>false</span><span class='rparen'>)</span>
|
580
|
+
<span class='kw'>if</span> <span class='id identifier rubyid_create'>create</span> <span class='kw'>and</span> <span class='kw'>not</span> <span class='ivar'>@succ</span><span class='period'>.</span><span class='id identifier rubyid_include?'>include?</span> <span class='id identifier rubyid_key'>key</span>
|
581
|
+
<span class='ivar'>@succ</span><span class='lbracket'>[</span><span class='id identifier rubyid_key'>key</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='const'>Tree</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span>
|
582
|
+
<span class='kw'>else</span>
|
583
|
+
<span class='ivar'>@succ</span><span class='lbracket'>[</span><span class='id identifier rubyid_key'>key</span><span class='rbracket'>]</span>
|
584
|
+
<span class='kw'>end</span>
|
585
|
+
<span class='kw'>end</span></pre>
|
586
|
+
</td>
|
587
|
+
</tr>
|
588
|
+
</table>
|
589
|
+
</div>
|
590
|
+
|
591
|
+
<div class="method_details ">
|
592
|
+
<h3 class="signature " id="delete-instance_method">
|
593
|
+
|
594
|
+
- (<tt>Object</tt>) <strong>delete</strong>(key)
|
595
|
+
|
596
|
+
|
597
|
+
|
598
|
+
|
599
|
+
|
600
|
+
</h3><div class="docstring">
|
601
|
+
<div class="discussion">
|
602
|
+
|
603
|
+
<p>Removes a subtree by the label of the edge leading to it.</p>
|
604
|
+
|
605
|
+
|
606
|
+
</div>
|
607
|
+
</div>
|
608
|
+
<div class="tags">
|
609
|
+
<p class="tag_title">Parameters:</p>
|
610
|
+
<ul class="param">
|
611
|
+
|
612
|
+
<li>
|
613
|
+
|
614
|
+
<span class='name'>key</span>
|
615
|
+
|
616
|
+
|
617
|
+
<span class='type'>(<tt>String</tt>)</span>
|
618
|
+
|
619
|
+
|
620
|
+
|
621
|
+
—
|
622
|
+
<div class='inline'>
|
623
|
+
<p>The edge label.s</p>
|
624
|
+
</div>
|
625
|
+
|
626
|
+
</li>
|
627
|
+
|
628
|
+
</ul>
|
629
|
+
|
630
|
+
|
631
|
+
</div><table class="source_code">
|
632
|
+
<tr>
|
633
|
+
<td>
|
634
|
+
<pre class="lines">
|
635
|
+
|
636
|
+
|
637
|
+
40
|
638
|
+
41
|
639
|
+
42</pre>
|
640
|
+
</td>
|
641
|
+
<td>
|
642
|
+
<pre class="code"><span class="info file"># File 'lib/passwd_manage/tree.rb', line 40</span>
|
643
|
+
|
644
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_delete'>delete</span><span class='lparen'>(</span><span class='id identifier rubyid_key'>key</span><span class='rparen'>)</span>
|
645
|
+
<span class='ivar'>@succ</span><span class='period'>.</span><span class='id identifier rubyid_delete'>delete</span> <span class='id identifier rubyid_key'>key</span>
|
646
|
+
<span class='kw'>end</span></pre>
|
647
|
+
</td>
|
648
|
+
</tr>
|
649
|
+
</table>
|
650
|
+
</div>
|
651
|
+
|
652
|
+
<div class="method_details ">
|
653
|
+
<h3 class="signature " id="descendant-instance_method">
|
654
|
+
|
655
|
+
- (<tt><span class='object_link'><a href="" title="PasswdManage::Tree (class)">Tree</a></span></tt><sup>?</sup>) <strong>descendant</strong>(key, create = false)
|
656
|
+
|
657
|
+
|
658
|
+
|
659
|
+
|
660
|
+
|
661
|
+
</h3><div class="docstring">
|
662
|
+
<div class="discussion">
|
663
|
+
|
664
|
+
<p>Gets a (more distant descendant of the current node.</p>
|
665
|
+
|
666
|
+
|
667
|
+
</div>
|
668
|
+
</div>
|
669
|
+
<div class="tags">
|
670
|
+
<p class="tag_title">Parameters:</p>
|
671
|
+
<ul class="param">
|
672
|
+
|
673
|
+
<li>
|
674
|
+
|
675
|
+
<span class='name'>key</span>
|
676
|
+
|
677
|
+
|
678
|
+
<span class='type'>(<tt>String</tt>)</span>
|
679
|
+
|
680
|
+
|
681
|
+
|
682
|
+
—
|
683
|
+
<div class='inline'>
|
684
|
+
<p>A forward-slash seperated list of the edge labels to follow.</p>
|
685
|
+
</div>
|
686
|
+
|
687
|
+
</li>
|
688
|
+
|
689
|
+
<li>
|
690
|
+
|
691
|
+
<span class='name'>create</span>
|
692
|
+
|
693
|
+
|
694
|
+
<span class='type'>(<tt>Boolean</tt>)</span>
|
695
|
+
|
696
|
+
|
697
|
+
<em class="default">(defaults to: <tt>false</tt>)</em>
|
698
|
+
|
699
|
+
|
700
|
+
—
|
701
|
+
<div class='inline'>
|
702
|
+
<p>Whether or not to create nodes if the edge labels aren't used yet.</p>
|
703
|
+
</div>
|
704
|
+
|
705
|
+
</li>
|
706
|
+
|
707
|
+
</ul>
|
708
|
+
|
709
|
+
<p class="tag_title">Returns:</p>
|
710
|
+
<ul class="return">
|
711
|
+
|
712
|
+
<li>
|
713
|
+
|
714
|
+
|
715
|
+
<span class='type'>(<tt><span class='object_link'><a href="" title="PasswdManage::Tree (class)">Tree</a></span></tt>, <tt>nil</tt>)</span>
|
716
|
+
|
717
|
+
|
718
|
+
|
719
|
+
—
|
720
|
+
<div class='inline'>
|
721
|
+
<p>The node connected through the edge labels, or nil if there is no such node
|
722
|
+
and create was false.</p>
|
723
|
+
</div>
|
724
|
+
|
725
|
+
</li>
|
726
|
+
|
727
|
+
</ul>
|
728
|
+
|
729
|
+
</div><table class="source_code">
|
730
|
+
<tr>
|
731
|
+
<td>
|
732
|
+
<pre class="lines">
|
733
|
+
|
734
|
+
|
735
|
+
75
|
736
|
+
76
|
737
|
+
77
|
738
|
+
78
|
739
|
+
79
|
740
|
+
80
|
741
|
+
81
|
742
|
+
82
|
743
|
+
83
|
744
|
+
84
|
745
|
+
85</pre>
|
746
|
+
</td>
|
747
|
+
<td>
|
748
|
+
<pre class="code"><span class="info file"># File 'lib/passwd_manage/tree.rb', line 75</span>
|
749
|
+
|
750
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_descendant'>descendant</span><span class='lparen'>(</span><span class='id identifier rubyid_key'>key</span><span class='comma'>,</span> <span class='id identifier rubyid_create'>create</span> <span class='op'>=</span> <span class='kw'>false</span><span class='rparen'>)</span>
|
751
|
+
<span class='kw'>if</span> <span class='id identifier rubyid_key'>key</span><span class='period'>.</span><span class='id identifier rubyid_include?'>include?</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>/</span><span class='tstring_end'>'</span></span>
|
752
|
+
<span class='id identifier rubyid_key'>key</span><span class='comma'>,</span> <span class='id identifier rubyid_keys'>keys</span> <span class='op'>=</span> <span class='id identifier rubyid_key'>key</span><span class='period'>.</span><span class='id identifier rubyid_split'>split</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='comma'>,</span> <span class='int'>2</span><span class='rparen'>)</span>
|
753
|
+
<span class='id identifier rubyid_child'>child</span> <span class='op'>=</span> <span class='kw'>self</span><span class='lbracket'>[</span><span class='id identifier rubyid_key'>key</span><span class='comma'>,</span> <span class='id identifier rubyid_create'>create</span><span class='rbracket'>]</span>
|
754
|
+
<span class='kw'>if</span> <span class='id identifier rubyid_child'>child</span>
|
755
|
+
<span class='id identifier rubyid_child'>child</span><span class='period'>.</span><span class='id identifier rubyid_descendant'>descendant</span><span class='lparen'>(</span><span class='id identifier rubyid_keys'>keys</span><span class='comma'>,</span> <span class='id identifier rubyid_create'>create</span><span class='rparen'>)</span>
|
756
|
+
<span class='kw'>end</span>
|
757
|
+
<span class='kw'>else</span>
|
758
|
+
<span class='kw'>self</span><span class='lbracket'>[</span><span class='id identifier rubyid_key'>key</span><span class='comma'>,</span> <span class='id identifier rubyid_create'>create</span><span class='rbracket'>]</span>
|
759
|
+
<span class='kw'>end</span>
|
760
|
+
<span class='kw'>end</span></pre>
|
761
|
+
</td>
|
762
|
+
</tr>
|
763
|
+
</table>
|
764
|
+
</div>
|
765
|
+
|
766
|
+
<div class="method_details ">
|
767
|
+
<h3 class="signature " id="each-instance_method">
|
768
|
+
|
769
|
+
- (<tt>Object</tt>) <strong>each</strong> {|String, Tree| ... }
|
770
|
+
|
771
|
+
|
772
|
+
|
773
|
+
|
774
|
+
|
775
|
+
</h3><div class="docstring">
|
776
|
+
<div class="discussion">
|
777
|
+
|
778
|
+
<p>Iterates over (edge, node) pairs.</p>
|
779
|
+
|
780
|
+
|
781
|
+
</div>
|
782
|
+
</div>
|
783
|
+
<div class="tags">
|
784
|
+
|
785
|
+
<p class="tag_title">Yields:</p>
|
786
|
+
<ul class="yield">
|
787
|
+
|
788
|
+
<li>
|
789
|
+
|
790
|
+
|
791
|
+
<span class='type'>(<tt>String</tt>, <tt><span class='object_link'><a href="" title="PasswdManage::Tree (class)">Tree</a></span></tt>)</span>
|
792
|
+
|
793
|
+
|
794
|
+
|
795
|
+
—
|
796
|
+
<div class='inline'>
|
797
|
+
<p>Edge, node pairs of connected nodes.</p>
|
798
|
+
</div>
|
799
|
+
|
800
|
+
</li>
|
801
|
+
|
802
|
+
</ul>
|
803
|
+
|
804
|
+
</div><table class="source_code">
|
805
|
+
<tr>
|
806
|
+
<td>
|
807
|
+
<pre class="lines">
|
808
|
+
|
809
|
+
|
810
|
+
54
|
811
|
+
55
|
812
|
+
56</pre>
|
813
|
+
</td>
|
814
|
+
<td>
|
815
|
+
<pre class="code"><span class="info file"># File 'lib/passwd_manage/tree.rb', line 54</span>
|
816
|
+
|
817
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_each'>each</span><span class='lparen'>(</span><span class='op'>&</span><span class='id identifier rubyid_block'>block</span><span class='rparen'>)</span>
|
818
|
+
<span class='ivar'>@succ</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span><span class='lparen'>(</span><span class='op'>&</span><span class='id identifier rubyid_block'>block</span><span class='rparen'>)</span>
|
819
|
+
<span class='kw'>end</span></pre>
|
820
|
+
</td>
|
821
|
+
</tr>
|
822
|
+
</table>
|
823
|
+
</div>
|
824
|
+
|
825
|
+
<div class="method_details ">
|
826
|
+
<h3 class="signature " id="include?-instance_method">
|
827
|
+
|
828
|
+
- (<tt>Boolean</tt>) <strong>include?</strong>(item)
|
829
|
+
|
830
|
+
|
831
|
+
|
832
|
+
|
833
|
+
|
834
|
+
</h3><div class="docstring">
|
835
|
+
<div class="discussion">
|
836
|
+
|
837
|
+
<p>Checks if an edge is included.</p>
|
838
|
+
|
839
|
+
|
840
|
+
</div>
|
841
|
+
</div>
|
842
|
+
<div class="tags">
|
843
|
+
<p class="tag_title">Parameters:</p>
|
844
|
+
<ul class="param">
|
845
|
+
|
846
|
+
<li>
|
847
|
+
|
848
|
+
<span class='name'>item</span>
|
849
|
+
|
850
|
+
|
851
|
+
<span class='type'>(<tt>String</tt>)</span>
|
852
|
+
|
853
|
+
|
854
|
+
|
855
|
+
—
|
856
|
+
<div class='inline'>
|
857
|
+
<p>The string to check.</p>
|
858
|
+
</div>
|
859
|
+
|
860
|
+
</li>
|
861
|
+
|
862
|
+
</ul>
|
863
|
+
|
864
|
+
<p class="tag_title">Returns:</p>
|
865
|
+
<ul class="return">
|
866
|
+
|
867
|
+
<li>
|
868
|
+
|
869
|
+
|
870
|
+
<span class='type'>(<tt>Boolean</tt>)</span>
|
871
|
+
|
872
|
+
|
873
|
+
|
874
|
+
—
|
875
|
+
<div class='inline'>
|
876
|
+
<p>Whether or not the string is an edge label going out from this node.</p>
|
877
|
+
</div>
|
878
|
+
|
879
|
+
</li>
|
880
|
+
|
881
|
+
</ul>
|
882
|
+
|
883
|
+
</div><table class="source_code">
|
884
|
+
<tr>
|
885
|
+
<td>
|
886
|
+
<pre class="lines">
|
887
|
+
|
888
|
+
|
889
|
+
63
|
890
|
+
64
|
891
|
+
65</pre>
|
892
|
+
</td>
|
893
|
+
<td>
|
894
|
+
<pre class="code"><span class="info file"># File 'lib/passwd_manage/tree.rb', line 63</span>
|
895
|
+
|
896
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_include?'>include?</span> <span class='id identifier rubyid_item'>item</span>
|
897
|
+
<span class='ivar'>@succ</span><span class='period'>.</span><span class='id identifier rubyid_include?'>include?</span> <span class='id identifier rubyid_item'>item</span>
|
898
|
+
<span class='kw'>end</span></pre>
|
899
|
+
</td>
|
900
|
+
</tr>
|
901
|
+
</table>
|
902
|
+
</div>
|
903
|
+
|
904
|
+
<div class="method_details ">
|
905
|
+
<h3 class="signature " id="leaf?-instance_method">
|
906
|
+
|
907
|
+
- (<tt>Boolean</tt>) <strong>leaf?</strong>
|
908
|
+
|
909
|
+
|
910
|
+
|
911
|
+
|
912
|
+
|
913
|
+
</h3><div class="docstring">
|
914
|
+
<div class="discussion">
|
915
|
+
|
916
|
+
<p>Checks if this is a leaf node.</p>
|
917
|
+
|
918
|
+
|
919
|
+
</div>
|
920
|
+
</div>
|
921
|
+
<div class="tags">
|
922
|
+
|
923
|
+
<p class="tag_title">Returns:</p>
|
924
|
+
<ul class="return">
|
925
|
+
|
926
|
+
<li>
|
927
|
+
|
928
|
+
|
929
|
+
<span class='type'>(<tt>Boolean</tt>)</span>
|
930
|
+
|
931
|
+
|
932
|
+
|
933
|
+
—
|
934
|
+
<div class='inline'>
|
935
|
+
<p>Wheter or not the node is a leaf.</p>
|
936
|
+
</div>
|
937
|
+
|
938
|
+
</li>
|
939
|
+
|
940
|
+
</ul>
|
941
|
+
|
942
|
+
</div><table class="source_code">
|
943
|
+
<tr>
|
944
|
+
<td>
|
945
|
+
<pre class="lines">
|
946
|
+
|
947
|
+
|
948
|
+
47
|
949
|
+
48
|
950
|
+
49</pre>
|
951
|
+
</td>
|
952
|
+
<td>
|
953
|
+
<pre class="code"><span class="info file"># File 'lib/passwd_manage/tree.rb', line 47</span>
|
954
|
+
|
955
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_leaf?'>leaf?</span>
|
956
|
+
<span class='ivar'>@succ</span><span class='period'>.</span><span class='id identifier rubyid_length'>length</span> <span class='op'>==</span> <span class='int'>0</span>
|
957
|
+
<span class='kw'>end</span></pre>
|
958
|
+
</td>
|
959
|
+
</tr>
|
960
|
+
</table>
|
961
|
+
</div>
|
962
|
+
|
963
|
+
<div class="method_details ">
|
964
|
+
<h3 class="signature " id="to_s-instance_method">
|
965
|
+
|
966
|
+
- (<tt>String</tt>) <strong>to_s</strong>(indent = 0)
|
967
|
+
|
968
|
+
|
969
|
+
|
970
|
+
|
971
|
+
|
972
|
+
</h3><div class="docstring">
|
973
|
+
<div class="discussion">
|
974
|
+
|
975
|
+
<p>Prints the skeleton of the tree. Node labels are NOT printed.</p>
|
976
|
+
|
977
|
+
|
978
|
+
</div>
|
979
|
+
</div>
|
980
|
+
<div class="tags">
|
981
|
+
<p class="tag_title">Parameters:</p>
|
982
|
+
<ul class="param">
|
983
|
+
|
984
|
+
<li>
|
985
|
+
|
986
|
+
<span class='name'>indent</span>
|
987
|
+
|
988
|
+
|
989
|
+
<span class='type'>(<tt>Int</tt>)</span>
|
990
|
+
|
991
|
+
|
992
|
+
<em class="default">(defaults to: <tt>0</tt>)</em>
|
993
|
+
|
994
|
+
|
995
|
+
—
|
996
|
+
<div class='inline'>
|
997
|
+
<p>By how many stages to indent the tree.</p>
|
998
|
+
</div>
|
999
|
+
|
1000
|
+
</li>
|
1001
|
+
|
1002
|
+
</ul>
|
1003
|
+
|
1004
|
+
<p class="tag_title">Returns:</p>
|
1005
|
+
<ul class="return">
|
1006
|
+
|
1007
|
+
<li>
|
1008
|
+
|
1009
|
+
|
1010
|
+
<span class='type'>(<tt>String</tt>)</span>
|
1011
|
+
|
1012
|
+
|
1013
|
+
|
1014
|
+
—
|
1015
|
+
<div class='inline'>
|
1016
|
+
<p>The skeleton of the tree.</p>
|
1017
|
+
</div>
|
1018
|
+
|
1019
|
+
</li>
|
1020
|
+
|
1021
|
+
</ul>
|
1022
|
+
|
1023
|
+
</div><table class="source_code">
|
1024
|
+
<tr>
|
1025
|
+
<td>
|
1026
|
+
<pre class="lines">
|
1027
|
+
|
1028
|
+
|
1029
|
+
91
|
1030
|
+
92
|
1031
|
+
93
|
1032
|
+
94
|
1033
|
+
95
|
1034
|
+
96
|
1035
|
+
97</pre>
|
1036
|
+
</td>
|
1037
|
+
<td>
|
1038
|
+
<pre class="code"><span class="info file"># File 'lib/passwd_manage/tree.rb', line 91</span>
|
1039
|
+
|
1040
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_to_s'>to_s</span><span class='lparen'>(</span><span class='id identifier rubyid_indent'>indent</span> <span class='op'>=</span> <span class='int'>0</span><span class='rparen'>)</span>
|
1041
|
+
<span class='id identifier rubyid_s'>s</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_end'>"</span></span>
|
1042
|
+
<span class='id identifier rubyid_each'>each</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_k'>k</span><span class='comma'>,</span> <span class='id identifier rubyid_v'>v</span><span class='op'>|</span>
|
1043
|
+
<span class='id identifier rubyid_s'>s</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='lparen'>(</span><span class='id identifier rubyid_indent'>indent</span><span class='rparen'>)</span> <span class='op'>+</span> <span class='id identifier rubyid_k'>k</span> <span class='op'>+</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/\n</span><span class='tstring_end'>"</span></span> <span class='op'>+</span> <span class='id identifier rubyid_v'>v</span><span class='period'>.</span><span class='id identifier rubyid_to_s'>to_s</span><span class='lparen'>(</span><span class='id identifier rubyid_indent'>indent</span> <span class='op'>+</span> <span class='int'>1</span><span class='rparen'>)</span>
|
1044
|
+
<span class='kw'>end</span>
|
1045
|
+
<span class='kw'>return</span> <span class='id identifier rubyid_s'>s</span>
|
1046
|
+
<span class='kw'>end</span></pre>
|
1047
|
+
</td>
|
1048
|
+
</tr>
|
1049
|
+
</table>
|
1050
|
+
</div>
|
1051
|
+
|
1052
|
+
</div>
|
1053
|
+
|
1054
|
+
</div>
|
1055
|
+
|
1056
|
+
<div id="footer">
|
1057
|
+
Generated on Sat Nov 9 18:07:45 2013 by
|
1058
|
+
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
1059
|
+
0.8.7.3 (ruby-2.0.0).
|
1060
|
+
</div>
|
1061
|
+
|
1062
|
+
</body>
|
1063
|
+
</html>
|