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
data/doc/Imp/UI.html
ADDED
@@ -0,0 +1,528 @@
|
|
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
|
+
Module: Imp::UI
|
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 (U)</a> »
|
35
|
+
<span class='title'><span class='object_link'><a href="../Imp.html" title="Imp (module)">Imp</a></span></span>
|
36
|
+
»
|
37
|
+
<span class="title">UI</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>Module: Imp::UI
|
67
|
+
|
68
|
+
|
69
|
+
|
70
|
+
</h1>
|
71
|
+
|
72
|
+
<dl class="box">
|
73
|
+
|
74
|
+
|
75
|
+
|
76
|
+
|
77
|
+
|
78
|
+
|
79
|
+
|
80
|
+
|
81
|
+
<dt class="r1 last">Defined in:</dt>
|
82
|
+
<dd class="r1 last">lib/imp/ui.rb</dd>
|
83
|
+
|
84
|
+
</dl>
|
85
|
+
<div class="clear"></div>
|
86
|
+
|
87
|
+
<h2>Overview</h2><div class="docstring">
|
88
|
+
<div class="discussion">
|
89
|
+
|
90
|
+
<p>Module handling user I/O.</p>
|
91
|
+
|
92
|
+
|
93
|
+
</div>
|
94
|
+
</div>
|
95
|
+
<div class="tags">
|
96
|
+
|
97
|
+
|
98
|
+
</div>
|
99
|
+
<h2>Constant Summary</h2>
|
100
|
+
|
101
|
+
<dl class="constants">
|
102
|
+
|
103
|
+
<dt id="DEFAULT_FILE-constant" class="">DEFAULT_FILE =
|
104
|
+
<div class="docstring">
|
105
|
+
<div class="discussion">
|
106
|
+
|
107
|
+
<p>The default file to save encrypted passwords in.</p>
|
108
|
+
|
109
|
+
|
110
|
+
</div>
|
111
|
+
</div>
|
112
|
+
<div class="tags">
|
113
|
+
|
114
|
+
|
115
|
+
</div>
|
116
|
+
</dt>
|
117
|
+
<dd><pre class="code"><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>~/.imp/default.enc</span><span class='tstring_end'>'</span></span></pre></dd>
|
118
|
+
|
119
|
+
<dt id="HISTFILE-constant" class="">HISTFILE =
|
120
|
+
<div class="docstring">
|
121
|
+
<div class="discussion">
|
122
|
+
|
123
|
+
<p>The file of the history of the prompt.</p>
|
124
|
+
|
125
|
+
|
126
|
+
</div>
|
127
|
+
</div>
|
128
|
+
<div class="tags">
|
129
|
+
|
130
|
+
|
131
|
+
</div>
|
132
|
+
</dt>
|
133
|
+
<dd><pre class="code"><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>~/.imp/hist</span><span class='tstring_end'>'</span></span></pre></dd>
|
134
|
+
|
135
|
+
<dt id="PROMPT-constant" class="">PROMPT =
|
136
|
+
<div class="docstring">
|
137
|
+
<div class="discussion">
|
138
|
+
|
139
|
+
<p>The string precending user input in the prompt.</p>
|
140
|
+
|
141
|
+
|
142
|
+
</div>
|
143
|
+
</div>
|
144
|
+
<div class="tags">
|
145
|
+
|
146
|
+
|
147
|
+
</div>
|
148
|
+
</dt>
|
149
|
+
<dd><pre class="code"><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>imp> </span><span class='tstring_end'>'</span></span></pre></dd>
|
150
|
+
|
151
|
+
<dt id="TIMEOUT-constant" class="">TIMEOUT =
|
152
|
+
<div class="docstring">
|
153
|
+
<div class="discussion">
|
154
|
+
|
155
|
+
<p>The time in seconds, after which the program exits if it recieves no input
|
156
|
+
from the user.</p>
|
157
|
+
|
158
|
+
|
159
|
+
</div>
|
160
|
+
</div>
|
161
|
+
<div class="tags">
|
162
|
+
|
163
|
+
|
164
|
+
</div>
|
165
|
+
</dt>
|
166
|
+
<dd><pre class="code"><span class='int'>300</span></pre></dd>
|
167
|
+
|
168
|
+
</dl>
|
169
|
+
|
170
|
+
|
171
|
+
|
172
|
+
|
173
|
+
|
174
|
+
|
175
|
+
|
176
|
+
|
177
|
+
|
178
|
+
<h2>
|
179
|
+
Class Method Summary
|
180
|
+
<small>(<a href="#" class="summary_toggle">collapse</a>)</small>
|
181
|
+
</h2>
|
182
|
+
|
183
|
+
<ul class="summary">
|
184
|
+
|
185
|
+
<li class="public ">
|
186
|
+
<span class="summary_signature">
|
187
|
+
|
188
|
+
<a href="#close_file-class_method" title="close_file (class method)">+ (Object) <strong>close_file</strong> </a>
|
189
|
+
|
190
|
+
|
191
|
+
|
192
|
+
</span>
|
193
|
+
|
194
|
+
|
195
|
+
|
196
|
+
|
197
|
+
|
198
|
+
|
199
|
+
|
200
|
+
|
201
|
+
|
202
|
+
<span class="summary_desc"><div class='inline'>
|
203
|
+
<p>Closes the tree.</p>
|
204
|
+
</div></span>
|
205
|
+
|
206
|
+
</li>
|
207
|
+
|
208
|
+
|
209
|
+
<li class="public ">
|
210
|
+
<span class="summary_signature">
|
211
|
+
|
212
|
+
<a href="#load_file-class_method" title="load_file (class method)">+ (Object) <strong>load_file</strong> </a>
|
213
|
+
|
214
|
+
|
215
|
+
|
216
|
+
</span>
|
217
|
+
|
218
|
+
|
219
|
+
|
220
|
+
|
221
|
+
|
222
|
+
|
223
|
+
|
224
|
+
|
225
|
+
|
226
|
+
<span class="summary_desc"><div class='inline'>
|
227
|
+
<p>Loads and decrypts a file.</p>
|
228
|
+
</div></span>
|
229
|
+
|
230
|
+
</li>
|
231
|
+
|
232
|
+
|
233
|
+
<li class="public ">
|
234
|
+
<span class="summary_signature">
|
235
|
+
|
236
|
+
<a href="#main-class_method" title="main (class method)">+ (Object) <strong>main</strong> </a>
|
237
|
+
|
238
|
+
|
239
|
+
|
240
|
+
</span>
|
241
|
+
|
242
|
+
|
243
|
+
|
244
|
+
|
245
|
+
|
246
|
+
|
247
|
+
|
248
|
+
|
249
|
+
|
250
|
+
<span class="summary_desc"><div class='inline'>
|
251
|
+
<p>Runs the program.</p>
|
252
|
+
</div></span>
|
253
|
+
|
254
|
+
</li>
|
255
|
+
|
256
|
+
|
257
|
+
<li class="public ">
|
258
|
+
<span class="summary_signature">
|
259
|
+
|
260
|
+
<a href="#timeout-class_method" title="timeout (class method)">+ (Object) <strong>timeout</strong>(&block) </a>
|
261
|
+
|
262
|
+
|
263
|
+
|
264
|
+
</span>
|
265
|
+
|
266
|
+
|
267
|
+
|
268
|
+
|
269
|
+
|
270
|
+
|
271
|
+
|
272
|
+
|
273
|
+
|
274
|
+
<span class="summary_desc"><div class='inline'>
|
275
|
+
<p>Times out execution of a block and exits printing an appropriate message if
|
276
|
+
the block doesn't time out in time.</p>
|
277
|
+
</div></span>
|
278
|
+
|
279
|
+
</li>
|
280
|
+
|
281
|
+
|
282
|
+
</ul>
|
283
|
+
|
284
|
+
|
285
|
+
|
286
|
+
|
287
|
+
<div id="class_method_details" class="method_details_list">
|
288
|
+
<h2>Class Method Details</h2>
|
289
|
+
|
290
|
+
|
291
|
+
<div class="method_details first">
|
292
|
+
<h3 class="signature first" id="close_file-class_method">
|
293
|
+
|
294
|
+
+ (<tt>Object</tt>) <strong>close_file</strong>
|
295
|
+
|
296
|
+
|
297
|
+
|
298
|
+
|
299
|
+
|
300
|
+
</h3><div class="docstring">
|
301
|
+
<div class="discussion">
|
302
|
+
|
303
|
+
<p>Closes the tree. This generally only happens right before ruby is about to
|
304
|
+
exit so it isn't that important but hey.</p>
|
305
|
+
|
306
|
+
|
307
|
+
</div>
|
308
|
+
</div>
|
309
|
+
<div class="tags">
|
310
|
+
|
311
|
+
|
312
|
+
</div><table class="source_code">
|
313
|
+
<tr>
|
314
|
+
<td>
|
315
|
+
<pre class="lines">
|
316
|
+
|
317
|
+
|
318
|
+
43
|
319
|
+
44
|
320
|
+
45
|
321
|
+
46</pre>
|
322
|
+
</td>
|
323
|
+
<td>
|
324
|
+
<pre class="code"><span class="info file"># File 'lib/imp/ui.rb', line 43</span>
|
325
|
+
|
326
|
+
<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_close_file'>close_file</span>
|
327
|
+
<span class='gvar'>$tree</span><span class='period'>.</span><span class='id identifier rubyid_close'>close</span>
|
328
|
+
<span class='gvar'>$tree</span> <span class='op'>=</span> <span class='kw'>nil</span>
|
329
|
+
<span class='kw'>end</span></pre>
|
330
|
+
</td>
|
331
|
+
</tr>
|
332
|
+
</table>
|
333
|
+
</div>
|
334
|
+
|
335
|
+
<div class="method_details ">
|
336
|
+
<h3 class="signature " id="load_file-class_method">
|
337
|
+
|
338
|
+
+ (<tt>Object</tt>) <strong>load_file</strong>
|
339
|
+
|
340
|
+
|
341
|
+
|
342
|
+
|
343
|
+
|
344
|
+
</h3><div class="docstring">
|
345
|
+
<div class="discussion">
|
346
|
+
|
347
|
+
<p>Loads and decrypts a file. The password is asked for interactively.</p>
|
348
|
+
|
349
|
+
|
350
|
+
</div>
|
351
|
+
</div>
|
352
|
+
<div class="tags">
|
353
|
+
|
354
|
+
|
355
|
+
</div><table class="source_code">
|
356
|
+
<tr>
|
357
|
+
<td>
|
358
|
+
<pre class="lines">
|
359
|
+
|
360
|
+
|
361
|
+
29
|
362
|
+
30
|
363
|
+
31
|
364
|
+
32
|
365
|
+
33
|
366
|
+
34
|
367
|
+
35
|
368
|
+
36
|
369
|
+
37
|
370
|
+
38
|
371
|
+
39</pre>
|
372
|
+
</td>
|
373
|
+
<td>
|
374
|
+
<pre class="code"><span class="info file"># File 'lib/imp/ui.rb', line 29</span>
|
375
|
+
|
376
|
+
<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_load_file'>load_file</span>
|
377
|
+
<span class='kw'>until</span> <span class='gvar'>$tree</span>
|
378
|
+
<span class='kw'>begin</span>
|
379
|
+
<span class='id identifier rubyid_passwd'>passwd</span> <span class='op'>=</span> <span class='id identifier rubyid_get_passwd'>get_passwd</span>
|
380
|
+
<span class='kw'>return</span> <span class='kw'>unless</span> <span class='id identifier rubyid_passwd'>passwd</span>
|
381
|
+
<span class='gvar'>$tree</span> <span class='op'>=</span> <span class='const'>EncryptedTree</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='id identifier rubyid_passwd'>passwd</span><span class='comma'>,</span> <span class='gvar'>$file</span><span class='rparen'>)</span>
|
382
|
+
<span class='kw'>rescue</span> <span class='const'>OpenSSL</span><span class='op'>::</span><span class='const'>Cipher</span><span class='op'>::</span><span class='const'>CipherError</span>
|
383
|
+
<span class='gvar'>$stderr</span><span class='period'>.</span><span class='id identifier rubyid_puts'>puts</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Decryption failed. Corrupt file or wrong password.</span><span class='tstring_end'>"</span></span>
|
384
|
+
<span class='kw'>end</span>
|
385
|
+
<span class='kw'>end</span>
|
386
|
+
<span class='kw'>end</span></pre>
|
387
|
+
</td>
|
388
|
+
</tr>
|
389
|
+
</table>
|
390
|
+
</div>
|
391
|
+
|
392
|
+
<div class="method_details ">
|
393
|
+
<h3 class="signature " id="main-class_method">
|
394
|
+
|
395
|
+
+ (<tt>Object</tt>) <strong>main</strong>
|
396
|
+
|
397
|
+
|
398
|
+
|
399
|
+
|
400
|
+
|
401
|
+
</h3><div class="docstring">
|
402
|
+
<div class="discussion">
|
403
|
+
|
404
|
+
<p>Runs the program.</p>
|
405
|
+
|
406
|
+
|
407
|
+
</div>
|
408
|
+
</div>
|
409
|
+
<div class="tags">
|
410
|
+
|
411
|
+
|
412
|
+
</div><table class="source_code">
|
413
|
+
<tr>
|
414
|
+
<td>
|
415
|
+
<pre class="lines">
|
416
|
+
|
417
|
+
|
418
|
+
49
|
419
|
+
50
|
420
|
+
51
|
421
|
+
52
|
422
|
+
53
|
423
|
+
54
|
424
|
+
55
|
425
|
+
56
|
426
|
+
57
|
427
|
+
58
|
428
|
+
59
|
429
|
+
60
|
430
|
+
61
|
431
|
+
62
|
432
|
+
63
|
433
|
+
64
|
434
|
+
65
|
435
|
+
66</pre>
|
436
|
+
</td>
|
437
|
+
<td>
|
438
|
+
<pre class="code"><span class="info file"># File 'lib/imp/ui.rb', line 49</span>
|
439
|
+
|
440
|
+
<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_main'>main</span>
|
441
|
+
<span class='id identifier rubyid_load_options'>load_options</span>
|
442
|
+
<span class='kw'>if</span> <span class='gvar'>$opts</span><span class='lbracket'>[</span><span class='symbol'>:file</span><span class='rbracket'>]</span>
|
443
|
+
<span class='gvar'>$file</span> <span class='op'>=</span> <span class='gvar'>$opts</span><span class='lbracket'>[</span><span class='symbol'>:file</span><span class='rbracket'>]</span>
|
444
|
+
<span class='kw'>else</span>
|
445
|
+
<span class='gvar'>$file</span> <span class='op'>=</span> <span class='const'>DEFAULT_FILE</span>
|
446
|
+
<span class='kw'>end</span>
|
447
|
+
<span class='id identifier rubyid_load_file'>load_file</span>
|
448
|
+
<span class='comment'># If no password was entered, quit.
|
449
|
+
</span> <span class='id identifier rubyid_exit'>exit</span> <span class='kw'>unless</span> <span class='gvar'>$tree</span>
|
450
|
+
<span class='id identifier rubyid_welcome'>welcome</span>
|
451
|
+
<span class='id identifier rubyid_init_readline'>init_readline</span>
|
452
|
+
<span class='kw'>begin</span>
|
453
|
+
<span class='id identifier rubyid_prompt'>prompt</span>
|
454
|
+
<span class='kw'>ensure</span>
|
455
|
+
<span class='id identifier rubyid_close_file'>close_file</span>
|
456
|
+
<span class='kw'>end</span>
|
457
|
+
<span class='kw'>end</span></pre>
|
458
|
+
</td>
|
459
|
+
</tr>
|
460
|
+
</table>
|
461
|
+
</div>
|
462
|
+
|
463
|
+
<div class="method_details ">
|
464
|
+
<h3 class="signature " id="timeout-class_method">
|
465
|
+
|
466
|
+
+ (<tt>Object</tt>) <strong>timeout</strong>(&block)
|
467
|
+
|
468
|
+
|
469
|
+
|
470
|
+
|
471
|
+
|
472
|
+
</h3><div class="docstring">
|
473
|
+
<div class="discussion">
|
474
|
+
|
475
|
+
<p>Times out execution of a block and exits printing an appropriate message if
|
476
|
+
the block doesn't time out in time.</p>
|
477
|
+
|
478
|
+
<p>The name is due to a conflict with Timeout's own.</p>
|
479
|
+
|
480
|
+
|
481
|
+
</div>
|
482
|
+
</div>
|
483
|
+
<div class="tags">
|
484
|
+
|
485
|
+
|
486
|
+
</div><table class="source_code">
|
487
|
+
<tr>
|
488
|
+
<td>
|
489
|
+
<pre class="lines">
|
490
|
+
|
491
|
+
|
492
|
+
72
|
493
|
+
73
|
494
|
+
74
|
495
|
+
75
|
496
|
+
76
|
497
|
+
77
|
498
|
+
78
|
499
|
+
79</pre>
|
500
|
+
</td>
|
501
|
+
<td>
|
502
|
+
<pre class="code"><span class="info file"># File 'lib/imp/ui.rb', line 72</span>
|
503
|
+
|
504
|
+
<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_timeout'>timeout</span><span class='lparen'>(</span><span class='op'>&</span><span class='id identifier rubyid_block'>block</span><span class='rparen'>)</span>
|
505
|
+
<span class='kw'>begin</span>
|
506
|
+
<span class='const'>Timeout</span><span class='op'>::</span><span class='id identifier rubyid_timeout'>timeout</span><span class='lparen'>(</span><span class='const'>TIMEOUT</span><span class='comma'>,</span> <span class='op'>&</span><span class='id identifier rubyid_block'>block</span><span class='rparen'>)</span>
|
507
|
+
<span class='kw'>rescue</span> <span class='const'>Timeout</span><span class='op'>::</span><span class='const'>Error</span>
|
508
|
+
<span class='gvar'>$stderr</span><span class='period'>.</span><span class='id identifier rubyid_puts'>puts</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>\nUser input timeout. Closing...</span><span class='tstring_end'>"</span></span>
|
509
|
+
<span class='id identifier rubyid_exit'>exit</span>
|
510
|
+
<span class='kw'>end</span>
|
511
|
+
<span class='kw'>end</span></pre>
|
512
|
+
</td>
|
513
|
+
</tr>
|
514
|
+
</table>
|
515
|
+
</div>
|
516
|
+
|
517
|
+
</div>
|
518
|
+
|
519
|
+
</div>
|
520
|
+
|
521
|
+
<div id="footer">
|
522
|
+
Generated on Sun Nov 10 00:39:21 2013 by
|
523
|
+
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
524
|
+
0.8.7.3 (ruby-2.0.0).
|
525
|
+
</div>
|
526
|
+
|
527
|
+
</body>
|
528
|
+
</html>
|