mucgly 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,2097 @@
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: EasyFile::InOut
8
+
9
+ &mdash; Documentation by YARD 0.8.6.1
10
+
11
+ </title>
12
+
13
+ <link rel="stylesheet" href="../css/style.css" type="text/css" charset="utf-8" />
14
+
15
+ <link rel="stylesheet" href="../css/common.css" type="text/css" charset="utf-8" />
16
+
17
+ <script type="text/javascript" charset="utf-8">
18
+ hasFrames = window.top.frames.main ? true : false;
19
+ relpath = '../';
20
+ framesUrl = "../frames.html#!" + escape(window.location.href);
21
+ </script>
22
+
23
+
24
+ <script type="text/javascript" charset="utf-8" src="../js/jquery.js"></script>
25
+
26
+ <script type="text/javascript" charset="utf-8" src="../js/app.js"></script>
27
+
28
+
29
+ </head>
30
+ <body>
31
+ <div id="header">
32
+ <div id="menu">
33
+
34
+ <a href="../_index.html">Index (I)</a> &raquo;
35
+ <span class='title'><span class='object_link'><a href="../EasyFile.html" title="EasyFile (module)">EasyFile</a></span></span>
36
+ &raquo;
37
+ <span class="title">InOut</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: EasyFile::InOut
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">EasyFile::InOut</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/easyfile.rb<span class="defines">,<br />
98
+ lib/easyfile.rb</span>
99
+ </dd>
100
+
101
+ </dl>
102
+ <div class="clear"></div>
103
+
104
+ <h2>Overview</h2><div class="docstring">
105
+ <div class="discussion">
106
+
107
+ <p>Base class for Read and Write files.</p>
108
+
109
+
110
+ </div>
111
+ </div>
112
+ <div class="tags">
113
+
114
+
115
+ </div><div id="subclasses">
116
+ <h2>Direct Known Subclasses</h2>
117
+ <p class="children"><span class='object_link'><a href="Read.html" title="EasyFile::Read (class)">Read</a></span>, <span class='object_link'><a href="String.html" title="EasyFile::String (class)">String</a></span>, <span class='object_link'><a href="Write.html" title="EasyFile::Write (class)">Write</a></span></p>
118
+ </div>
119
+
120
+ <h2>Constant Summary</h2>
121
+
122
+ <dl class="constants">
123
+
124
+ <dt id="FILEMODEMAP-constant" class="">FILEMODEMAP =
125
+ <div class="docstring">
126
+ <div class="discussion">
127
+
128
+ <p>Map symbolic file direction to mode character.</p>
129
+
130
+
131
+ </div>
132
+ </div>
133
+ <div class="tags">
134
+
135
+
136
+ </div>
137
+ </dt>
138
+ <dd><pre class="code"><span class='lbrace'>{</span>
139
+ <span class='symbol'>:read</span> <span class='op'>=&gt;</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>r</span><span class='tstring_end'>'</span></span><span class='comma'>,</span>
140
+ <span class='symbol'>:write</span> <span class='op'>=&gt;</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>w</span><span class='tstring_end'>'</span></span><span class='comma'>,</span>
141
+ <span class='rbrace'>}</span></pre></dd>
142
+
143
+ <dt id="file_io-classvariable" class="">@@file_io =
144
+ <div class="docstring">
145
+ <div class="discussion">
146
+
147
+ <p>Declare standards IOs.</p>
148
+
149
+
150
+ </div>
151
+ </div>
152
+ <div class="tags">
153
+
154
+
155
+ </div>
156
+ </dt>
157
+ <dd><pre class="code"><span class='lbrace'>{</span>
158
+ <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>&lt;STDIN&gt;</span><span class='tstring_end'>&quot;</span></span> <span class='op'>=&gt;</span> <span class='const'>Read</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>&lt;STDIN&gt;</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='kw'>nil</span><span class='comma'>,</span> <span class='const'>STDIN</span> <span class='rparen'>)</span><span class='comma'>,</span>
159
+ <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>&lt;STDOUT&gt;</span><span class='tstring_end'>&quot;</span></span> <span class='op'>=&gt;</span> <span class='const'>Write</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>&lt;STDOUT&gt;</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='kw'>nil</span><span class='comma'>,</span> <span class='const'>STDOUT</span> <span class='rparen'>)</span><span class='comma'>,</span>
160
+ <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>&lt;STDERR&gt;</span><span class='tstring_end'>&quot;</span></span> <span class='op'>=&gt;</span> <span class='const'>Write</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>&lt;STDERR&gt;</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='kw'>nil</span><span class='comma'>,</span> <span class='const'>STDERR</span> <span class='rparen'>)</span><span class='comma'>,</span>
161
+ <span class='comment'># filename (absname) =&gt; InOut object
162
+ </span><span class='rbrace'>}</span></pre></dd>
163
+
164
+ </dl>
165
+
166
+
167
+
168
+
169
+
170
+ <h2>Instance Attribute Summary <small>(<a href="#" class="summary_toggle">collapse</a>)</small></h2>
171
+ <ul class="summary">
172
+
173
+ <li class="public ">
174
+ <span class="summary_signature">
175
+
176
+ <a href="#absname-instance_method" title="#absname (instance method)">- (Object) <strong>absname</strong> </a>
177
+
178
+
179
+
180
+ (also: #id)
181
+
182
+ </span>
183
+
184
+
185
+
186
+
187
+ <span class="note title readonly">readonly</span>
188
+
189
+
190
+
191
+
192
+
193
+
194
+
195
+
196
+
197
+ <span class="summary_desc"><div class='inline'>
198
+ <p>Absolute path name for file.</p>
199
+ </div></span>
200
+
201
+ </li>
202
+
203
+
204
+ <li class="public ">
205
+ <span class="summary_signature">
206
+
207
+ <a href="#filename-instance_method" title="#filename (instance method)">- (Object) <strong>filename</strong> </a>
208
+
209
+
210
+
211
+ </span>
212
+
213
+
214
+
215
+
216
+ <span class="note title readonly">readonly</span>
217
+
218
+
219
+
220
+
221
+
222
+
223
+
224
+
225
+
226
+ <span class="summary_desc"><div class='inline'>
227
+ <p>Relative path name for file.</p>
228
+ </div></span>
229
+
230
+ </li>
231
+
232
+
233
+ <li class="public ">
234
+ <span class="summary_signature">
235
+
236
+ <a href="#io-instance_method" title="#io (instance method)">- (Object) <strong>io</strong> </a>
237
+
238
+
239
+
240
+ </span>
241
+
242
+
243
+
244
+
245
+
246
+
247
+
248
+
249
+
250
+
251
+
252
+
253
+ <span class="summary_desc"><div class='inline'>
254
+ <p>IO stream handle.</p>
255
+ </div></span>
256
+
257
+ </li>
258
+
259
+
260
+ <li class="public ">
261
+ <span class="summary_signature">
262
+
263
+ <a href="#line-instance_method" title="#line (instance method)">- (Object) <strong>line</strong> </a>
264
+
265
+
266
+
267
+ </span>
268
+
269
+
270
+
271
+
272
+
273
+
274
+
275
+
276
+
277
+
278
+
279
+
280
+ <span class="summary_desc"><div class='inline'>
281
+ <p>Current line number (0,1,2...).</p>
282
+ </div></span>
283
+
284
+ </li>
285
+
286
+
287
+ <li class="public ">
288
+ <span class="summary_signature">
289
+
290
+ <a href="#mode-instance_method" title="#mode (instance method)">- (Object) <strong>mode</strong> </a>
291
+
292
+
293
+
294
+ </span>
295
+
296
+
297
+
298
+
299
+ <span class="note title readonly">readonly</span>
300
+
301
+
302
+
303
+
304
+
305
+
306
+
307
+
308
+
309
+ <span class="summary_desc"><div class='inline'>
310
+ <p>File mode.</p>
311
+ </div></span>
312
+
313
+ </li>
314
+
315
+
316
+ <li class="public ">
317
+ <span class="summary_signature">
318
+
319
+ <a href="#parent-instance_method" title="#parent (instance method)">- (Object) <strong>parent</strong> </a>
320
+
321
+
322
+
323
+ </span>
324
+
325
+
326
+
327
+
328
+
329
+
330
+
331
+
332
+
333
+
334
+
335
+
336
+ <span class="summary_desc"><div class='inline'>
337
+ <p>Parent EasyFile (push/pop).</p>
338
+ </div></span>
339
+
340
+ </li>
341
+
342
+
343
+ <li class="public ">
344
+ <span class="summary_signature">
345
+
346
+ <a href="#peers-instance_method" title="#peers (instance method)">- (Object) <strong>peers</strong> </a>
347
+
348
+
349
+
350
+ </span>
351
+
352
+
353
+
354
+
355
+
356
+
357
+
358
+
359
+
360
+
361
+
362
+
363
+ <span class="summary_desc"><div class='inline'>
364
+ <p>List of peer files (braches).</p>
365
+ </div></span>
366
+
367
+ </li>
368
+
369
+
370
+ </ul>
371
+
372
+
373
+
374
+
375
+
376
+ <h2>
377
+ Class Method Summary
378
+ <small>(<a href="#" class="summary_toggle">collapse</a>)</small>
379
+ </h2>
380
+
381
+ <ul class="summary">
382
+
383
+ <li class="public ">
384
+ <span class="summary_signature">
385
+
386
+ <a href="#abspath-class_method" title="abspath (class method)">+ (String) <strong>abspath</strong>(name, mode) </a>
387
+
388
+
389
+
390
+ </span>
391
+
392
+
393
+
394
+
395
+
396
+
397
+
398
+
399
+
400
+ <span class="summary_desc"><div class='inline'>
401
+ <p>Get absolute path for name.</p>
402
+ </div></span>
403
+
404
+ </li>
405
+
406
+
407
+ <li class="public ">
408
+ <span class="summary_signature">
409
+
410
+ <a href="#add-class_method" title="add (class method)">+ (InOut) <strong>add</strong>(io) </a>
411
+
412
+
413
+
414
+ </span>
415
+
416
+
417
+
418
+
419
+
420
+
421
+
422
+
423
+
424
+ <span class="summary_desc"><div class='inline'>
425
+ <p>Add InOut to filelist.</p>
426
+ </div></span>
427
+
428
+ </li>
429
+
430
+
431
+ <li class="public ">
432
+ <span class="summary_signature">
433
+
434
+ <a href="#create-class_method" title="create (class method)">+ (Read, Write) <strong>create</strong>(name, mode = :read) </a>
435
+
436
+
437
+
438
+ </span>
439
+
440
+
441
+
442
+
443
+
444
+
445
+
446
+
447
+
448
+ <span class="summary_desc"><div class='inline'>
449
+ <p>Create EasyFile object, no open.</p>
450
+ </div></span>
451
+
452
+ </li>
453
+
454
+
455
+ <li class="public ">
456
+ <span class="summary_signature">
457
+
458
+ <a href="#delete-class_method" title="delete (class method)">+ (InOut) <strong>delete</strong>(io) </a>
459
+
460
+
461
+
462
+ </span>
463
+
464
+
465
+
466
+
467
+
468
+
469
+
470
+
471
+
472
+ <span class="summary_desc"><div class='inline'>
473
+ <p>Delete InOut from filelist.</p>
474
+ </div></span>
475
+
476
+ </li>
477
+
478
+
479
+ <li class="public ">
480
+ <span class="summary_signature">
481
+
482
+ <a href="#get-class_method" title="get (class method)">+ (InOut) <strong>get</strong>(io) </a>
483
+
484
+
485
+
486
+ </span>
487
+
488
+
489
+
490
+
491
+
492
+
493
+
494
+
495
+
496
+ <span class="summary_desc"><div class='inline'>
497
+ <p>Get InOut from filelist by InOut handle.</p>
498
+ </div></span>
499
+
500
+ </li>
501
+
502
+
503
+ <li class="public ">
504
+ <span class="summary_signature">
505
+
506
+ <a href="#getByAbsname-class_method" title="getByAbsname (class method)">+ (InOut) <strong>getByAbsname</strong>(absname) </a>
507
+
508
+
509
+
510
+ </span>
511
+
512
+
513
+
514
+
515
+
516
+
517
+
518
+
519
+
520
+ <span class="summary_desc"><div class='inline'>
521
+ <p>Get InOut from filelist by absname.</p>
522
+ </div></span>
523
+
524
+ </li>
525
+
526
+
527
+ <li class="public ">
528
+ <span class="summary_signature">
529
+
530
+ <a href="#getList-class_method" title="getList (class method)">+ (Array&lt;InOut&gt;) <strong>getList</strong> </a>
531
+
532
+
533
+
534
+ </span>
535
+
536
+
537
+
538
+
539
+
540
+
541
+
542
+
543
+
544
+ <span class="summary_desc"><div class='inline'>
545
+ <p>Get EasyFile list.</p>
546
+ </div></span>
547
+
548
+ </li>
549
+
550
+
551
+ <li class="public ">
552
+ <span class="summary_signature">
553
+
554
+ <a href="#open-class_method" title="open (class method)">+ (Read, Write) <strong>open</strong>(name, mode = :read) </a>
555
+
556
+
557
+
558
+ </span>
559
+
560
+
561
+
562
+
563
+
564
+
565
+
566
+
567
+
568
+ <span class="summary_desc"><div class='inline'>
569
+ <p>Create EasyFile object and, open file with given name and mode.</p>
570
+ </div></span>
571
+
572
+ </li>
573
+
574
+
575
+ <li class="public ">
576
+ <span class="summary_signature">
577
+
578
+ <a href="#standard%3F-class_method" title="standard? (class method)">+ (Boolean) <strong>standard?</strong>(name) </a>
579
+
580
+
581
+
582
+ </span>
583
+
584
+
585
+
586
+
587
+
588
+
589
+
590
+
591
+
592
+ <span class="summary_desc"><div class='inline'>
593
+ <p>Is name for standard IO?.</p>
594
+ </div></span>
595
+
596
+ </li>
597
+
598
+
599
+ </ul>
600
+
601
+ <h2>
602
+ Instance Method Summary
603
+ <small>(<a href="#" class="summary_toggle">collapse</a>)</small>
604
+ </h2>
605
+
606
+ <ul class="summary">
607
+
608
+ <li class="public ">
609
+ <span class="summary_signature">
610
+
611
+ <a href="#close-instance_method" title="#close (instance method)">- (Object) <strong>close</strong> </a>
612
+
613
+
614
+
615
+ </span>
616
+
617
+
618
+
619
+
620
+
621
+
622
+
623
+
624
+
625
+ <span class="summary_desc"><div class='inline'>
626
+ <p>Close primary stream and peer streams.</p>
627
+ </div></span>
628
+
629
+ </li>
630
+
631
+
632
+ <li class="public ">
633
+ <span class="summary_signature">
634
+
635
+ <a href="#initialize-instance_method" title="#initialize (instance method)">- (InOut) <strong>initialize</strong>(mode, filename, absname = nil, io = nil) </a>
636
+
637
+
638
+
639
+ </span>
640
+
641
+
642
+ <span class="note title constructor">constructor</span>
643
+
644
+
645
+
646
+
647
+
648
+
649
+
650
+
651
+ <span class="summary_desc"><div class='inline'>
652
+ <p>Create InOut object.</p>
653
+ </div></span>
654
+
655
+ </li>
656
+
657
+
658
+ <li class="public ">
659
+ <span class="summary_signature">
660
+
661
+ <a href="#open-instance_method" title="#open (instance method)">- (Object) <strong>open</strong> </a>
662
+
663
+
664
+
665
+ </span>
666
+
667
+
668
+
669
+
670
+
671
+
672
+
673
+
674
+
675
+ <span class="summary_desc"><div class='inline'>
676
+ <p>Open the stream.</p>
677
+ </div></span>
678
+
679
+ </li>
680
+
681
+
682
+ </ul>
683
+
684
+
685
+ <div id="constructor_details" class="method_details_list">
686
+ <h2>Constructor Details</h2>
687
+
688
+ <div class="method_details first">
689
+ <h3 class="signature first" id="initialize-instance_method">
690
+
691
+ - (<tt><span class='object_link'><a href="" title="EasyFile::InOut (class)">InOut</a></span></tt>) <strong>initialize</strong>(mode, filename, absname = nil, io = nil)
692
+
693
+
694
+
695
+
696
+
697
+ </h3><div class="docstring">
698
+ <div class="discussion">
699
+
700
+ <p>Create InOut object.</p>
701
+
702
+
703
+ </div>
704
+ </div>
705
+ <div class="tags">
706
+ <p class="tag_title">Parameters:</p>
707
+ <ul class="param">
708
+
709
+ <li>
710
+
711
+ <span class='name'>mode</span>
712
+
713
+
714
+ <span class='type'>(<tt>Symbol</tt>)</span>
715
+
716
+
717
+
718
+ &mdash;
719
+ <div class='inline'>
720
+ <p>File operation mode (:read, :write, :string).</p>
721
+ </div>
722
+
723
+ </li>
724
+
725
+ <li>
726
+
727
+ <span class='name'>filename</span>
728
+
729
+
730
+ <span class='type'>(<tt><span class='object_link'><a href="String.html" title="EasyFile::String (class)">String</a></span></tt>)</span>
731
+
732
+
733
+
734
+ &mdash;
735
+ <div class='inline'>
736
+ <p>Relative path file name.</p>
737
+ </div>
738
+
739
+ </li>
740
+
741
+ <li>
742
+
743
+ <span class='name'>absname</span>
744
+
745
+
746
+ <span class='type'>(<tt><span class='object_link'><a href="String.html" title="EasyFile::String (class)">String</a></span></tt>)</span>
747
+
748
+
749
+ <em class="default">(defaults to: <tt>nil</tt>)</em>
750
+
751
+
752
+ &mdash;
753
+ <div class='inline'>
754
+ <p>Absolute path file name (generated if not given).</p>
755
+ </div>
756
+
757
+ </li>
758
+
759
+ <li>
760
+
761
+ <span class='name'>io</span>
762
+
763
+
764
+ <span class='type'>(<tt>IO</tt>)</span>
765
+
766
+
767
+ <em class="default">(defaults to: <tt>nil</tt>)</em>
768
+
769
+
770
+ &mdash;
771
+ <div class='inline'>
772
+ <p>IO handle.</p>
773
+ </div>
774
+
775
+ </li>
776
+
777
+ </ul>
778
+
779
+
780
+ </div><table class="source_code">
781
+ <tr>
782
+ <td>
783
+ <pre class="lines">
784
+
785
+
786
+ 201
787
+ 202
788
+ 203
789
+ 204
790
+ 205
791
+ 206
792
+ 207
793
+ 208
794
+ 209
795
+ 210
796
+ 211
797
+ 212
798
+ 213
799
+ 214
800
+ 215
801
+ 216
802
+ 217
803
+ 218</pre>
804
+ </td>
805
+ <td>
806
+ <pre class="code"><span class="info file"># File 'lib/easyfile.rb', line 201</span>
807
+
808
+ <span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span><span class='lparen'>(</span> <span class='id identifier rubyid_mode'>mode</span><span class='comma'>,</span> <span class='id identifier rubyid_filename'>filename</span><span class='comma'>,</span> <span class='id identifier rubyid_absname'>absname</span> <span class='op'>=</span> <span class='kw'>nil</span><span class='comma'>,</span> <span class='id identifier rubyid_io'>io</span> <span class='op'>=</span> <span class='kw'>nil</span> <span class='rparen'>)</span>
809
+
810
+ <span class='ivar'>@mode</span> <span class='op'>=</span> <span class='id identifier rubyid_mode'>mode</span>
811
+
812
+ <span class='kw'>unless</span> <span class='id identifier rubyid_absname'>absname</span>
813
+ <span class='id identifier rubyid_absname'>absname</span> <span class='op'>=</span> <span class='const'>InOut</span><span class='period'>.</span><span class='id identifier rubyid_abspath'>abspath</span><span class='lparen'>(</span> <span class='id identifier rubyid_filename'>filename</span><span class='comma'>,</span> <span class='id identifier rubyid_mode'>mode</span> <span class='rparen'>)</span>
814
+ <span class='kw'>end</span>
815
+
816
+ <span class='comment'># Set Primary IO.
817
+ </span> <span class='ivar'>@io</span> <span class='op'>=</span> <span class='id identifier rubyid_io'>io</span>
818
+
819
+ <span class='ivar'>@filename</span> <span class='op'>=</span> <span class='id identifier rubyid_filename'>filename</span>
820
+ <span class='ivar'>@absname</span> <span class='op'>=</span> <span class='id identifier rubyid_absname'>absname</span>
821
+
822
+ <span class='ivar'>@peers</span> <span class='op'>=</span> <span class='lbracket'>[</span><span class='rbracket'>]</span>
823
+
824
+ <span class='ivar'>@line</span> <span class='op'>=</span> <span class='int'>0</span>
825
+ <span class='kw'>end</span></pre>
826
+ </td>
827
+ </tr>
828
+ </table>
829
+ </div>
830
+
831
+ </div>
832
+
833
+ <div id="instance_attr_details" class="attr_details">
834
+ <h2>Instance Attribute Details</h2>
835
+
836
+
837
+ <span id=""></span>
838
+ <div class="method_details first">
839
+ <h3 class="signature first" id="absname-instance_method">
840
+
841
+ - (<tt>Object</tt>) <strong>absname</strong> <span class="extras">(readonly)</span>
842
+
843
+
844
+
845
+ <span class="aliases">Also known as:
846
+ <span class="names"><span id='id-instance_method'>id</span></span>
847
+ </span>
848
+
849
+
850
+
851
+ </h3><div class="docstring">
852
+ <div class="discussion">
853
+
854
+ <p>Absolute path name for file.</p>
855
+
856
+
857
+ </div>
858
+ </div>
859
+ <div class="tags">
860
+
861
+
862
+ </div><table class="source_code">
863
+ <tr>
864
+ <td>
865
+ <pre class="lines">
866
+
867
+
868
+ 175
869
+ 176
870
+ 177</pre>
871
+ </td>
872
+ <td>
873
+ <pre class="code"><span class="info file"># File 'lib/easyfile.rb', line 175</span>
874
+
875
+ <span class='kw'>def</span> <span class='id identifier rubyid_absname'>absname</span>
876
+ <span class='ivar'>@absname</span>
877
+ <span class='kw'>end</span></pre>
878
+ </td>
879
+ </tr>
880
+ </table>
881
+ </div>
882
+
883
+
884
+ <span id=""></span>
885
+ <div class="method_details ">
886
+ <h3 class="signature " id="filename-instance_method">
887
+
888
+ - (<tt>Object</tt>) <strong>filename</strong> <span class="extras">(readonly)</span>
889
+
890
+
891
+
892
+
893
+
894
+ </h3><div class="docstring">
895
+ <div class="discussion">
896
+
897
+ <p>Relative path name for file.</p>
898
+
899
+
900
+ </div>
901
+ </div>
902
+ <div class="tags">
903
+
904
+
905
+ </div><table class="source_code">
906
+ <tr>
907
+ <td>
908
+ <pre class="lines">
909
+
910
+
911
+ 172
912
+ 173
913
+ 174</pre>
914
+ </td>
915
+ <td>
916
+ <pre class="code"><span class="info file"># File 'lib/easyfile.rb', line 172</span>
917
+
918
+ <span class='kw'>def</span> <span class='id identifier rubyid_filename'>filename</span>
919
+ <span class='ivar'>@filename</span>
920
+ <span class='kw'>end</span></pre>
921
+ </td>
922
+ </tr>
923
+ </table>
924
+ </div>
925
+
926
+
927
+ <span id="io=-instance_method"></span>
928
+ <div class="method_details ">
929
+ <h3 class="signature " id="io-instance_method">
930
+
931
+ - (<tt>Object</tt>) <strong>io</strong>
932
+
933
+
934
+
935
+
936
+
937
+ </h3><div class="docstring">
938
+ <div class="discussion">
939
+
940
+ <p>IO stream handle.</p>
941
+
942
+
943
+ </div>
944
+ </div>
945
+ <div class="tags">
946
+
947
+
948
+ </div><table class="source_code">
949
+ <tr>
950
+ <td>
951
+ <pre class="lines">
952
+
953
+
954
+ 182
955
+ 183
956
+ 184</pre>
957
+ </td>
958
+ <td>
959
+ <pre class="code"><span class="info file"># File 'lib/easyfile.rb', line 182</span>
960
+
961
+ <span class='kw'>def</span> <span class='id identifier rubyid_io'>io</span>
962
+ <span class='ivar'>@io</span>
963
+ <span class='kw'>end</span></pre>
964
+ </td>
965
+ </tr>
966
+ </table>
967
+ </div>
968
+
969
+
970
+ <span id="line=-instance_method"></span>
971
+ <div class="method_details ">
972
+ <h3 class="signature " id="line-instance_method">
973
+
974
+ - (<tt>Object</tt>) <strong>line</strong>
975
+
976
+
977
+
978
+
979
+
980
+ </h3><div class="docstring">
981
+ <div class="discussion">
982
+
983
+ <p>Current line number (0,1,2...)</p>
984
+
985
+
986
+ </div>
987
+ </div>
988
+ <div class="tags">
989
+
990
+
991
+ </div><table class="source_code">
992
+ <tr>
993
+ <td>
994
+ <pre class="lines">
995
+
996
+
997
+ 191
998
+ 192
999
+ 193</pre>
1000
+ </td>
1001
+ <td>
1002
+ <pre class="code"><span class="info file"># File 'lib/easyfile.rb', line 191</span>
1003
+
1004
+ <span class='kw'>def</span> <span class='id identifier rubyid_line'>line</span>
1005
+ <span class='ivar'>@line</span>
1006
+ <span class='kw'>end</span></pre>
1007
+ </td>
1008
+ </tr>
1009
+ </table>
1010
+ </div>
1011
+
1012
+
1013
+ <span id=""></span>
1014
+ <div class="method_details ">
1015
+ <h3 class="signature " id="mode-instance_method">
1016
+
1017
+ - (<tt>Object</tt>) <strong>mode</strong> <span class="extras">(readonly)</span>
1018
+
1019
+
1020
+
1021
+
1022
+
1023
+ </h3><div class="docstring">
1024
+ <div class="discussion">
1025
+
1026
+ <p>File mode.</p>
1027
+
1028
+
1029
+ </div>
1030
+ </div>
1031
+ <div class="tags">
1032
+
1033
+
1034
+ </div><table class="source_code">
1035
+ <tr>
1036
+ <td>
1037
+ <pre class="lines">
1038
+
1039
+
1040
+ 179
1041
+ 180
1042
+ 181</pre>
1043
+ </td>
1044
+ <td>
1045
+ <pre class="code"><span class="info file"># File 'lib/easyfile.rb', line 179</span>
1046
+
1047
+ <span class='kw'>def</span> <span class='id identifier rubyid_mode'>mode</span>
1048
+ <span class='ivar'>@mode</span>
1049
+ <span class='kw'>end</span></pre>
1050
+ </td>
1051
+ </tr>
1052
+ </table>
1053
+ </div>
1054
+
1055
+
1056
+ <span id="parent=-instance_method"></span>
1057
+ <div class="method_details ">
1058
+ <h3 class="signature " id="parent-instance_method">
1059
+
1060
+ - (<tt>Object</tt>) <strong>parent</strong>
1061
+
1062
+
1063
+
1064
+
1065
+
1066
+ </h3><div class="docstring">
1067
+ <div class="discussion">
1068
+
1069
+ <p>Parent EasyFile (push/pop).</p>
1070
+
1071
+
1072
+ </div>
1073
+ </div>
1074
+ <div class="tags">
1075
+
1076
+
1077
+ </div><table class="source_code">
1078
+ <tr>
1079
+ <td>
1080
+ <pre class="lines">
1081
+
1082
+
1083
+ 185
1084
+ 186
1085
+ 187</pre>
1086
+ </td>
1087
+ <td>
1088
+ <pre class="code"><span class="info file"># File 'lib/easyfile.rb', line 185</span>
1089
+
1090
+ <span class='kw'>def</span> <span class='id identifier rubyid_parent'>parent</span>
1091
+ <span class='ivar'>@parent</span>
1092
+ <span class='kw'>end</span></pre>
1093
+ </td>
1094
+ </tr>
1095
+ </table>
1096
+ </div>
1097
+
1098
+
1099
+ <span id="peers=-instance_method"></span>
1100
+ <div class="method_details ">
1101
+ <h3 class="signature " id="peers-instance_method">
1102
+
1103
+ - (<tt>Object</tt>) <strong>peers</strong>
1104
+
1105
+
1106
+
1107
+
1108
+
1109
+ </h3><div class="docstring">
1110
+ <div class="discussion">
1111
+
1112
+ <p>List of peer files (braches).</p>
1113
+
1114
+
1115
+ </div>
1116
+ </div>
1117
+ <div class="tags">
1118
+
1119
+
1120
+ </div><table class="source_code">
1121
+ <tr>
1122
+ <td>
1123
+ <pre class="lines">
1124
+
1125
+
1126
+ 188
1127
+ 189
1128
+ 190</pre>
1129
+ </td>
1130
+ <td>
1131
+ <pre class="code"><span class="info file"># File 'lib/easyfile.rb', line 188</span>
1132
+
1133
+ <span class='kw'>def</span> <span class='id identifier rubyid_peers'>peers</span>
1134
+ <span class='ivar'>@peers</span>
1135
+ <span class='kw'>end</span></pre>
1136
+ </td>
1137
+ </tr>
1138
+ </table>
1139
+ </div>
1140
+
1141
+ </div>
1142
+
1143
+
1144
+ <div id="class_method_details" class="method_details_list">
1145
+ <h2>Class Method Details</h2>
1146
+
1147
+
1148
+ <div class="method_details first">
1149
+ <h3 class="signature first" id="abspath-class_method">
1150
+
1151
+ + (<tt><span class='object_link'><a href="String.html" title="EasyFile::String (class)">String</a></span></tt>) <strong>abspath</strong>(name, mode)
1152
+
1153
+
1154
+
1155
+
1156
+
1157
+ </h3><div class="docstring">
1158
+ <div class="discussion">
1159
+
1160
+ <p>Get absolute path for name.</p>
1161
+
1162
+
1163
+ </div>
1164
+ </div>
1165
+ <div class="tags">
1166
+ <p class="tag_title">Parameters:</p>
1167
+ <ul class="param">
1168
+
1169
+ <li>
1170
+
1171
+ <span class='name'>name</span>
1172
+
1173
+
1174
+ <span class='type'>(<tt><span class='object_link'><a href="String.html" title="EasyFile::String (class)">String</a></span></tt>)</span>
1175
+
1176
+
1177
+
1178
+ &mdash;
1179
+ <div class='inline'>
1180
+ <p>Relative file name.</p>
1181
+ </div>
1182
+
1183
+ </li>
1184
+
1185
+ </ul>
1186
+
1187
+ <p class="tag_title">Returns:</p>
1188
+ <ul class="return">
1189
+
1190
+ <li>
1191
+
1192
+
1193
+ <span class='type'>(<tt><span class='object_link'><a href="String.html" title="EasyFile::String (class)">String</a></span></tt>)</span>
1194
+
1195
+
1196
+
1197
+ &mdash;
1198
+ <div class='inline'>
1199
+ <p>Absolute path name for the file.</p>
1200
+ </div>
1201
+
1202
+ </li>
1203
+
1204
+ </ul>
1205
+
1206
+ </div><table class="source_code">
1207
+ <tr>
1208
+ <td>
1209
+ <pre class="lines">
1210
+
1211
+
1212
+ 50
1213
+ 51
1214
+ 52
1215
+ 53
1216
+ 54
1217
+ 55
1218
+ 56
1219
+ 57
1220
+ 58</pre>
1221
+ </td>
1222
+ <td>
1223
+ <pre class="code"><span class="info file"># File 'lib/easyfile.rb', line 50</span>
1224
+
1225
+ <span class='kw'>def</span> <span class='const'>InOut</span><span class='period'>.</span><span class='id identifier rubyid_abspath'>abspath</span><span class='lparen'>(</span> <span class='id identifier rubyid_name'>name</span><span class='comma'>,</span> <span class='id identifier rubyid_mode'>mode</span> <span class='rparen'>)</span>
1226
+ <span class='kw'>if</span> <span class='const'>InOut</span><span class='period'>.</span><span class='id identifier rubyid_standard?'>standard?</span><span class='lparen'>(</span> <span class='id identifier rubyid_name'>name</span> <span class='rparen'>)</span>
1227
+ <span class='id identifier rubyid_name'>name</span>
1228
+ <span class='kw'>elsif</span> <span class='id identifier rubyid_mode'>mode</span> <span class='op'>==</span> <span class='symbol'>:string</span>
1229
+ <span class='id identifier rubyid_name'>name</span>
1230
+ <span class='kw'>else</span>
1231
+ <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_name'>name</span> <span class='rparen'>)</span>
1232
+ <span class='kw'>end</span>
1233
+ <span class='kw'>end</span></pre>
1234
+ </td>
1235
+ </tr>
1236
+ </table>
1237
+ </div>
1238
+
1239
+ <div class="method_details ">
1240
+ <h3 class="signature " id="add-class_method">
1241
+
1242
+ + (<tt><span class='object_link'><a href="" title="EasyFile::InOut (class)">InOut</a></span></tt>) <strong>add</strong>(io)
1243
+
1244
+
1245
+
1246
+
1247
+
1248
+ </h3><div class="docstring">
1249
+ <div class="discussion">
1250
+
1251
+ <p>Add InOut to filelist.</p>
1252
+
1253
+
1254
+ </div>
1255
+ </div>
1256
+ <div class="tags">
1257
+ <p class="tag_title">Parameters:</p>
1258
+ <ul class="param">
1259
+
1260
+ <li>
1261
+
1262
+ <span class='name'>io</span>
1263
+
1264
+
1265
+ <span class='type'>(<tt><span class='object_link'><a href="" title="EasyFile::InOut (class)">InOut</a></span></tt>)</span>
1266
+
1267
+
1268
+
1269
+ &mdash;
1270
+ <div class='inline'>
1271
+ <p>Item to list.</p>
1272
+ </div>
1273
+
1274
+ </li>
1275
+
1276
+ </ul>
1277
+
1278
+ <p class="tag_title">Returns:</p>
1279
+ <ul class="return">
1280
+
1281
+ <li>
1282
+
1283
+
1284
+ <span class='type'>(<tt><span class='object_link'><a href="" title="EasyFile::InOut (class)">InOut</a></span></tt>)</span>
1285
+
1286
+
1287
+
1288
+ &mdash;
1289
+ <div class='inline'>
1290
+ <p>Added item.</p>
1291
+ </div>
1292
+
1293
+ </li>
1294
+
1295
+ </ul>
1296
+
1297
+ </div><table class="source_code">
1298
+ <tr>
1299
+ <td>
1300
+ <pre class="lines">
1301
+
1302
+
1303
+ 130
1304
+ 131
1305
+ 132</pre>
1306
+ </td>
1307
+ <td>
1308
+ <pre class="code"><span class="info file"># File 'lib/easyfile.rb', line 130</span>
1309
+
1310
+ <span class='kw'>def</span> <span class='const'>InOut</span><span class='period'>.</span><span class='id identifier rubyid_add'>add</span><span class='lparen'>(</span> <span class='id identifier rubyid_io'>io</span> <span class='rparen'>)</span>
1311
+ <span class='cvar'>@@file_io</span><span class='lbracket'>[</span> <span class='id identifier rubyid_io'>io</span><span class='period'>.</span><span class='id identifier rubyid_absname'>absname</span> <span class='rbracket'>]</span> <span class='op'>=</span> <span class='id identifier rubyid_io'>io</span>
1312
+ <span class='kw'>end</span></pre>
1313
+ </td>
1314
+ </tr>
1315
+ </table>
1316
+ </div>
1317
+
1318
+ <div class="method_details ">
1319
+ <h3 class="signature " id="create-class_method">
1320
+
1321
+ + (<tt><span class='object_link'><a href="Read.html" title="EasyFile::Read (class)">Read</a></span></tt>, <tt><span class='object_link'><a href="Write.html" title="EasyFile::Write (class)">Write</a></span></tt>) <strong>create</strong>(name, mode = :read)
1322
+
1323
+
1324
+
1325
+
1326
+
1327
+ </h3><div class="docstring">
1328
+ <div class="discussion">
1329
+
1330
+ <p>Create EasyFile object, no open. Open is performed separately.</p>
1331
+
1332
+
1333
+ </div>
1334
+ </div>
1335
+ <div class="tags">
1336
+ <p class="tag_title">Parameters:</p>
1337
+ <ul class="param">
1338
+
1339
+ <li>
1340
+
1341
+ <span class='name'>name</span>
1342
+
1343
+
1344
+ <span class='type'>(<tt><span class='object_link'><a href="String.html" title="EasyFile::String (class)">String</a></span></tt>)</span>
1345
+
1346
+
1347
+
1348
+ &mdash;
1349
+ <div class='inline'>
1350
+ <p>Relative path name for file.</p>
1351
+ </div>
1352
+
1353
+ </li>
1354
+
1355
+ <li>
1356
+
1357
+ <span class='name'>mode</span>
1358
+
1359
+
1360
+ <span class='type'>(<tt>Symbol</tt>)</span>
1361
+
1362
+
1363
+ <em class="default">(defaults to: <tt>:read</tt>)</em>
1364
+
1365
+
1366
+ &mdash;
1367
+ <div class='inline'>
1368
+ <p>Access direction (:read/:write).</p>
1369
+ </div>
1370
+
1371
+ </li>
1372
+
1373
+ </ul>
1374
+
1375
+ <p class="tag_title">Returns:</p>
1376
+ <ul class="return">
1377
+
1378
+ <li>
1379
+
1380
+
1381
+ <span class='type'>(<tt><span class='object_link'><a href="Read.html" title="EasyFile::Read (class)">Read</a></span></tt>, <tt><span class='object_link'><a href="Write.html" title="EasyFile::Write (class)">Write</a></span></tt>)</span>
1382
+
1383
+
1384
+
1385
+ &mdash;
1386
+ <div class='inline'>
1387
+ <p>EasyFile handle to non-opened file (use “open”).</p>
1388
+ </div>
1389
+
1390
+ </li>
1391
+
1392
+ </ul>
1393
+
1394
+ </div><table class="source_code">
1395
+ <tr>
1396
+ <td>
1397
+ <pre class="lines">
1398
+
1399
+
1400
+ 93
1401
+ 94
1402
+ 95
1403
+ 96
1404
+ 97
1405
+ 98
1406
+ 99
1407
+ 100
1408
+ 101
1409
+ 102
1410
+ 103
1411
+ 104
1412
+ 105
1413
+ 106
1414
+ 107
1415
+ 108
1416
+ 109
1417
+ 110
1418
+ 111
1419
+ 112
1420
+ 113
1421
+ 114
1422
+ 115
1423
+ 116
1424
+ 117
1425
+ 118
1426
+ 119
1427
+ 120
1428
+ 121
1429
+ 122
1430
+ 123</pre>
1431
+ </td>
1432
+ <td>
1433
+ <pre class="code"><span class="info file"># File 'lib/easyfile.rb', line 93</span>
1434
+
1435
+ <span class='kw'>def</span> <span class='const'>InOut</span><span class='period'>.</span><span class='id identifier rubyid_create'>create</span><span class='lparen'>(</span> <span class='id identifier rubyid_name'>name</span><span class='comma'>,</span> <span class='id identifier rubyid_mode'>mode</span> <span class='op'>=</span> <span class='symbol'>:read</span> <span class='rparen'>)</span>
1436
+
1437
+ <span class='id identifier rubyid_absname'>absname</span> <span class='op'>=</span> <span class='const'>InOut</span><span class='period'>.</span><span class='id identifier rubyid_abspath'>abspath</span><span class='lparen'>(</span> <span class='id identifier rubyid_name'>name</span><span class='comma'>,</span> <span class='id identifier rubyid_mode'>mode</span> <span class='rparen'>)</span>
1438
+
1439
+ <span class='comment'># Check if file exists already.
1440
+ </span> <span class='id identifier rubyid_file'>file</span> <span class='op'>=</span> <span class='const'>InOut</span><span class='period'>.</span><span class='id identifier rubyid_getByAbsname'>getByAbsname</span><span class='lparen'>(</span> <span class='id identifier rubyid_absname'>absname</span> <span class='rparen'>)</span>
1441
+
1442
+ <span class='kw'>if</span> <span class='id identifier rubyid_file'>file</span>
1443
+
1444
+ <span class='id identifier rubyid_file'>file</span>
1445
+
1446
+ <span class='kw'>else</span>
1447
+
1448
+ <span class='kw'>if</span> <span class='id identifier rubyid_mode'>mode</span> <span class='op'>==</span> <span class='symbol'>:read</span>
1449
+ <span class='comment'># file = Read.new( name, absname )
1450
+ </span> <span class='id identifier rubyid_file'>file</span> <span class='op'>=</span> <span class='const'>Read</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span> <span class='id identifier rubyid_name'>name</span><span class='comma'>,</span> <span class='id identifier rubyid_absname'>absname</span> <span class='rparen'>)</span>
1451
+ <span class='kw'>elsif</span> <span class='id identifier rubyid_mode'>mode</span> <span class='op'>==</span> <span class='symbol'>:write</span>
1452
+ <span class='id identifier rubyid_file'>file</span> <span class='op'>=</span> <span class='const'>Write</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span> <span class='id identifier rubyid_name'>name</span><span class='comma'>,</span> <span class='id identifier rubyid_absname'>absname</span> <span class='rparen'>)</span>
1453
+ <span class='kw'>elsif</span> <span class='id identifier rubyid_mode'>mode</span> <span class='op'>==</span> <span class='symbol'>:string</span>
1454
+ <span class='id identifier rubyid_file'>file</span> <span class='op'>=</span> <span class='const'>String</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span> <span class='id identifier rubyid_name'>name</span><span class='comma'>,</span> <span class='id identifier rubyid_absname'>absname</span> <span class='rparen'>)</span>
1455
+ <span class='kw'>else</span>
1456
+ <span class='id identifier rubyid_raise'>raise</span> <span class='const'>RuntimeError</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>Unknown file mode \&quot;</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_mode'>mode</span><span class='period'>.</span><span class='id identifier rubyid_to_s'>to_s</span><span class='rbrace'>}</span><span class='tstring_content'>\&quot;...</span><span class='tstring_end'>&quot;</span></span>
1457
+ <span class='kw'>end</span>
1458
+
1459
+ <span class='const'>InOut</span><span class='period'>.</span><span class='id identifier rubyid_add'>add</span><span class='lparen'>(</span> <span class='id identifier rubyid_file'>file</span> <span class='rparen'>)</span>
1460
+
1461
+ <span class='kw'>end</span>
1462
+
1463
+ <span class='id identifier rubyid_file'>file</span>
1464
+
1465
+ <span class='kw'>end</span></pre>
1466
+ </td>
1467
+ </tr>
1468
+ </table>
1469
+ </div>
1470
+
1471
+ <div class="method_details ">
1472
+ <h3 class="signature " id="delete-class_method">
1473
+
1474
+ + (<tt><span class='object_link'><a href="" title="EasyFile::InOut (class)">InOut</a></span></tt>) <strong>delete</strong>(io)
1475
+
1476
+
1477
+
1478
+
1479
+
1480
+ </h3><div class="docstring">
1481
+ <div class="discussion">
1482
+
1483
+ <p>Delete InOut from filelist.</p>
1484
+
1485
+
1486
+ </div>
1487
+ </div>
1488
+ <div class="tags">
1489
+ <p class="tag_title">Parameters:</p>
1490
+ <ul class="param">
1491
+
1492
+ <li>
1493
+
1494
+ <span class='name'>io</span>
1495
+
1496
+
1497
+ <span class='type'>(<tt><span class='object_link'><a href="" title="EasyFile::InOut (class)">InOut</a></span></tt>)</span>
1498
+
1499
+
1500
+
1501
+ &mdash;
1502
+ <div class='inline'>
1503
+ <p>Item to list.</p>
1504
+ </div>
1505
+
1506
+ </li>
1507
+
1508
+ </ul>
1509
+
1510
+ <p class="tag_title">Returns:</p>
1511
+ <ul class="return">
1512
+
1513
+ <li>
1514
+
1515
+
1516
+ <span class='type'>(<tt><span class='object_link'><a href="" title="EasyFile::InOut (class)">InOut</a></span></tt>)</span>
1517
+
1518
+
1519
+
1520
+ &mdash;
1521
+ <div class='inline'>
1522
+ <p>Added item.</p>
1523
+ </div>
1524
+
1525
+ </li>
1526
+
1527
+ </ul>
1528
+
1529
+ </div><table class="source_code">
1530
+ <tr>
1531
+ <td>
1532
+ <pre class="lines">
1533
+
1534
+
1535
+ 139
1536
+ 140
1537
+ 141</pre>
1538
+ </td>
1539
+ <td>
1540
+ <pre class="code"><span class="info file"># File 'lib/easyfile.rb', line 139</span>
1541
+
1542
+ <span class='kw'>def</span> <span class='const'>InOut</span><span class='period'>.</span><span class='id identifier rubyid_delete'>delete</span><span class='lparen'>(</span> <span class='id identifier rubyid_io'>io</span> <span class='rparen'>)</span>
1543
+ <span class='cvar'>@@file_io</span><span class='period'>.</span><span class='id identifier rubyid_delete'>delete</span><span class='lparen'>(</span> <span class='id identifier rubyid_io'>io</span><span class='period'>.</span><span class='id identifier rubyid_absname'>absname</span> <span class='rparen'>)</span>
1544
+ <span class='kw'>end</span></pre>
1545
+ </td>
1546
+ </tr>
1547
+ </table>
1548
+ </div>
1549
+
1550
+ <div class="method_details ">
1551
+ <h3 class="signature " id="get-class_method">
1552
+
1553
+ + (<tt><span class='object_link'><a href="" title="EasyFile::InOut (class)">InOut</a></span></tt>) <strong>get</strong>(io)
1554
+
1555
+
1556
+
1557
+
1558
+
1559
+ </h3><div class="docstring">
1560
+ <div class="discussion">
1561
+
1562
+ <p>Get InOut from filelist by InOut handle.</p>
1563
+
1564
+
1565
+ </div>
1566
+ </div>
1567
+ <div class="tags">
1568
+ <p class="tag_title">Parameters:</p>
1569
+ <ul class="param">
1570
+
1571
+ <li>
1572
+
1573
+ <span class='name'>io</span>
1574
+
1575
+
1576
+ <span class='type'>(<tt><span class='object_link'><a href="" title="EasyFile::InOut (class)">InOut</a></span></tt>)</span>
1577
+
1578
+
1579
+
1580
+ &mdash;
1581
+ <div class='inline'>
1582
+ <p>Item handle.</p>
1583
+ </div>
1584
+
1585
+ </li>
1586
+
1587
+ </ul>
1588
+
1589
+ <p class="tag_title">Returns:</p>
1590
+ <ul class="return">
1591
+
1592
+ <li>
1593
+
1594
+
1595
+ <span class='type'>(<tt><span class='object_link'><a href="" title="EasyFile::InOut (class)">InOut</a></span></tt>)</span>
1596
+
1597
+
1598
+
1599
+ &mdash;
1600
+ <div class='inline'>
1601
+ <p>Added item.</p>
1602
+ </div>
1603
+
1604
+ </li>
1605
+
1606
+ </ul>
1607
+
1608
+ </div><table class="source_code">
1609
+ <tr>
1610
+ <td>
1611
+ <pre class="lines">
1612
+
1613
+
1614
+ 148
1615
+ 149
1616
+ 150</pre>
1617
+ </td>
1618
+ <td>
1619
+ <pre class="code"><span class="info file"># File 'lib/easyfile.rb', line 148</span>
1620
+
1621
+ <span class='kw'>def</span> <span class='const'>InOut</span><span class='period'>.</span><span class='id identifier rubyid_get'>get</span><span class='lparen'>(</span> <span class='id identifier rubyid_io'>io</span> <span class='rparen'>)</span>
1622
+ <span class='cvar'>@@file_io</span><span class='period'>.</span><span class='id identifier rubyid_getByAbsname'>getByAbsname</span><span class='lparen'>(</span> <span class='id identifier rubyid_io'>io</span><span class='period'>.</span><span class='id identifier rubyid_absname'>absname</span> <span class='rparen'>)</span>
1623
+ <span class='kw'>end</span></pre>
1624
+ </td>
1625
+ </tr>
1626
+ </table>
1627
+ </div>
1628
+
1629
+ <div class="method_details ">
1630
+ <h3 class="signature " id="getByAbsname-class_method">
1631
+
1632
+ + (<tt><span class='object_link'><a href="" title="EasyFile::InOut (class)">InOut</a></span></tt>) <strong>getByAbsname</strong>(absname)
1633
+
1634
+
1635
+
1636
+
1637
+
1638
+ </h3><div class="docstring">
1639
+ <div class="discussion">
1640
+
1641
+ <p>Get InOut from filelist by absname.</p>
1642
+
1643
+
1644
+ </div>
1645
+ </div>
1646
+ <div class="tags">
1647
+ <p class="tag_title">Parameters:</p>
1648
+ <ul class="param">
1649
+
1650
+ <li>
1651
+
1652
+ <span class='name'>absname</span>
1653
+
1654
+
1655
+ <span class='type'>(<tt><span class='object_link'><a href="" title="EasyFile::InOut (class)">InOut</a></span></tt>)</span>
1656
+
1657
+
1658
+
1659
+ &mdash;
1660
+ <div class='inline'>
1661
+ <p>Item absname.</p>
1662
+ </div>
1663
+
1664
+ </li>
1665
+
1666
+ </ul>
1667
+
1668
+ <p class="tag_title">Returns:</p>
1669
+ <ul class="return">
1670
+
1671
+ <li>
1672
+
1673
+
1674
+ <span class='type'>(<tt><span class='object_link'><a href="" title="EasyFile::InOut (class)">InOut</a></span></tt>)</span>
1675
+
1676
+
1677
+
1678
+ &mdash;
1679
+ <div class='inline'>
1680
+ <p>Added item.</p>
1681
+ </div>
1682
+
1683
+ </li>
1684
+
1685
+ </ul>
1686
+
1687
+ </div><table class="source_code">
1688
+ <tr>
1689
+ <td>
1690
+ <pre class="lines">
1691
+
1692
+
1693
+ 157
1694
+ 158
1695
+ 159</pre>
1696
+ </td>
1697
+ <td>
1698
+ <pre class="code"><span class="info file"># File 'lib/easyfile.rb', line 157</span>
1699
+
1700
+ <span class='kw'>def</span> <span class='const'>InOut</span><span class='period'>.</span><span class='id identifier rubyid_getByAbsname'>getByAbsname</span><span class='lparen'>(</span> <span class='id identifier rubyid_absname'>absname</span> <span class='rparen'>)</span>
1701
+ <span class='cvar'>@@file_io</span><span class='lbracket'>[</span> <span class='id identifier rubyid_absname'>absname</span> <span class='rbracket'>]</span>
1702
+ <span class='kw'>end</span></pre>
1703
+ </td>
1704
+ </tr>
1705
+ </table>
1706
+ </div>
1707
+
1708
+ <div class="method_details ">
1709
+ <h3 class="signature " id="getList-class_method">
1710
+
1711
+ + (<tt>Array&lt;<span class='object_link'><a href="" title="EasyFile::InOut (class)">InOut</a></span>&gt;</tt>) <strong>getList</strong>
1712
+
1713
+
1714
+
1715
+
1716
+
1717
+ </h3><div class="docstring">
1718
+ <div class="discussion">
1719
+
1720
+ <p>Get EasyFile list.</p>
1721
+
1722
+
1723
+ </div>
1724
+ </div>
1725
+ <div class="tags">
1726
+
1727
+ <p class="tag_title">Returns:</p>
1728
+ <ul class="return">
1729
+
1730
+ <li>
1731
+
1732
+
1733
+ <span class='type'>(<tt>Array&lt;<span class='object_link'><a href="" title="EasyFile::InOut (class)">InOut</a></span>&gt;</tt>)</span>
1734
+
1735
+
1736
+
1737
+ &mdash;
1738
+ <div class='inline'>
1739
+ <p>List of all files.</p>
1740
+ </div>
1741
+
1742
+ </li>
1743
+
1744
+ </ul>
1745
+
1746
+ </div><table class="source_code">
1747
+ <tr>
1748
+ <td>
1749
+ <pre class="lines">
1750
+
1751
+
1752
+ 165
1753
+ 166
1754
+ 167</pre>
1755
+ </td>
1756
+ <td>
1757
+ <pre class="code"><span class="info file"># File 'lib/easyfile.rb', line 165</span>
1758
+
1759
+ <span class='kw'>def</span> <span class='const'>InOut</span><span class='period'>.</span><span class='id identifier rubyid_getList'>getList</span>
1760
+ <span class='cvar'>@@file_io</span><span class='period'>.</span><span class='id identifier rubyid_values'>values</span>
1761
+ <span class='kw'>end</span></pre>
1762
+ </td>
1763
+ </tr>
1764
+ </table>
1765
+ </div>
1766
+
1767
+ <div class="method_details ">
1768
+ <h3 class="signature " id="open-class_method">
1769
+
1770
+ + (<tt><span class='object_link'><a href="Read.html" title="EasyFile::Read (class)">Read</a></span></tt>, <tt><span class='object_link'><a href="Write.html" title="EasyFile::Write (class)">Write</a></span></tt>) <strong>open</strong>(name, mode = :read)
1771
+
1772
+
1773
+
1774
+
1775
+
1776
+ </h3><div class="docstring">
1777
+ <div class="discussion">
1778
+
1779
+ <p>Create EasyFile object and, open file with given name and mode.</p>
1780
+
1781
+
1782
+ </div>
1783
+ </div>
1784
+ <div class="tags">
1785
+ <p class="tag_title">Parameters:</p>
1786
+ <ul class="param">
1787
+
1788
+ <li>
1789
+
1790
+ <span class='name'>name</span>
1791
+
1792
+
1793
+ <span class='type'>(<tt><span class='object_link'><a href="String.html" title="EasyFile::String (class)">String</a></span></tt>)</span>
1794
+
1795
+
1796
+
1797
+ &mdash;
1798
+ <div class='inline'>
1799
+ <p>Relative path name for file.</p>
1800
+ </div>
1801
+
1802
+ </li>
1803
+
1804
+ <li>
1805
+
1806
+ <span class='name'>mode</span>
1807
+
1808
+
1809
+ <span class='type'>(<tt>Symbol</tt>)</span>
1810
+
1811
+
1812
+ <em class="default">(defaults to: <tt>:read</tt>)</em>
1813
+
1814
+
1815
+ &mdash;
1816
+ <div class='inline'>
1817
+ <p>Access direction (:read/:write).</p>
1818
+ </div>
1819
+
1820
+ </li>
1821
+
1822
+ </ul>
1823
+
1824
+ <p class="tag_title">Returns:</p>
1825
+ <ul class="return">
1826
+
1827
+ <li>
1828
+
1829
+
1830
+ <span class='type'>(<tt><span class='object_link'><a href="Read.html" title="EasyFile::Read (class)">Read</a></span></tt>, <tt><span class='object_link'><a href="Write.html" title="EasyFile::Write (class)">Write</a></span></tt>)</span>
1831
+
1832
+
1833
+
1834
+ &mdash;
1835
+ <div class='inline'>
1836
+ <p>EasyFile handle.</p>
1837
+ </div>
1838
+
1839
+ </li>
1840
+
1841
+ </ul>
1842
+
1843
+ </div><table class="source_code">
1844
+ <tr>
1845
+ <td>
1846
+ <pre class="lines">
1847
+
1848
+
1849
+ 79
1850
+ 80
1851
+ 81
1852
+ 82
1853
+ 83</pre>
1854
+ </td>
1855
+ <td>
1856
+ <pre class="code"><span class="info file"># File 'lib/easyfile.rb', line 79</span>
1857
+
1858
+ <span class='kw'>def</span> <span class='const'>InOut</span><span class='period'>.</span><span class='id identifier rubyid_open'>open</span><span class='lparen'>(</span> <span class='id identifier rubyid_name'>name</span><span class='comma'>,</span> <span class='id identifier rubyid_mode'>mode</span> <span class='op'>=</span> <span class='symbol'>:read</span> <span class='rparen'>)</span>
1859
+ <span class='id identifier rubyid_file'>file</span> <span class='op'>=</span> <span class='const'>InOut</span><span class='period'>.</span><span class='id identifier rubyid_create'>create</span><span class='lparen'>(</span> <span class='id identifier rubyid_name'>name</span><span class='comma'>,</span> <span class='id identifier rubyid_mode'>mode</span> <span class='rparen'>)</span>
1860
+ <span class='id identifier rubyid_file'>file</span><span class='period'>.</span><span class='id identifier rubyid_open'>open</span>
1861
+ <span class='id identifier rubyid_file'>file</span>
1862
+ <span class='kw'>end</span></pre>
1863
+ </td>
1864
+ </tr>
1865
+ </table>
1866
+ </div>
1867
+
1868
+ <div class="method_details ">
1869
+ <h3 class="signature " id="standard?-class_method">
1870
+
1871
+ + (<tt>Boolean</tt>) <strong>standard?</strong>(name)
1872
+
1873
+
1874
+
1875
+
1876
+
1877
+ </h3><div class="docstring">
1878
+ <div class="discussion">
1879
+
1880
+ <p>Is name for standard IO?</p>
1881
+
1882
+
1883
+ </div>
1884
+ </div>
1885
+ <div class="tags">
1886
+ <p class="tag_title">Parameters:</p>
1887
+ <ul class="param">
1888
+
1889
+ <li>
1890
+
1891
+ <span class='name'>name</span>
1892
+
1893
+
1894
+ <span class='type'>(<tt><span class='object_link'><a href="String.html" title="EasyFile::String (class)">String</a></span></tt>)</span>
1895
+
1896
+
1897
+
1898
+ &mdash;
1899
+ <div class='inline'>
1900
+ <p>Relative file name.</p>
1901
+ </div>
1902
+
1903
+ </li>
1904
+
1905
+ </ul>
1906
+
1907
+ <p class="tag_title">Returns:</p>
1908
+ <ul class="return">
1909
+
1910
+ <li>
1911
+
1912
+
1913
+ <span class='type'>(<tt>Boolean</tt>)</span>
1914
+
1915
+
1916
+
1917
+ </li>
1918
+
1919
+ </ul>
1920
+
1921
+ </div><table class="source_code">
1922
+ <tr>
1923
+ <td>
1924
+ <pre class="lines">
1925
+
1926
+
1927
+ 63
1928
+ 64
1929
+ 65
1930
+ 66
1931
+ 67
1932
+ 68
1933
+ 69
1934
+ 70</pre>
1935
+ </td>
1936
+ <td>
1937
+ <pre class="code"><span class="info file"># File 'lib/easyfile.rb', line 63</span>
1938
+
1939
+ <span class='kw'>def</span> <span class='const'>InOut</span><span class='period'>.</span><span class='id identifier rubyid_standard?'>standard?</span><span class='lparen'>(</span> <span class='id identifier rubyid_name'>name</span> <span class='rparen'>)</span>
1940
+ <span class='kw'>case</span> <span class='id identifier rubyid_name'>name</span>
1941
+ <span class='kw'>when</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>&lt;STDIN&gt;</span><span class='tstring_end'>&quot;</span></span><span class='semicolon'>;</span> <span class='kw'>true</span>
1942
+ <span class='kw'>when</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>&lt;STDOUT&gt;</span><span class='tstring_end'>&quot;</span></span><span class='semicolon'>;</span> <span class='kw'>true</span>
1943
+ <span class='kw'>when</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>&lt;STDERR&gt;</span><span class='tstring_end'>&quot;</span></span><span class='semicolon'>;</span> <span class='kw'>true</span>
1944
+ <span class='kw'>else</span> <span class='kw'>false</span>
1945
+ <span class='kw'>end</span>
1946
+ <span class='kw'>end</span></pre>
1947
+ </td>
1948
+ </tr>
1949
+ </table>
1950
+ </div>
1951
+
1952
+ </div>
1953
+
1954
+ <div id="instance_method_details" class="method_details_list">
1955
+ <h2>Instance Method Details</h2>
1956
+
1957
+
1958
+ <div class="method_details first">
1959
+ <h3 class="signature first" id="close-instance_method">
1960
+
1961
+ - (<tt>Object</tt>) <strong>close</strong>
1962
+
1963
+
1964
+
1965
+
1966
+
1967
+ </h3><div class="docstring">
1968
+ <div class="discussion">
1969
+
1970
+ <p>Close primary stream and peer streams.</p>
1971
+
1972
+
1973
+ </div>
1974
+ </div>
1975
+ <div class="tags">
1976
+
1977
+
1978
+ </div><table class="source_code">
1979
+ <tr>
1980
+ <td>
1981
+ <pre class="lines">
1982
+
1983
+
1984
+ 240
1985
+ 241
1986
+ 242
1987
+ 243
1988
+ 244
1989
+ 245
1990
+ 246
1991
+ 247
1992
+ 248
1993
+ 249
1994
+ 250
1995
+ 251
1996
+ 252
1997
+ 253</pre>
1998
+ </td>
1999
+ <td>
2000
+ <pre class="code"><span class="info file"># File 'lib/easyfile.rb', line 240</span>
2001
+
2002
+ <span class='kw'>def</span> <span class='id identifier rubyid_close'>close</span>
2003
+
2004
+ <span class='kw'>begin</span>
2005
+ <span class='kw'>unless</span> <span class='const'>InOut</span><span class='period'>.</span><span class='id identifier rubyid_standard?'>standard?</span><span class='lparen'>(</span> <span class='ivar'>@filename</span> <span class='rparen'>)</span>
2006
+ <span class='ivar'>@io</span><span class='period'>.</span><span class='id identifier rubyid_close'>close</span> <span class='kw'>if</span> <span class='ivar'>@io</span>
2007
+ <span class='const'>InOut</span><span class='period'>.</span><span class='id identifier rubyid_delete'>delete</span><span class='lparen'>(</span> <span class='kw'>self</span> <span class='rparen'>)</span>
2008
+ <span class='kw'>end</span>
2009
+ <span class='kw'>rescue</span> <span class='const'>IOError</span>
2010
+ <span class='kw'>end</span>
2011
+
2012
+ <span class='ivar'>@peers</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_i'>i</span><span class='op'>|</span>
2013
+ <span class='id identifier rubyid_i'>i</span><span class='period'>.</span><span class='id identifier rubyid_close'>close</span>
2014
+ <span class='kw'>end</span>
2015
+ <span class='kw'>end</span></pre>
2016
+ </td>
2017
+ </tr>
2018
+ </table>
2019
+ </div>
2020
+
2021
+ <div class="method_details ">
2022
+ <h3 class="signature " id="open-instance_method">
2023
+
2024
+ - (<tt>Object</tt>) <strong>open</strong>
2025
+
2026
+
2027
+
2028
+
2029
+
2030
+ </h3><div class="docstring">
2031
+ <div class="discussion">
2032
+
2033
+ <p>Open the stream.</p>
2034
+
2035
+
2036
+ </div>
2037
+ </div>
2038
+ <div class="tags">
2039
+
2040
+
2041
+ </div><table class="source_code">
2042
+ <tr>
2043
+ <td>
2044
+ <pre class="lines">
2045
+
2046
+
2047
+ 222
2048
+ 223
2049
+ 224
2050
+ 225
2051
+ 226
2052
+ 227
2053
+ 228
2054
+ 229
2055
+ 230
2056
+ 231
2057
+ 232
2058
+ 233
2059
+ 234
2060
+ 235
2061
+ 236</pre>
2062
+ </td>
2063
+ <td>
2064
+ <pre class="code"><span class="info file"># File 'lib/easyfile.rb', line 222</span>
2065
+
2066
+ <span class='kw'>def</span> <span class='id identifier rubyid_open'>open</span>
2067
+
2068
+ <span class='comment'># Ensure single open.
2069
+ </span> <span class='kw'>return</span> <span class='kw'>if</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_io'>io</span>
2070
+
2071
+ <span class='kw'>if</span> <span class='id identifier rubyid_mode'>mode</span> <span class='op'>==</span> <span class='symbol'>:string</span>
2072
+ <span class='id identifier rubyid_handle'>handle</span> <span class='op'>=</span> <span class='const'>StringIO</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span>
2073
+ <span class='kw'>else</span>
2074
+ <span class='id identifier rubyid_handle'>handle</span> <span class='op'>=</span> <span class='const'>File</span><span class='period'>.</span><span class='id identifier rubyid_open'>open</span><span class='lparen'>(</span> <span class='ivar'>@absname</span><span class='comma'>,</span> <span class='const'>FILEMODEMAP</span><span class='lbracket'>[</span> <span class='id identifier rubyid_mode'>mode</span> <span class='rbracket'>]</span> <span class='rparen'>)</span>
2075
+ <span class='kw'>end</span>
2076
+
2077
+ <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_io'>io</span> <span class='op'>=</span> <span class='id identifier rubyid_handle'>handle</span>
2078
+
2079
+ <span class='kw'>self</span>
2080
+ <span class='kw'>end</span></pre>
2081
+ </td>
2082
+ </tr>
2083
+ </table>
2084
+ </div>
2085
+
2086
+ </div>
2087
+
2088
+ </div>
2089
+
2090
+ <div id="footer">
2091
+ Generated on Wed Jan 15 19:29:45 2014 by
2092
+ <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
2093
+ 0.8.6.1 (ruby-1.9.3).
2094
+ </div>
2095
+
2096
+ </body>
2097
+ </html>