mucgly 0.0.1

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.
@@ -0,0 +1,1334 @@
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::Read
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 (R)</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">Read</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::Read
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"><span class='object_link'><a href="InOut.html" title="EasyFile::InOut (class)">InOut</a></span></span>
77
+
78
+ <ul class="fullTree">
79
+ <li>Object</li>
80
+
81
+ <li class="next"><span class='object_link'><a href="InOut.html" title="EasyFile::InOut (class)">InOut</a></span></li>
82
+
83
+ <li class="next">EasyFile::Read</li>
84
+
85
+ </ul>
86
+ <a href="#" class="inheritanceTree">show all</a>
87
+
88
+ </dd>
89
+
90
+
91
+
92
+
93
+
94
+
95
+
96
+
97
+
98
+ <dt class="r2 last">Defined in:</dt>
99
+ <dd class="r2 last">lib/easyfile.rb</dd>
100
+
101
+ </dl>
102
+ <div class="clear"></div>
103
+
104
+ <h2>Overview</h2><div class="docstring">
105
+ <div class="discussion">
106
+
107
+ <p>Read file.</p>
108
+
109
+ <p>Features:</p>
110
+ <ul><li>
111
+ <p>Line counting.</p>
112
+ </li><li>
113
+ <p>Put-back char support.</p>
114
+ </li></ul>
115
+
116
+
117
+ </div>
118
+ </div>
119
+ <div class="tags">
120
+
121
+
122
+ </div>
123
+ <h2>Constant Summary</h2>
124
+
125
+
126
+
127
+
128
+ <h2>Constant Summary</h2>
129
+
130
+ <h3 class="inherited">Constants inherited
131
+ from <span class='object_link'><a href="InOut.html" title="EasyFile::InOut (class)">InOut</a></span></h3>
132
+ <p class="inherited"><span class='object_link'><a href="InOut.html#FILEMODEMAP-constant" title="EasyFile::InOut::FILEMODEMAP (constant)">InOut::FILEMODEMAP</a></span></p>
133
+
134
+
135
+
136
+
137
+ <h2>Instance Attribute Summary</h2>
138
+
139
+ <h3 class="inherited">Attributes inherited from <span class='object_link'><a href="InOut.html" title="EasyFile::InOut (class)">InOut</a></span></h3>
140
+ <p class="inherited"><span class='object_link'><a href="InOut.html#absname-instance_method" title="EasyFile::InOut#absname (method)">#absname</a></span>, <span class='object_link'><a href="InOut.html#filename-instance_method" title="EasyFile::InOut#filename (method)">#filename</a></span>, <span class='object_link'><a href="InOut.html#io-instance_method" title="EasyFile::InOut#io (method)">#io</a></span>, <span class='object_link'><a href="InOut.html#line-instance_method" title="EasyFile::InOut#line (method)">#line</a></span>, <span class='object_link'><a href="InOut.html#mode-instance_method" title="EasyFile::InOut#mode (method)">#mode</a></span>, <span class='object_link'><a href="InOut.html#parent-instance_method" title="EasyFile::InOut#parent (method)">#parent</a></span>, <span class='object_link'><a href="InOut.html#peers-instance_method" title="EasyFile::InOut#peers (method)">#peers</a></span></p>
141
+
142
+
143
+
144
+ <h2>
145
+ Class Method Summary
146
+ <small>(<a href="#" class="summary_toggle">collapse</a>)</small>
147
+ </h2>
148
+
149
+ <ul class="summary">
150
+
151
+ <li class="public ">
152
+ <span class="summary_signature">
153
+
154
+ <a href="#open-class_method" title="open (class method)">+ (Read) <strong>open</strong>(name) </a>
155
+
156
+
157
+
158
+ </span>
159
+
160
+
161
+
162
+
163
+
164
+
165
+
166
+
167
+
168
+ <span class="summary_desc"><div class='inline'>
169
+ <p>Create EasyFile::Read object and, open file with given name.</p>
170
+ </div></span>
171
+
172
+ </li>
173
+
174
+
175
+ </ul>
176
+
177
+ <h2>
178
+ Instance Method Summary
179
+ <small>(<a href="#" class="summary_toggle">collapse</a>)</small>
180
+ </h2>
181
+
182
+ <ul class="summary">
183
+
184
+ <li class="public ">
185
+ <span class="summary_signature">
186
+
187
+ <a href="#each_chomp-instance_method" title="#each_chomp (instance method)">- (Object) <strong>each_chomp</strong> { ... }</a>
188
+
189
+
190
+
191
+ </span>
192
+
193
+
194
+
195
+
196
+
197
+
198
+
199
+
200
+
201
+ <span class="summary_desc"><div class='inline'>
202
+ <p>Iterate over lines with newline removed.</p>
203
+ </div></span>
204
+
205
+ </li>
206
+
207
+
208
+ <li class="public ">
209
+ <span class="summary_signature">
210
+
211
+ <a href="#each_line-instance_method" title="#each_line (instance method)">- (Object) <strong>each_line</strong> { ... }</a>
212
+
213
+
214
+
215
+ </span>
216
+
217
+
218
+
219
+
220
+
221
+
222
+
223
+
224
+
225
+ <span class="summary_desc"><div class='inline'>
226
+ <p>Iterate over lines.</p>
227
+ </div></span>
228
+
229
+ </li>
230
+
231
+
232
+ <li class="public ">
233
+ <span class="summary_signature">
234
+
235
+ <a href="#eof%3F-instance_method" title="#eof? (instance method)">- (Boolean) <strong>eof?</strong> </a>
236
+
237
+
238
+
239
+ (also: #eof)
240
+
241
+ </span>
242
+
243
+
244
+
245
+
246
+
247
+
248
+
249
+
250
+
251
+ <span class="summary_desc"><div class='inline'></div></span>
252
+
253
+ </li>
254
+
255
+
256
+ <li class="public ">
257
+ <span class="summary_signature">
258
+
259
+ <a href="#getc-instance_method" title="#getc (instance method)">- (Object) <strong>getc</strong> </a>
260
+
261
+
262
+
263
+ </span>
264
+
265
+
266
+
267
+
268
+
269
+
270
+
271
+
272
+
273
+ <span class="summary_desc"><div class='inline'>
274
+ <p>Get char (from IO or put-back buffer).</p>
275
+ </div></span>
276
+
277
+ </li>
278
+
279
+
280
+ <li class="public ">
281
+ <span class="summary_signature">
282
+
283
+ <a href="#getchar-instance_method" title="#getchar (instance method)">- (Object) <strong>getchar</strong> </a>
284
+
285
+
286
+
287
+ </span>
288
+
289
+
290
+
291
+
292
+
293
+
294
+
295
+
296
+
297
+ <span class="summary_desc"><div class='inline'>
298
+ <p>Get char (from IO or put-back buffer).</p>
299
+ </div></span>
300
+
301
+ </li>
302
+
303
+
304
+ <li class="public ">
305
+ <span class="summary_signature">
306
+
307
+ <a href="#gets-instance_method" title="#gets (instance method)">- (Object) <strong>gets</strong> </a>
308
+
309
+
310
+
311
+ </span>
312
+
313
+
314
+
315
+
316
+
317
+
318
+
319
+
320
+
321
+ <span class="summary_desc"><div class='inline'>
322
+ <p>Get line.</p>
323
+ </div></span>
324
+
325
+ </li>
326
+
327
+
328
+ <li class="public ">
329
+ <span class="summary_signature">
330
+
331
+ <a href="#getschomp-instance_method" title="#getschomp (instance method)">- (Object) <strong>getschomp</strong> </a>
332
+
333
+
334
+
335
+ </span>
336
+
337
+
338
+
339
+
340
+
341
+
342
+
343
+
344
+
345
+ <span class="summary_desc"><div class='inline'>
346
+ <p>Get line without newline.</p>
347
+ </div></span>
348
+
349
+ </li>
350
+
351
+
352
+ <li class="public ">
353
+ <span class="summary_signature">
354
+
355
+ <a href="#initialize-instance_method" title="#initialize (instance method)">- (Read) <strong>initialize</strong>(filename, absname = nil, io = nil) </a>
356
+
357
+
358
+
359
+ </span>
360
+
361
+
362
+ <span class="note title constructor">constructor</span>
363
+
364
+
365
+
366
+
367
+
368
+
369
+
370
+
371
+ <span class="summary_desc"><div class='inline'>
372
+ <p>Create Read object.</p>
373
+ </div></span>
374
+
375
+ </li>
376
+
377
+
378
+ <li class="public ">
379
+ <span class="summary_signature">
380
+
381
+ <a href="#putback-instance_method" title="#putback (instance method)">- (Object) <strong>putback</strong>(c) </a>
382
+
383
+
384
+
385
+ </span>
386
+
387
+
388
+
389
+
390
+
391
+
392
+
393
+
394
+
395
+ <span class="summary_desc"><div class='inline'>
396
+ <p>Put-back char(s) (to put-back buffer).</p>
397
+ </div></span>
398
+
399
+ </li>
400
+
401
+
402
+ <li class="public ">
403
+ <span class="summary_signature">
404
+
405
+ <a href="#read-instance_method" title="#read (instance method)">- (Object) <strong>read</strong>(length = 1024) </a>
406
+
407
+
408
+
409
+ </span>
410
+
411
+
412
+
413
+
414
+
415
+
416
+
417
+
418
+
419
+ <span class="summary_desc"><div class='inline'>
420
+ <p>Read from IO.</p>
421
+ </div></span>
422
+
423
+ </li>
424
+
425
+
426
+ <li class="public ">
427
+ <span class="summary_signature">
428
+
429
+ <a href="#readchars-instance_method" title="#readchars (instance method)">- (Object) <strong>readchars</strong>(length = 1024) </a>
430
+
431
+
432
+
433
+ </span>
434
+
435
+
436
+
437
+
438
+
439
+
440
+
441
+
442
+
443
+ <span class="summary_desc"><div class='inline'>
444
+ <p>Read from IO with exception.</p>
445
+ </div></span>
446
+
447
+ </li>
448
+
449
+
450
+ <li class="public ">
451
+ <span class="summary_signature">
452
+
453
+ <a href="#readline-instance_method" title="#readline (instance method)">- (Object) <strong>readline</strong> </a>
454
+
455
+
456
+
457
+ </span>
458
+
459
+
460
+
461
+
462
+
463
+
464
+
465
+
466
+
467
+ <span class="summary_desc"><div class='inline'>
468
+ <p>Readline from file.</p>
469
+ </div></span>
470
+
471
+ </li>
472
+
473
+
474
+ <li class="public ">
475
+ <span class="summary_signature">
476
+
477
+ <a href="#readlines-instance_method" title="#readlines (instance method)">- (Object) <strong>readlines</strong>(chomp = false) </a>
478
+
479
+
480
+
481
+ </span>
482
+
483
+
484
+
485
+
486
+
487
+
488
+
489
+
490
+
491
+ <span class="summary_desc"><div class='inline'>
492
+ <p>Return Array of lines.</p>
493
+ </div></span>
494
+
495
+ </li>
496
+
497
+
498
+ </ul>
499
+
500
+
501
+
502
+
503
+
504
+
505
+
506
+
507
+
508
+
509
+
510
+ <h3 class="inherited">Methods inherited from <span class='object_link'><a href="InOut.html" title="EasyFile::InOut (class)">InOut</a></span></h3>
511
+ <p class="inherited"><span class='object_link'><a href="InOut.html#abspath-class_method" title="EasyFile::InOut.abspath (method)">abspath</a></span>, <span class='object_link'><a href="InOut.html#add-class_method" title="EasyFile::InOut.add (method)">add</a></span>, <span class='object_link'><a href="InOut.html#close-instance_method" title="EasyFile::InOut#close (method)">#close</a></span>, <span class='object_link'><a href="InOut.html#create-class_method" title="EasyFile::InOut.create (method)">create</a></span>, <span class='object_link'><a href="InOut.html#delete-class_method" title="EasyFile::InOut.delete (method)">delete</a></span>, <span class='object_link'><a href="InOut.html#get-class_method" title="EasyFile::InOut.get (method)">get</a></span>, <span class='object_link'><a href="InOut.html#getByAbsname-class_method" title="EasyFile::InOut.getByAbsname (method)">getByAbsname</a></span>, <span class='object_link'><a href="InOut.html#getList-class_method" title="EasyFile::InOut.getList (method)">getList</a></span>, <span class='object_link'><a href="InOut.html#open-instance_method" title="EasyFile::InOut#open (method)">#open</a></span>, <span class='object_link'><a href="InOut.html#standard%3F-class_method" title="EasyFile::InOut.standard? (method)">standard?</a></span></p>
512
+ <div id="constructor_details" class="method_details_list">
513
+ <h2>Constructor Details</h2>
514
+
515
+ <div class="method_details first">
516
+ <h3 class="signature first" id="initialize-instance_method">
517
+
518
+ - (<tt><span class='object_link'><a href="" title="EasyFile::Read (class)">Read</a></span></tt>) <strong>initialize</strong>(filename, absname = nil, io = nil)
519
+
520
+
521
+
522
+
523
+
524
+ </h3><div class="docstring">
525
+ <div class="discussion">
526
+
527
+ <p>Create Read object.</p>
528
+
529
+
530
+ </div>
531
+ </div>
532
+ <div class="tags">
533
+ <p class="tag_title">Parameters:</p>
534
+ <ul class="param">
535
+
536
+ <li>
537
+
538
+ <span class='name'>filename</span>
539
+
540
+
541
+ <span class='type'>(<tt><span class='object_link'><a href="String.html" title="EasyFile::String (class)">String</a></span></tt>)</span>
542
+
543
+
544
+
545
+ &mdash;
546
+ <div class='inline'>
547
+ <p>Relative path file name.</p>
548
+ </div>
549
+
550
+ </li>
551
+
552
+ <li>
553
+
554
+ <span class='name'>absname</span>
555
+
556
+
557
+ <span class='type'>(<tt><span class='object_link'><a href="String.html" title="EasyFile::String (class)">String</a></span></tt>)</span>
558
+
559
+
560
+ <em class="default">(defaults to: <tt>nil</tt>)</em>
561
+
562
+
563
+ &mdash;
564
+ <div class='inline'>
565
+ <p>Absolute path file name (generated if not given).</p>
566
+ </div>
567
+
568
+ </li>
569
+
570
+ <li>
571
+
572
+ <span class='name'>io</span>
573
+
574
+
575
+ <span class='type'>(<tt>IO</tt>)</span>
576
+
577
+
578
+ <em class="default">(defaults to: <tt>nil</tt>)</em>
579
+
580
+
581
+ &mdash;
582
+ <div class='inline'>
583
+ <p>IO handle.</p>
584
+ </div>
585
+
586
+ </li>
587
+
588
+ </ul>
589
+
590
+
591
+ </div><table class="source_code">
592
+ <tr>
593
+ <td>
594
+ <pre class="lines">
595
+
596
+
597
+ 300
598
+ 301
599
+ 302
600
+ 303
601
+ 304</pre>
602
+ </td>
603
+ <td>
604
+ <pre class="code"><span class="info file"># File 'lib/easyfile.rb', line 300</span>
605
+
606
+ <span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span><span class='lparen'>(</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>
607
+ <span class='kw'>super</span><span class='lparen'>(</span> <span class='symbol'>:read</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='comma'>,</span> <span class='id identifier rubyid_io'>io</span> <span class='rparen'>)</span>
608
+
609
+ <span class='ivar'>@charbuffer</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_end'>&quot;</span></span>
610
+ <span class='kw'>end</span></pre>
611
+ </td>
612
+ </tr>
613
+ </table>
614
+ </div>
615
+
616
+ </div>
617
+
618
+
619
+ <div id="class_method_details" class="method_details_list">
620
+ <h2>Class Method Details</h2>
621
+
622
+
623
+ <div class="method_details first">
624
+ <h3 class="signature first" id="open-class_method">
625
+
626
+ + (<tt><span class='object_link'><a href="" title="EasyFile::Read (class)">Read</a></span></tt>) <strong>open</strong>(name)
627
+
628
+
629
+
630
+
631
+
632
+ </h3><div class="docstring">
633
+ <div class="discussion">
634
+
635
+ <p>Create EasyFile::Read object and, open file with given name.</p>
636
+
637
+
638
+ </div>
639
+ </div>
640
+ <div class="tags">
641
+ <p class="tag_title">Parameters:</p>
642
+ <ul class="param">
643
+
644
+ <li>
645
+
646
+ <span class='name'>name</span>
647
+
648
+
649
+ <span class='type'>(<tt><span class='object_link'><a href="String.html" title="EasyFile::String (class)">String</a></span></tt>)</span>
650
+
651
+
652
+
653
+ &mdash;
654
+ <div class='inline'>
655
+ <p>Relative path name for file.</p>
656
+ </div>
657
+
658
+ </li>
659
+
660
+ </ul>
661
+
662
+ <p class="tag_title">Returns:</p>
663
+ <ul class="return">
664
+
665
+ <li>
666
+
667
+
668
+ <span class='type'>(<tt><span class='object_link'><a href="" title="EasyFile::Read (class)">Read</a></span></tt>)</span>
669
+
670
+
671
+
672
+ &mdash;
673
+ <div class='inline'>
674
+ <p>EasyFile handle.</p>
675
+ </div>
676
+
677
+ </li>
678
+
679
+ </ul>
680
+
681
+ </div><table class="source_code">
682
+ <tr>
683
+ <td>
684
+ <pre class="lines">
685
+
686
+
687
+ 289
688
+ 290
689
+ 291</pre>
690
+ </td>
691
+ <td>
692
+ <pre class="code"><span class="info file"># File 'lib/easyfile.rb', line 289</span>
693
+
694
+ <span class='kw'>def</span> <span class='const'>Read</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='rparen'>)</span>
695
+ <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='symbol'>:read</span> <span class='rparen'>)</span>
696
+ <span class='kw'>end</span></pre>
697
+ </td>
698
+ </tr>
699
+ </table>
700
+ </div>
701
+
702
+ </div>
703
+
704
+ <div id="instance_method_details" class="method_details_list">
705
+ <h2>Instance Method Details</h2>
706
+
707
+
708
+ <div class="method_details first">
709
+ <h3 class="signature first" id="each_chomp-instance_method">
710
+
711
+ - (<tt>Object</tt>) <strong>each_chomp</strong> { ... }
712
+
713
+
714
+
715
+
716
+
717
+ </h3><div class="docstring">
718
+ <div class="discussion">
719
+
720
+ <p>Iterate over lines with newline removed.</p>
721
+
722
+
723
+ </div>
724
+ </div>
725
+ <div class="tags">
726
+
727
+ <p class="tag_title">Yields:</p>
728
+ <ul class="yield">
729
+
730
+ <li>
731
+
732
+
733
+ <span class='type'></span>
734
+
735
+
736
+
737
+
738
+ <div class='inline'>
739
+ <p>Each line.</p>
740
+ </div>
741
+
742
+ </li>
743
+
744
+ </ul>
745
+
746
+ </div><table class="source_code">
747
+ <tr>
748
+ <td>
749
+ <pre class="lines">
750
+
751
+
752
+ 406
753
+ 407
754
+ 408
755
+ 409
756
+ 410</pre>
757
+ </td>
758
+ <td>
759
+ <pre class="code"><span class="info file"># File 'lib/easyfile.rb', line 406</span>
760
+
761
+ <span class='kw'>def</span> <span class='id identifier rubyid_each_chomp'>each_chomp</span><span class='lparen'>(</span> <span class='op'>&amp;</span><span class='id identifier rubyid_blk'>blk</span> <span class='rparen'>)</span>
762
+ <span class='kw'>while</span> <span class='lparen'>(</span> <span class='id identifier rubyid_line'>line</span> <span class='op'>=</span> <span class='id identifier rubyid_getschomp'>getschomp</span> <span class='rparen'>)</span>
763
+ <span class='kw'>yield</span> <span class='id identifier rubyid_line'>line</span>
764
+ <span class='kw'>end</span>
765
+ <span class='kw'>end</span></pre>
766
+ </td>
767
+ </tr>
768
+ </table>
769
+ </div>
770
+
771
+ <div class="method_details ">
772
+ <h3 class="signature " id="each_line-instance_method">
773
+
774
+ - (<tt>Object</tt>) <strong>each_line</strong> { ... }
775
+
776
+
777
+
778
+
779
+
780
+ </h3><div class="docstring">
781
+ <div class="discussion">
782
+
783
+ <p>Iterate over lines.</p>
784
+
785
+
786
+ </div>
787
+ </div>
788
+ <div class="tags">
789
+
790
+ <p class="tag_title">Yields:</p>
791
+ <ul class="yield">
792
+
793
+ <li>
794
+
795
+
796
+ <span class='type'></span>
797
+
798
+
799
+
800
+
801
+ <div class='inline'>
802
+ <p>Each line.</p>
803
+ </div>
804
+
805
+ </li>
806
+
807
+ </ul>
808
+
809
+ </div><table class="source_code">
810
+ <tr>
811
+ <td>
812
+ <pre class="lines">
813
+
814
+
815
+ 396
816
+ 397
817
+ 398
818
+ 399
819
+ 400</pre>
820
+ </td>
821
+ <td>
822
+ <pre class="code"><span class="info file"># File 'lib/easyfile.rb', line 396</span>
823
+
824
+ <span class='kw'>def</span> <span class='id identifier rubyid_each_line'>each_line</span><span class='lparen'>(</span> <span class='op'>&amp;</span><span class='id identifier rubyid_blk'>blk</span> <span class='rparen'>)</span>
825
+ <span class='kw'>while</span> <span class='lparen'>(</span> <span class='id identifier rubyid_line'>line</span> <span class='op'>=</span> <span class='id identifier rubyid_gets'>gets</span> <span class='rparen'>)</span>
826
+ <span class='kw'>yield</span> <span class='id identifier rubyid_line'>line</span>
827
+ <span class='kw'>end</span>
828
+ <span class='kw'>end</span></pre>
829
+ </td>
830
+ </tr>
831
+ </table>
832
+ </div>
833
+
834
+ <div class="method_details ">
835
+ <h3 class="signature " id="eof?-instance_method">
836
+
837
+ - (<tt>Boolean</tt>) <strong>eof?</strong>
838
+
839
+
840
+
841
+ <span class="aliases">Also known as:
842
+ <span class="names"><span id='eof-instance_method'>eof</span></span>
843
+ </span>
844
+
845
+
846
+
847
+ </h3><div class="docstring">
848
+ <div class="discussion">
849
+
850
+
851
+ </div>
852
+ </div>
853
+ <div class="tags">
854
+
855
+ <p class="tag_title">Returns:</p>
856
+ <ul class="return">
857
+
858
+ <li>
859
+
860
+
861
+ <span class='type'>(<tt>Boolean</tt>)</span>
862
+
863
+
864
+
865
+ </li>
866
+
867
+ </ul>
868
+
869
+ </div><table class="source_code">
870
+ <tr>
871
+ <td>
872
+ <pre class="lines">
873
+
874
+
875
+ 367
876
+ 368
877
+ 369</pre>
878
+ </td>
879
+ <td>
880
+ <pre class="code"><span class="info file"># File 'lib/easyfile.rb', line 367</span>
881
+
882
+ <span class='kw'>def</span> <span class='id identifier rubyid_eof?'>eof?</span>
883
+ <span class='ivar'>@charbuffer</span><span class='period'>.</span><span class='id identifier rubyid_empty?'>empty?</span> <span class='op'>&amp;&amp;</span> <span class='ivar'>@io</span><span class='period'>.</span><span class='id identifier rubyid_eof?'>eof?</span>
884
+ <span class='kw'>end</span></pre>
885
+ </td>
886
+ </tr>
887
+ </table>
888
+ </div>
889
+
890
+ <div class="method_details ">
891
+ <h3 class="signature " id="getc-instance_method">
892
+
893
+ - (<tt>Object</tt>) <strong>getc</strong>
894
+
895
+
896
+
897
+
898
+
899
+ </h3><div class="docstring">
900
+ <div class="discussion">
901
+
902
+ <p>Get char (from IO or put-back buffer).</p>
903
+
904
+
905
+ </div>
906
+ </div>
907
+ <div class="tags">
908
+
909
+
910
+ </div><table class="source_code">
911
+ <tr>
912
+ <td>
913
+ <pre class="lines">
914
+
915
+
916
+ 329
917
+ 330
918
+ 331
919
+ 332
920
+ 333
921
+ 334
922
+ 335</pre>
923
+ </td>
924
+ <td>
925
+ <pre class="code"><span class="info file"># File 'lib/easyfile.rb', line 329</span>
926
+
927
+ <span class='kw'>def</span> <span class='id identifier rubyid_getc'>getc</span>
928
+ <span class='kw'>begin</span>
929
+ <span class='id identifier rubyid_getchar'>getchar</span>
930
+ <span class='kw'>rescue</span> <span class='const'>EOFError</span>
931
+ <span class='kw'>nil</span>
932
+ <span class='kw'>end</span>
933
+ <span class='kw'>end</span></pre>
934
+ </td>
935
+ </tr>
936
+ </table>
937
+ </div>
938
+
939
+ <div class="method_details ">
940
+ <h3 class="signature " id="getchar-instance_method">
941
+
942
+ - (<tt>Object</tt>) <strong>getchar</strong>
943
+
944
+
945
+
946
+
947
+
948
+ </h3><div class="docstring">
949
+ <div class="discussion">
950
+
951
+ <p>Get char (from IO or put-back buffer).</p>
952
+
953
+
954
+ </div>
955
+ </div>
956
+ <div class="tags">
957
+
958
+
959
+ </div><table class="source_code">
960
+ <tr>
961
+ <td>
962
+ <pre class="lines">
963
+
964
+
965
+ 339
966
+ 340
967
+ 341</pre>
968
+ </td>
969
+ <td>
970
+ <pre class="code"><span class="info file"># File 'lib/easyfile.rb', line 339</span>
971
+
972
+ <span class='kw'>def</span> <span class='id identifier rubyid_getchar'>getchar</span>
973
+ <span class='id identifier rubyid_updateLineNumber'>updateLineNumber</span><span class='lparen'>(</span> <span class='id identifier rubyid_getn'>getn</span><span class='lparen'>(</span> <span class='int'>1</span> <span class='rparen'>)</span> <span class='rparen'>)</span>
974
+ <span class='kw'>end</span></pre>
975
+ </td>
976
+ </tr>
977
+ </table>
978
+ </div>
979
+
980
+ <div class="method_details ">
981
+ <h3 class="signature " id="gets-instance_method">
982
+
983
+ - (<tt>Object</tt>) <strong>gets</strong>
984
+
985
+
986
+
987
+
988
+
989
+ </h3><div class="docstring">
990
+ <div class="discussion">
991
+
992
+ <p>Get line.</p>
993
+
994
+
995
+ </div>
996
+ </div>
997
+ <div class="tags">
998
+
999
+
1000
+ </div><table class="source_code">
1001
+ <tr>
1002
+ <td>
1003
+ <pre class="lines">
1004
+
1005
+
1006
+ 308
1007
+ 309
1008
+ 310
1009
+ 311
1010
+ 312
1011
+ 313
1012
+ 314</pre>
1013
+ </td>
1014
+ <td>
1015
+ <pre class="code"><span class="info file"># File 'lib/easyfile.rb', line 308</span>
1016
+
1017
+ <span class='kw'>def</span> <span class='id identifier rubyid_gets'>gets</span>
1018
+ <span class='kw'>begin</span>
1019
+ <span class='id identifier rubyid_readline'>readline</span>
1020
+ <span class='kw'>rescue</span> <span class='const'>EOFError</span>
1021
+ <span class='kw'>nil</span>
1022
+ <span class='kw'>end</span>
1023
+ <span class='kw'>end</span></pre>
1024
+ </td>
1025
+ </tr>
1026
+ </table>
1027
+ </div>
1028
+
1029
+ <div class="method_details ">
1030
+ <h3 class="signature " id="getschomp-instance_method">
1031
+
1032
+ - (<tt>Object</tt>) <strong>getschomp</strong>
1033
+
1034
+
1035
+
1036
+
1037
+
1038
+ </h3><div class="docstring">
1039
+ <div class="discussion">
1040
+
1041
+ <p>Get line without newline.</p>
1042
+
1043
+
1044
+ </div>
1045
+ </div>
1046
+ <div class="tags">
1047
+
1048
+
1049
+ </div><table class="source_code">
1050
+ <tr>
1051
+ <td>
1052
+ <pre class="lines">
1053
+
1054
+
1055
+ 318
1056
+ 319
1057
+ 320
1058
+ 321
1059
+ 322
1060
+ 323
1061
+ 324
1062
+ 325</pre>
1063
+ </td>
1064
+ <td>
1065
+ <pre class="code"><span class="info file"># File 'lib/easyfile.rb', line 318</span>
1066
+
1067
+ <span class='kw'>def</span> <span class='id identifier rubyid_getschomp'>getschomp</span>
1068
+ <span class='id identifier rubyid_line'>line</span> <span class='op'>=</span> <span class='id identifier rubyid_gets'>gets</span>
1069
+ <span class='kw'>if</span> <span class='id identifier rubyid_line'>line</span>
1070
+ <span class='id identifier rubyid_line'>line</span><span class='period'>.</span><span class='id identifier rubyid_chomp'>chomp</span>
1071
+ <span class='kw'>else</span>
1072
+ <span class='id identifier rubyid_line'>line</span>
1073
+ <span class='kw'>end</span>
1074
+ <span class='kw'>end</span></pre>
1075
+ </td>
1076
+ </tr>
1077
+ </table>
1078
+ </div>
1079
+
1080
+ <div class="method_details ">
1081
+ <h3 class="signature " id="putback-instance_method">
1082
+
1083
+ - (<tt>Object</tt>) <strong>putback</strong>(c)
1084
+
1085
+
1086
+
1087
+
1088
+
1089
+ </h3><div class="docstring">
1090
+ <div class="discussion">
1091
+
1092
+ <p>Put-back char(s) (to put-back buffer).</p>
1093
+
1094
+
1095
+ </div>
1096
+ </div>
1097
+ <div class="tags">
1098
+
1099
+
1100
+ </div><table class="source_code">
1101
+ <tr>
1102
+ <td>
1103
+ <pre class="lines">
1104
+
1105
+
1106
+ 345
1107
+ 346
1108
+ 347
1109
+ 348</pre>
1110
+ </td>
1111
+ <td>
1112
+ <pre class="code"><span class="info file"># File 'lib/easyfile.rb', line 345</span>
1113
+
1114
+ <span class='kw'>def</span> <span class='id identifier rubyid_putback'>putback</span><span class='lparen'>(</span> <span class='id identifier rubyid_c'>c</span> <span class='rparen'>)</span>
1115
+ <span class='ivar'>@charbuffer</span> <span class='op'>=</span> <span class='id identifier rubyid_c'>c</span> <span class='op'>+</span> <span class='ivar'>@charbuffer</span>
1116
+ <span class='id identifier rubyid_updateLineNumber'>updateLineNumber</span><span class='lparen'>(</span> <span class='id identifier rubyid_c'>c</span><span class='comma'>,</span> <span class='op'>-</span><span class='int'>1</span> <span class='rparen'>)</span>
1117
+ <span class='kw'>end</span></pre>
1118
+ </td>
1119
+ </tr>
1120
+ </table>
1121
+ </div>
1122
+
1123
+ <div class="method_details ">
1124
+ <h3 class="signature " id="read-instance_method">
1125
+
1126
+ - (<tt>Object</tt>) <strong>read</strong>(length = 1024)
1127
+
1128
+
1129
+
1130
+
1131
+
1132
+ </h3><div class="docstring">
1133
+ <div class="discussion">
1134
+
1135
+ <p>Read from IO.</p>
1136
+
1137
+
1138
+ </div>
1139
+ </div>
1140
+ <div class="tags">
1141
+
1142
+
1143
+ </div><table class="source_code">
1144
+ <tr>
1145
+ <td>
1146
+ <pre class="lines">
1147
+
1148
+
1149
+ 352
1150
+ 353
1151
+ 354
1152
+ 355
1153
+ 356
1154
+ 357
1155
+ 358</pre>
1156
+ </td>
1157
+ <td>
1158
+ <pre class="code"><span class="info file"># File 'lib/easyfile.rb', line 352</span>
1159
+
1160
+ <span class='kw'>def</span> <span class='id identifier rubyid_read'>read</span><span class='lparen'>(</span> <span class='id identifier rubyid_length'>length</span> <span class='op'>=</span> <span class='int'>1024</span> <span class='rparen'>)</span>
1161
+ <span class='kw'>begin</span>
1162
+ <span class='id identifier rubyid_readchars'>readchars</span><span class='lparen'>(</span> <span class='id identifier rubyid_length'>length</span> <span class='rparen'>)</span>
1163
+ <span class='kw'>rescue</span> <span class='const'>EOFError</span>
1164
+ <span class='kw'>nil</span>
1165
+ <span class='kw'>end</span>
1166
+ <span class='kw'>end</span></pre>
1167
+ </td>
1168
+ </tr>
1169
+ </table>
1170
+ </div>
1171
+
1172
+ <div class="method_details ">
1173
+ <h3 class="signature " id="readchars-instance_method">
1174
+
1175
+ - (<tt>Object</tt>) <strong>readchars</strong>(length = 1024)
1176
+
1177
+
1178
+
1179
+
1180
+
1181
+ </h3><div class="docstring">
1182
+ <div class="discussion">
1183
+
1184
+ <p>Read from IO with exception.</p>
1185
+
1186
+
1187
+ </div>
1188
+ </div>
1189
+ <div class="tags">
1190
+
1191
+
1192
+ </div><table class="source_code">
1193
+ <tr>
1194
+ <td>
1195
+ <pre class="lines">
1196
+
1197
+
1198
+ 362
1199
+ 363
1200
+ 364</pre>
1201
+ </td>
1202
+ <td>
1203
+ <pre class="code"><span class="info file"># File 'lib/easyfile.rb', line 362</span>
1204
+
1205
+ <span class='kw'>def</span> <span class='id identifier rubyid_readchars'>readchars</span><span class='lparen'>(</span> <span class='id identifier rubyid_length'>length</span> <span class='op'>=</span> <span class='int'>1024</span> <span class='rparen'>)</span>
1206
+ <span class='id identifier rubyid_updateLineNumber'>updateLineNumber</span><span class='lparen'>(</span> <span class='id identifier rubyid_getn'>getn</span><span class='lparen'>(</span> <span class='id identifier rubyid_length'>length</span> <span class='rparen'>)</span> <span class='rparen'>)</span>
1207
+ <span class='kw'>end</span></pre>
1208
+ </td>
1209
+ </tr>
1210
+ </table>
1211
+ </div>
1212
+
1213
+ <div class="method_details ">
1214
+ <h3 class="signature " id="readline-instance_method">
1215
+
1216
+ - (<tt>Object</tt>) <strong>readline</strong>
1217
+
1218
+
1219
+
1220
+
1221
+
1222
+ </h3><div class="docstring">
1223
+ <div class="discussion">
1224
+
1225
+ <p>Readline from file.</p>
1226
+
1227
+
1228
+ </div>
1229
+ </div>
1230
+ <div class="tags">
1231
+
1232
+
1233
+ </div><table class="source_code">
1234
+ <tr>
1235
+ <td>
1236
+ <pre class="lines">
1237
+
1238
+
1239
+ 414
1240
+ 415
1241
+ 416</pre>
1242
+ </td>
1243
+ <td>
1244
+ <pre class="code"><span class="info file"># File 'lib/easyfile.rb', line 414</span>
1245
+
1246
+ <span class='kw'>def</span> <span class='id identifier rubyid_readline'>readline</span>
1247
+ <span class='id identifier rubyid_updateLineNumber'>updateLineNumber</span><span class='lparen'>(</span> <span class='id identifier rubyid_getline'>getline</span> <span class='rparen'>)</span>
1248
+ <span class='kw'>end</span></pre>
1249
+ </td>
1250
+ </tr>
1251
+ </table>
1252
+ </div>
1253
+
1254
+ <div class="method_details ">
1255
+ <h3 class="signature " id="readlines-instance_method">
1256
+
1257
+ - (<tt>Object</tt>) <strong>readlines</strong>(chomp = false)
1258
+
1259
+
1260
+
1261
+
1262
+
1263
+ </h3><div class="docstring">
1264
+ <div class="discussion">
1265
+
1266
+ <p>Return Array of lines.</p>
1267
+
1268
+
1269
+ </div>
1270
+ </div>
1271
+ <div class="tags">
1272
+
1273
+
1274
+ </div><table class="source_code">
1275
+ <tr>
1276
+ <td>
1277
+ <pre class="lines">
1278
+
1279
+
1280
+ 375
1281
+ 376
1282
+ 377
1283
+ 378
1284
+ 379
1285
+ 380
1286
+ 381
1287
+ 382
1288
+ 383
1289
+ 384
1290
+ 385
1291
+ 386
1292
+ 387
1293
+ 388
1294
+ 389
1295
+ 390
1296
+ 391</pre>
1297
+ </td>
1298
+ <td>
1299
+ <pre class="code"><span class="info file"># File 'lib/easyfile.rb', line 375</span>
1300
+
1301
+ <span class='kw'>def</span> <span class='id identifier rubyid_readlines'>readlines</span><span class='lparen'>(</span> <span class='id identifier rubyid_chomp'>chomp</span> <span class='op'>=</span> <span class='kw'>false</span> <span class='rparen'>)</span>
1302
+ <span class='id identifier rubyid_lines'>lines</span> <span class='op'>=</span> <span class='lbracket'>[</span><span class='rbracket'>]</span>
1303
+ <span class='kw'>if</span> <span class='id identifier rubyid_chomp'>chomp</span>
1304
+ <span class='id identifier rubyid_loop'>loop</span> <span class='kw'>do</span>
1305
+ <span class='id identifier rubyid_line'>line</span> <span class='op'>=</span> <span class='id identifier rubyid_getschomp'>getschomp</span>
1306
+ <span class='kw'>break</span> <span class='kw'>unless</span> <span class='id identifier rubyid_line'>line</span>
1307
+ <span class='id identifier rubyid_lines'>lines</span><span class='period'>.</span><span class='id identifier rubyid_push'>push</span> <span class='id identifier rubyid_line'>line</span>
1308
+ <span class='kw'>end</span>
1309
+ <span class='kw'>else</span>
1310
+ <span class='id identifier rubyid_loop'>loop</span> <span class='kw'>do</span>
1311
+ <span class='id identifier rubyid_line'>line</span> <span class='op'>=</span> <span class='id identifier rubyid_gets'>gets</span>
1312
+ <span class='kw'>break</span> <span class='kw'>unless</span> <span class='id identifier rubyid_line'>line</span>
1313
+ <span class='id identifier rubyid_lines'>lines</span><span class='period'>.</span><span class='id identifier rubyid_push'>push</span> <span class='id identifier rubyid_line'>line</span>
1314
+ <span class='kw'>end</span>
1315
+ <span class='kw'>end</span>
1316
+ <span class='id identifier rubyid_lines'>lines</span>
1317
+ <span class='kw'>end</span></pre>
1318
+ </td>
1319
+ </tr>
1320
+ </table>
1321
+ </div>
1322
+
1323
+ </div>
1324
+
1325
+ </div>
1326
+
1327
+ <div id="footer">
1328
+ Generated on Wed Jan 15 19:29:45 2014 by
1329
+ <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
1330
+ 0.8.6.1 (ruby-1.9.3).
1331
+ </div>
1332
+
1333
+ </body>
1334
+ </html>