metric_tools 0.0.10 → 0.0.11
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.
- data/README.md +0 -6
- data/doc/AWS.html +150 -0
- data/doc/{Pref/Skype.html → AWS/S3.html} +19 -25
- data/doc/Gemfile.html +16 -8
- data/doc/MetricTools.html +21 -9
- data/doc/MetricTools/IndexTree.html +197 -20
- data/doc/MetricTools/S3.html +47 -21
- data/doc/MetricTools/SpreadSheet.html +139 -22
- data/doc/MetricTools/Table.html +210 -48
- data/doc/Object.html +16 -27
- data/doc/Pref.html +18 -7
- data/doc/Pref/GoogleDocs.html +17 -7
- data/doc/Pref/S3.html +17 -7
- data/doc/README_md.html +170 -0
- data/doc/created.rid +24 -13
- data/doc/doc/created_rid.html +111 -0
- data/doc/images/arrow_up.png +0 -0
- data/doc/index.html +15 -7
- data/doc/js/darkfish.js +9 -7
- data/doc/js/search_index.js +1 -1
- data/doc/metric_tools_gemspec.html +132 -0
- data/doc/rdoc.css +52 -0
- data/doc/table_of_contents.html +48 -22
- data/metric_tools.gemspec +1 -2
- metadata +7 -21
- data/doc/MetricTools/Skype.html +0 -343
- data/lib/metric_tools/skype.rb +0 -68
- data/spec/skype_spec.rb +0 -39
@@ -43,6 +43,8 @@
|
|
43
43
|
</nav>
|
44
44
|
|
45
45
|
|
46
|
+
|
47
|
+
|
46
48
|
<div id="file-metadata">
|
47
49
|
<nav id="file-list-section" class="section">
|
48
50
|
<h3 class="section-header">Defined In</h3>
|
@@ -64,31 +66,36 @@
|
|
64
66
|
</nav>
|
65
67
|
|
66
68
|
|
69
|
+
|
67
70
|
<!-- Method Quickref -->
|
68
71
|
<nav id="method-list-section" class="section">
|
69
72
|
<h3 class="section-header">Methods</h3>
|
70
73
|
|
71
74
|
<ul class="link-list">
|
72
75
|
|
73
|
-
<li><a href="#method-c-5B-5D">::[]</a>
|
76
|
+
<li ><a href="#method-c-5B-5D">::[]</a>
|
77
|
+
|
78
|
+
<li ><a href="#method-c-5B-5D-3D">::[]=</a>
|
74
79
|
|
75
|
-
<li><a href="#method-c-
|
80
|
+
<li ><a href="#method-c-change_worksheet_by_title">::change_worksheet_by_title</a>
|
76
81
|
|
77
|
-
<li><a href="#method-c-
|
82
|
+
<li ><a href="#method-c-check_worksheet_seleced_or_raise_error">::check_worksheet_seleced_or_raise_error</a>
|
78
83
|
|
79
|
-
<li><a href="#method-c-
|
84
|
+
<li ><a href="#method-c-current_worksheet_title">::current_worksheet_title</a>
|
80
85
|
|
81
|
-
<li><a href="#method-c-
|
86
|
+
<li ><a href="#method-c-height">::height</a>
|
82
87
|
|
83
|
-
<li><a href="#method-c-login">::login</a>
|
88
|
+
<li ><a href="#method-c-login">::login</a>
|
84
89
|
|
85
|
-
<li><a href="#method-c-login-3F">::login?</a>
|
90
|
+
<li ><a href="#method-c-login-3F">::login?</a>
|
86
91
|
|
87
|
-
<li><a href="#method-c-logout">::logout</a>
|
92
|
+
<li ><a href="#method-c-logout">::logout</a>
|
88
93
|
|
89
|
-
<li><a href="#method-c-save">::save</a>
|
94
|
+
<li ><a href="#method-c-save">::save</a>
|
90
95
|
|
91
|
-
<li><a href="#method-c-set_value_table">::set_value_table</a>
|
96
|
+
<li ><a href="#method-c-set_value_table">::set_value_table</a>
|
97
|
+
|
98
|
+
<li ><a href="#method-c-width">::width</a>
|
92
99
|
|
93
100
|
</ul>
|
94
101
|
</nav>
|
@@ -103,8 +110,14 @@
|
|
103
110
|
|
104
111
|
<li class="file"><a href="../Gemfile.html">Gemfile</a>
|
105
112
|
|
113
|
+
<li class="file"><a href="../README_md.html">README</a>
|
114
|
+
|
106
115
|
<li class="file"><a href="../config/my_pref.html">my_pref</a>
|
107
116
|
|
117
|
+
<li class="file"><a href="../doc/created_rid.html">created.rid</a>
|
118
|
+
|
119
|
+
<li class="file"><a href="../metric_tools_gemspec.html">metric_tools.gemspec</a>
|
120
|
+
|
108
121
|
</ul>
|
109
122
|
</nav>
|
110
123
|
|
@@ -113,28 +126,28 @@
|
|
113
126
|
|
114
127
|
<ul class="link-list">
|
115
128
|
|
129
|
+
<li><a href="../AWS.html">AWS</a>
|
130
|
+
|
131
|
+
<li><a href="../AWS/S3.html">AWS::S3</a>
|
132
|
+
|
116
133
|
<li><a href="../MetricTools.html">MetricTools</a>
|
117
134
|
|
118
135
|
<li><a href="../MetricTools/IndexTree.html">MetricTools::IndexTree</a>
|
119
136
|
|
120
137
|
<li><a href="../MetricTools/S3.html">MetricTools::S3</a>
|
121
138
|
|
122
|
-
<li><a href="../MetricTools/Skype.html">MetricTools::Skype</a>
|
123
|
-
|
124
139
|
<li><a href="../MetricTools/SpreadSheet.html">MetricTools::SpreadSheet</a>
|
125
140
|
|
126
141
|
<li><a href="../MetricTools/Table.html">MetricTools::Table</a>
|
127
142
|
|
143
|
+
<li><a href="../Object.html">Object</a>
|
144
|
+
|
128
145
|
<li><a href="../Pref.html">Pref</a>
|
129
146
|
|
130
147
|
<li><a href="../Pref/GoogleDocs.html">Pref::GoogleDocs</a>
|
131
148
|
|
132
149
|
<li><a href="../Pref/S3.html">Pref::S3</a>
|
133
150
|
|
134
|
-
<li><a href="../Pref/Skype.html">Pref::Skype</a>
|
135
|
-
|
136
|
-
<li><a href="../Object.html">Object</a>
|
137
|
-
|
138
151
|
</ul>
|
139
152
|
</nav>
|
140
153
|
|
@@ -219,7 +232,9 @@
|
|
219
232
|
<div class="method-heading">
|
220
233
|
<span class="method-name">[]</span><span
|
221
234
|
class="method-args">(i, j)</span>
|
235
|
+
|
222
236
|
<span class="method-click-advice">click to toggle source</span>
|
237
|
+
|
223
238
|
</div>
|
224
239
|
|
225
240
|
|
@@ -227,10 +242,11 @@
|
|
227
242
|
|
228
243
|
<p>インデクサを使用して値にアクセスします</p>
|
229
244
|
|
245
|
+
|
230
246
|
|
231
247
|
|
232
248
|
<div class="method-source-code" id="5B-5D-source">
|
233
|
-
<pre><span class="ruby-comment"># File lib/metric_tools/spread_sheet.rb, line
|
249
|
+
<pre><span class="ruby-comment"># File lib/metric_tools/spread_sheet.rb, line 86</span>
|
234
250
|
<span class="ruby-keyword">def</span> <span class="ruby-operator">[]</span>(<span class="ruby-identifier">i</span>, <span class="ruby-identifier">j</span>)
|
235
251
|
<span class="ruby-identifier">check_worksheet_seleced_or_raise_error</span>()
|
236
252
|
|
@@ -251,7 +267,9 @@
|
|
251
267
|
<div class="method-heading">
|
252
268
|
<span class="method-name">[]=</span><span
|
253
269
|
class="method-args">(i, j, val)</span>
|
270
|
+
|
254
271
|
<span class="method-click-advice">click to toggle source</span>
|
272
|
+
|
255
273
|
</div>
|
256
274
|
|
257
275
|
|
@@ -259,10 +277,11 @@
|
|
259
277
|
|
260
278
|
<p>インデクサを使用して値をアサインします</p>
|
261
279
|
|
280
|
+
|
262
281
|
|
263
282
|
|
264
283
|
<div class="method-source-code" id="5B-5D-3D-source">
|
265
|
-
<pre><span class="ruby-comment"># File lib/metric_tools/spread_sheet.rb, line
|
284
|
+
<pre><span class="ruby-comment"># File lib/metric_tools/spread_sheet.rb, line 95</span>
|
266
285
|
<span class="ruby-keyword">def</span> <span class="ruby-operator">[]=</span>(<span class="ruby-identifier">i</span>, <span class="ruby-identifier">j</span>, <span class="ruby-identifier">val</span>)
|
267
286
|
<span class="ruby-identifier">check_worksheet_seleced_or_raise_error</span>()
|
268
287
|
|
@@ -283,7 +302,9 @@
|
|
283
302
|
<div class="method-heading">
|
284
303
|
<span class="method-name">change_worksheet_by_title</span><span
|
285
304
|
class="method-args">(title)</span>
|
305
|
+
|
286
306
|
<span class="method-click-advice">click to toggle source</span>
|
307
|
+
|
287
308
|
</div>
|
288
309
|
|
289
310
|
|
@@ -291,6 +312,7 @@
|
|
291
312
|
|
292
313
|
|
293
314
|
|
315
|
+
|
294
316
|
|
295
317
|
|
296
318
|
<div class="method-source-code" id="change_worksheet_by_title-source">
|
@@ -316,7 +338,9 @@
|
|
316
338
|
<div class="method-heading">
|
317
339
|
<span class="method-name">check_worksheet_seleced_or_raise_error</span><span
|
318
340
|
class="method-args">()</span>
|
341
|
+
|
319
342
|
<span class="method-click-advice">click to toggle source</span>
|
343
|
+
|
320
344
|
</div>
|
321
345
|
|
322
346
|
|
@@ -324,10 +348,11 @@
|
|
324
348
|
|
325
349
|
|
326
350
|
|
351
|
+
|
327
352
|
|
328
353
|
|
329
354
|
<div class="method-source-code" id="check_worksheet_seleced_or_raise_error-source">
|
330
|
-
<pre><span class="ruby-comment"># File lib/metric_tools/spread_sheet.rb, line
|
355
|
+
<pre><span class="ruby-comment"># File lib/metric_tools/spread_sheet.rb, line 123</span>
|
331
356
|
<span class="ruby-keyword">def</span> <span class="ruby-identifier">check_worksheet_seleced_or_raise_error</span>
|
332
357
|
<span class="ruby-identifier">raise</span> <span class="ruby-string">"call 'change_worksheet_by_title' before."</span> <span class="ruby-keyword">if</span> <span class="ruby-ivar">@worksheet</span>.<span class="ruby-identifier">nil?</span>
|
333
358
|
<span class="ruby-keyword">end</span></pre>
|
@@ -346,7 +371,9 @@
|
|
346
371
|
<div class="method-heading">
|
347
372
|
<span class="method-name">current_worksheet_title</span><span
|
348
373
|
class="method-args">()</span>
|
374
|
+
|
349
375
|
<span class="method-click-advice">click to toggle source</span>
|
376
|
+
|
350
377
|
</div>
|
351
378
|
|
352
379
|
|
@@ -354,6 +381,7 @@
|
|
354
381
|
|
355
382
|
<p>worksheet</p>
|
356
383
|
|
384
|
+
|
357
385
|
|
358
386
|
|
359
387
|
<div class="method-source-code" id="current_worksheet_title-source">
|
@@ -373,12 +401,51 @@
|
|
373
401
|
</div><!-- current_worksheet_title-method -->
|
374
402
|
|
375
403
|
|
404
|
+
<div id="method-c-height" class="method-detail ">
|
405
|
+
|
406
|
+
<div class="method-heading">
|
407
|
+
<span class="method-name">height</span><span
|
408
|
+
class="method-args">()</span>
|
409
|
+
|
410
|
+
<span class="method-click-advice">click to toggle source</span>
|
411
|
+
|
412
|
+
</div>
|
413
|
+
|
414
|
+
|
415
|
+
<div class="method-description">
|
416
|
+
|
417
|
+
<p>ワークシートの高さを返します</p>
|
418
|
+
|
419
|
+
|
420
|
+
|
421
|
+
|
422
|
+
<div class="method-source-code" id="height-source">
|
423
|
+
<pre><span class="ruby-comment"># File lib/metric_tools/spread_sheet.rb, line 73</span>
|
424
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">height</span>
|
425
|
+
<span class="ruby-identifier">max</span> = <span class="ruby-value">0</span>
|
426
|
+
<span class="ruby-ivar">@worksheet</span>.<span class="ruby-identifier">cells</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">coord</span>, <span class="ruby-identifier">val</span><span class="ruby-operator">|</span>
|
427
|
+
<span class="ruby-identifier">max</span> = <span class="ruby-identifier">coord</span>[<span class="ruby-value">0</span>] <span class="ruby-keyword">if</span> <span class="ruby-identifier">coord</span>[<span class="ruby-value">0</span>] <span class="ruby-operator">>=</span> <span class="ruby-identifier">max</span>
|
428
|
+
<span class="ruby-keyword">end</span>
|
429
|
+
<span class="ruby-identifier">max</span>
|
430
|
+
<span class="ruby-keyword">end</span></pre>
|
431
|
+
</div><!-- height-source -->
|
432
|
+
|
433
|
+
</div>
|
434
|
+
|
435
|
+
|
436
|
+
|
437
|
+
|
438
|
+
</div><!-- height-method -->
|
439
|
+
|
440
|
+
|
376
441
|
<div id="method-c-login" class="method-detail ">
|
377
442
|
|
378
443
|
<div class="method-heading">
|
379
444
|
<span class="method-name">login</span><span
|
380
445
|
class="method-args">(mail, password, key)</span>
|
446
|
+
|
381
447
|
<span class="method-click-advice">click to toggle source</span>
|
448
|
+
|
382
449
|
</div>
|
383
450
|
|
384
451
|
|
@@ -386,6 +453,7 @@
|
|
386
453
|
|
387
454
|
<p>mail, passwordでログインし, 該当するkeyのspreadsheetを編集可能にします</p>
|
388
455
|
|
456
|
+
|
389
457
|
|
390
458
|
|
391
459
|
<div class="method-source-code" id="login-source">
|
@@ -413,7 +481,9 @@
|
|
413
481
|
<div class="method-heading">
|
414
482
|
<span class="method-name">login?</span><span
|
415
483
|
class="method-args">()</span>
|
484
|
+
|
416
485
|
<span class="method-click-advice">click to toggle source</span>
|
486
|
+
|
417
487
|
</div>
|
418
488
|
|
419
489
|
|
@@ -421,6 +491,7 @@
|
|
421
491
|
|
422
492
|
<p>ログイン状態かどうかを返します</p>
|
423
493
|
|
494
|
+
|
424
495
|
|
425
496
|
|
426
497
|
<div class="method-source-code" id="login-3F-source">
|
@@ -443,7 +514,9 @@
|
|
443
514
|
<div class="method-heading">
|
444
515
|
<span class="method-name">logout</span><span
|
445
516
|
class="method-args">()</span>
|
517
|
+
|
446
518
|
<span class="method-click-advice">click to toggle source</span>
|
519
|
+
|
447
520
|
</div>
|
448
521
|
|
449
522
|
|
@@ -451,6 +524,7 @@
|
|
451
524
|
|
452
525
|
<p>ログアウトします</p>
|
453
526
|
|
527
|
+
|
454
528
|
|
455
529
|
|
456
530
|
<div class="method-source-code" id="logout-source">
|
@@ -475,7 +549,9 @@
|
|
475
549
|
<div class="method-heading">
|
476
550
|
<span class="method-name">save</span><span
|
477
551
|
class="method-args">()</span>
|
552
|
+
|
478
553
|
<span class="method-click-advice">click to toggle source</span>
|
554
|
+
|
479
555
|
</div>
|
480
556
|
|
481
557
|
|
@@ -483,10 +559,11 @@
|
|
483
559
|
|
484
560
|
<p>スプレッドシートにここまでの変更を反映します。 saveを呼ぶまでは、実際にスプレッドシートには書き込まれません。</p>
|
485
561
|
|
562
|
+
|
486
563
|
|
487
564
|
|
488
565
|
<div class="method-source-code" id="save-source">
|
489
|
-
<pre><span class="ruby-comment"># File lib/metric_tools/spread_sheet.rb, line
|
566
|
+
<pre><span class="ruby-comment"># File lib/metric_tools/spread_sheet.rb, line 117</span>
|
490
567
|
<span class="ruby-keyword">def</span> <span class="ruby-identifier">save</span>
|
491
568
|
<span class="ruby-identifier">check_worksheet_seleced_or_raise_error</span>()
|
492
569
|
|
@@ -507,7 +584,9 @@
|
|
507
584
|
<div class="method-heading">
|
508
585
|
<span class="method-name">set_value_table</span><span
|
509
586
|
class="method-args">(table)</span>
|
587
|
+
|
510
588
|
<span class="method-click-advice">click to toggle source</span>
|
589
|
+
|
511
590
|
</div>
|
512
591
|
|
513
592
|
|
@@ -515,10 +594,11 @@
|
|
515
594
|
|
516
595
|
<p>Tableクラスの内容を、スプレッドシートに書き出します。</p>
|
517
596
|
|
597
|
+
|
518
598
|
|
519
599
|
|
520
600
|
<div class="method-source-code" id="set_value_table-source">
|
521
|
-
<pre><span class="ruby-comment"># File lib/metric_tools/spread_sheet.rb, line
|
601
|
+
<pre><span class="ruby-comment"># File lib/metric_tools/spread_sheet.rb, line 104</span>
|
522
602
|
<span class="ruby-keyword">def</span> <span class="ruby-identifier">set_value_table</span>(<span class="ruby-identifier">table</span>)
|
523
603
|
<span class="ruby-identifier">check_worksheet_seleced_or_raise_error</span>()
|
524
604
|
|
@@ -537,6 +617,43 @@
|
|
537
617
|
</div><!-- set_value_table-method -->
|
538
618
|
|
539
619
|
|
620
|
+
<div id="method-c-width" class="method-detail ">
|
621
|
+
|
622
|
+
<div class="method-heading">
|
623
|
+
<span class="method-name">width</span><span
|
624
|
+
class="method-args">()</span>
|
625
|
+
|
626
|
+
<span class="method-click-advice">click to toggle source</span>
|
627
|
+
|
628
|
+
</div>
|
629
|
+
|
630
|
+
|
631
|
+
<div class="method-description">
|
632
|
+
|
633
|
+
<p>ワークシートの幅を返します</p>
|
634
|
+
|
635
|
+
|
636
|
+
|
637
|
+
|
638
|
+
<div class="method-source-code" id="width-source">
|
639
|
+
<pre><span class="ruby-comment"># File lib/metric_tools/spread_sheet.rb, line 62</span>
|
640
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">width</span>
|
641
|
+
<span class="ruby-identifier">max</span> = <span class="ruby-value">0</span>
|
642
|
+
<span class="ruby-ivar">@worksheet</span>.<span class="ruby-identifier">cells</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">coord</span>, <span class="ruby-identifier">val</span><span class="ruby-operator">|</span>
|
643
|
+
<span class="ruby-identifier">max</span> = <span class="ruby-identifier">coord</span>[<span class="ruby-value">1</span>] <span class="ruby-keyword">if</span> <span class="ruby-identifier">coord</span>[<span class="ruby-value">1</span>] <span class="ruby-operator">>=</span> <span class="ruby-identifier">max</span>
|
644
|
+
<span class="ruby-keyword">end</span>
|
645
|
+
<span class="ruby-identifier">max</span>
|
646
|
+
<span class="ruby-keyword">end</span></pre>
|
647
|
+
</div><!-- width-source -->
|
648
|
+
|
649
|
+
</div>
|
650
|
+
|
651
|
+
|
652
|
+
|
653
|
+
|
654
|
+
</div><!-- width-method -->
|
655
|
+
|
656
|
+
|
540
657
|
</section><!-- public-class-method-details -->
|
541
658
|
|
542
659
|
</section><!-- 5Buntitled-5D -->
|
@@ -546,7 +663,7 @@
|
|
546
663
|
|
547
664
|
<footer id="validator-badges">
|
548
665
|
<p><a href="http://validator.w3.org/check/referer">[Validate]</a>
|
549
|
-
<p>Generated by <a href="https://github.com/rdoc/rdoc">RDoc</a>
|
666
|
+
<p>Generated by <a href="https://github.com/rdoc/rdoc">RDoc</a> 4.0.0.
|
550
667
|
<p>Generated with the <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish Rdoc Generator</a> 3.
|
551
668
|
</footer>
|
552
669
|
|
data/doc/MetricTools/Table.html
CHANGED
@@ -43,6 +43,8 @@
|
|
43
43
|
</nav>
|
44
44
|
|
45
45
|
|
46
|
+
|
47
|
+
|
46
48
|
<div id="file-metadata">
|
47
49
|
<nav id="file-list-section" class="section">
|
48
50
|
<h3 class="section-header">Defined In</h3>
|
@@ -64,55 +66,60 @@
|
|
64
66
|
</nav>
|
65
67
|
|
66
68
|
|
69
|
+
|
67
70
|
<!-- Method Quickref -->
|
68
71
|
<nav id="method-list-section" class="section">
|
69
72
|
<h3 class="section-header">Methods</h3>
|
70
73
|
|
71
74
|
<ul class="link-list">
|
72
75
|
|
73
|
-
<li><a href="#method-c-create">::create</a>
|
76
|
+
<li ><a href="#method-c-create">::create</a>
|
77
|
+
|
78
|
+
<li ><a href="#method-c-create_with_array">::create_with_array</a>
|
79
|
+
|
80
|
+
<li ><a href="#method-c-new">::new</a>
|
74
81
|
|
75
|
-
<li><a href="#method-
|
82
|
+
<li ><a href="#method-i-5B-5D">#[]</a>
|
76
83
|
|
77
|
-
<li><a href="#method-
|
84
|
+
<li ><a href="#method-i-5B-5D-3D">#[]=</a>
|
78
85
|
|
79
|
-
<li><a href="#method-i-
|
86
|
+
<li ><a href="#method-i-add_below">#add_below</a>
|
80
87
|
|
81
|
-
<li><a href="#method-i-
|
88
|
+
<li ><a href="#method-i-build">#build</a>
|
82
89
|
|
83
|
-
<li><a href="#method-i-
|
90
|
+
<li ><a href="#method-i-collect">#collect</a>
|
84
91
|
|
85
|
-
<li><a href="#method-i-
|
92
|
+
<li ><a href="#method-i-cols">#cols</a>
|
86
93
|
|
87
|
-
<li><a href="#method-i-
|
94
|
+
<li ><a href="#method-i-each">#each</a>
|
88
95
|
|
89
|
-
<li><a href="#method-i-
|
96
|
+
<li ><a href="#method-i-each_with_index">#each_with_index</a>
|
90
97
|
|
91
|
-
<li><a href="#method-i-
|
98
|
+
<li ><a href="#method-i-header">#header</a>
|
92
99
|
|
93
|
-
<li><a href="#method-i-
|
100
|
+
<li ><a href="#method-i-height">#height</a>
|
94
101
|
|
95
|
-
<li><a href="#method-i-
|
102
|
+
<li ><a href="#method-i-output_csv_file">#output_csv_file</a>
|
96
103
|
|
97
|
-
<li><a href="#method-i-
|
104
|
+
<li ><a href="#method-i-output_file_with_seperator">#output_file_with_seperator</a>
|
98
105
|
|
99
|
-
<li><a href="#method-i-
|
106
|
+
<li ><a href="#method-i-output_tsv_file">#output_tsv_file</a>
|
100
107
|
|
101
|
-
<li><a href="#method-i-
|
108
|
+
<li ><a href="#method-i-print_csv">#print_csv</a>
|
102
109
|
|
103
|
-
<li><a href="#method-i-
|
110
|
+
<li ><a href="#method-i-print_for_docs">#print_for_docs</a>
|
104
111
|
|
105
|
-
<li><a href="#method-i-
|
112
|
+
<li ><a href="#method-i-print_pretty">#print_pretty</a>
|
106
113
|
|
107
|
-
<li><a href="#method-i-
|
114
|
+
<li ><a href="#method-i-print_with_seperator">#print_with_seperator</a>
|
108
115
|
|
109
|
-
<li><a href="#method-i-
|
116
|
+
<li ><a href="#method-i-rows">#rows</a>
|
110
117
|
|
111
|
-
<li><a href="#method-i-
|
118
|
+
<li ><a href="#method-i-to_a">#to_a</a>
|
112
119
|
|
113
|
-
<li><a href="#method-i-
|
120
|
+
<li ><a href="#method-i-to_obj">#to_obj</a>
|
114
121
|
|
115
|
-
<li><a href="#method-i-width">#width</a>
|
122
|
+
<li ><a href="#method-i-width">#width</a>
|
116
123
|
|
117
124
|
</ul>
|
118
125
|
</nav>
|
@@ -127,8 +134,14 @@
|
|
127
134
|
|
128
135
|
<li class="file"><a href="../Gemfile.html">Gemfile</a>
|
129
136
|
|
137
|
+
<li class="file"><a href="../README_md.html">README</a>
|
138
|
+
|
130
139
|
<li class="file"><a href="../config/my_pref.html">my_pref</a>
|
131
140
|
|
141
|
+
<li class="file"><a href="../doc/created_rid.html">created.rid</a>
|
142
|
+
|
143
|
+
<li class="file"><a href="../metric_tools_gemspec.html">metric_tools.gemspec</a>
|
144
|
+
|
132
145
|
</ul>
|
133
146
|
</nav>
|
134
147
|
|
@@ -137,28 +150,28 @@
|
|
137
150
|
|
138
151
|
<ul class="link-list">
|
139
152
|
|
153
|
+
<li><a href="../AWS.html">AWS</a>
|
154
|
+
|
155
|
+
<li><a href="../AWS/S3.html">AWS::S3</a>
|
156
|
+
|
140
157
|
<li><a href="../MetricTools.html">MetricTools</a>
|
141
158
|
|
142
159
|
<li><a href="../MetricTools/IndexTree.html">MetricTools::IndexTree</a>
|
143
160
|
|
144
161
|
<li><a href="../MetricTools/S3.html">MetricTools::S3</a>
|
145
162
|
|
146
|
-
<li><a href="../MetricTools/Skype.html">MetricTools::Skype</a>
|
147
|
-
|
148
163
|
<li><a href="../MetricTools/SpreadSheet.html">MetricTools::SpreadSheet</a>
|
149
164
|
|
150
165
|
<li><a href="../MetricTools/Table.html">MetricTools::Table</a>
|
151
166
|
|
167
|
+
<li><a href="../Object.html">Object</a>
|
168
|
+
|
152
169
|
<li><a href="../Pref.html">Pref</a>
|
153
170
|
|
154
171
|
<li><a href="../Pref/GoogleDocs.html">Pref::GoogleDocs</a>
|
155
172
|
|
156
173
|
<li><a href="../Pref/S3.html">Pref::S3</a>
|
157
174
|
|
158
|
-
<li><a href="../Pref/Skype.html">Pref::Skype</a>
|
159
|
-
|
160
|
-
<li><a href="../Object.html">Object</a>
|
161
|
-
|
162
175
|
</ul>
|
163
176
|
</nav>
|
164
177
|
|
@@ -197,7 +210,9 @@
|
|
197
210
|
<div class="method-heading">
|
198
211
|
<span class="method-name">create</span><span
|
199
212
|
class="method-args">(rows, cols, &proc)</span>
|
213
|
+
|
200
214
|
<span class="method-click-advice">click to toggle source</span>
|
215
|
+
|
201
216
|
</div>
|
202
217
|
|
203
218
|
|
@@ -212,13 +227,14 @@
|
|
212
227
|
}
|
213
228
|
</pre>
|
214
229
|
|
230
|
+
|
215
231
|
|
216
232
|
|
217
233
|
<div class="method-source-code" id="create-source">
|
218
234
|
<pre><span class="ruby-comment"># File lib/metric_tools/table.rb, line 23</span>
|
219
|
-
<span class="ruby-keyword">def</span> <span class="ruby-identifier">create</span>(<span class="ruby-identifier">rows</span>, <span class="ruby-identifier">cols</span>,
|
235
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">create</span>(<span class="ruby-identifier">rows</span>, <span class="ruby-identifier">cols</span>, <span class="ruby-operator">&</span><span class="ruby-identifier">proc</span>)
|
220
236
|
<span class="ruby-identifier">table</span> = <span class="ruby-constant">Table</span>.<span class="ruby-identifier">new</span>
|
221
|
-
<span class="ruby-identifier">table</span>.<span class="ruby-identifier">build</span>(<span class="ruby-identifier">rows</span>, <span class="ruby-identifier">cols</span>,
|
237
|
+
<span class="ruby-identifier">table</span>.<span class="ruby-identifier">build</span>(<span class="ruby-identifier">rows</span>, <span class="ruby-identifier">cols</span>, <span class="ruby-operator">&</span><span class="ruby-identifier">proc</span>)
|
222
238
|
<span class="ruby-keyword">end</span></pre>
|
223
239
|
</div><!-- create-source -->
|
224
240
|
|
@@ -235,7 +251,9 @@
|
|
235
251
|
<div class="method-heading">
|
236
252
|
<span class="method-name">create_with_array</span><span
|
237
253
|
class="method-args">(array)</span>
|
254
|
+
|
238
255
|
<span class="method-click-advice">click to toggle source</span>
|
256
|
+
|
239
257
|
</div>
|
240
258
|
|
241
259
|
|
@@ -248,6 +266,7 @@
|
|
248
266
|
<pre>array = [[1, 2, 3], [4, 5, 6], [9, 0, '#']]
|
249
267
|
Table.create_with_array(array)</pre>
|
250
268
|
|
269
|
+
|
251
270
|
|
252
271
|
|
253
272
|
<div class="method-source-code" id="create_with_array-source">
|
@@ -272,7 +291,9 @@ Table.create_with_array(array)</pre>
|
|
272
291
|
<div class="method-heading">
|
273
292
|
<span class="method-name">new</span><span
|
274
293
|
class="method-args">()</span>
|
294
|
+
|
275
295
|
<span class="method-click-advice">click to toggle source</span>
|
296
|
+
|
276
297
|
</div>
|
277
298
|
|
278
299
|
|
@@ -280,6 +301,7 @@ Table.create_with_array(array)</pre>
|
|
280
301
|
|
281
302
|
|
282
303
|
|
304
|
+
|
283
305
|
|
284
306
|
|
285
307
|
<div class="method-source-code" id="new-source">
|
@@ -308,7 +330,9 @@ Table.create_with_array(array)</pre>
|
|
308
330
|
<div class="method-heading">
|
309
331
|
<span class="method-name">[]</span><span
|
310
332
|
class="method-args">(i, j)</span>
|
333
|
+
|
311
334
|
<span class="method-click-advice">click to toggle source</span>
|
335
|
+
|
312
336
|
</div>
|
313
337
|
|
314
338
|
|
@@ -318,6 +342,7 @@ Table.create_with_array(array)</pre>
|
|
318
342
|
|
319
343
|
<pre>table[1, 10]</pre>
|
320
344
|
|
345
|
+
|
321
346
|
|
322
347
|
|
323
348
|
<div class="method-source-code" id="5B-5D-source">
|
@@ -340,7 +365,9 @@ Table.create_with_array(array)</pre>
|
|
340
365
|
<div class="method-heading">
|
341
366
|
<span class="method-name">[]=</span><span
|
342
367
|
class="method-args">(i, j, val)</span>
|
368
|
+
|
343
369
|
<span class="method-click-advice">click to toggle source</span>
|
370
|
+
|
344
371
|
</div>
|
345
372
|
|
346
373
|
|
@@ -350,6 +377,7 @@ Table.create_with_array(array)</pre>
|
|
350
377
|
|
351
378
|
<pre>table[1, 10] = val</pre>
|
352
379
|
|
380
|
+
|
353
381
|
|
354
382
|
|
355
383
|
<div class="method-source-code" id="5B-5D-3D-source">
|
@@ -374,7 +402,9 @@ Table.create_with_array(array)</pre>
|
|
374
402
|
<div class="method-heading">
|
375
403
|
<span class="method-name">add_below</span><span
|
376
404
|
class="method-args">(table)</span>
|
405
|
+
|
377
406
|
<span class="method-click-advice">click to toggle source</span>
|
407
|
+
|
378
408
|
</div>
|
379
409
|
|
380
410
|
|
@@ -382,6 +412,7 @@ Table.create_with_array(array)</pre>
|
|
382
412
|
|
383
413
|
|
384
414
|
|
415
|
+
|
385
416
|
|
386
417
|
|
387
418
|
<div class="method-source-code" id="add_below-source">
|
@@ -407,7 +438,9 @@ Table.create_with_array(array)</pre>
|
|
407
438
|
<div class="method-heading">
|
408
439
|
<span class="method-name">build</span><span
|
409
440
|
class="method-args">(rows, cols, &proc)</span>
|
441
|
+
|
410
442
|
<span class="method-click-advice">click to toggle source</span>
|
443
|
+
|
411
444
|
</div>
|
412
445
|
|
413
446
|
|
@@ -415,11 +448,12 @@ Table.create_with_array(array)</pre>
|
|
415
448
|
|
416
449
|
|
417
450
|
|
451
|
+
|
418
452
|
|
419
453
|
|
420
454
|
<div class="method-source-code" id="build-source">
|
421
|
-
<pre><span class="ruby-comment"># File lib/metric_tools/table.rb, line
|
422
|
-
<span class="ruby-keyword">def</span> <span class="ruby-identifier">build</span>(<span class="ruby-identifier">rows</span>, <span class="ruby-identifier">cols</span>,
|
455
|
+
<pre><span class="ruby-comment"># File lib/metric_tools/table.rb, line 243</span>
|
456
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">build</span>(<span class="ruby-identifier">rows</span>, <span class="ruby-identifier">cols</span>, <span class="ruby-operator">&</span><span class="ruby-identifier">proc</span>)
|
423
457
|
<span class="ruby-keyword">for</span> <span class="ruby-identifier">i</span> <span class="ruby-keyword">in</span> <span class="ruby-value">0</span><span class="ruby-operator">..</span><span class="ruby-identifier">rows</span><span class="ruby-operator">-</span><span class="ruby-value">1</span>
|
424
458
|
<span class="ruby-keyword">for</span> <span class="ruby-identifier">j</span> <span class="ruby-keyword">in</span> <span class="ruby-value">0</span><span class="ruby-operator">..</span><span class="ruby-identifier">cols</span><span class="ruby-operator">-</span><span class="ruby-value">1</span>
|
425
459
|
<span class="ruby-ivar">@_inner_data</span>[<span class="ruby-identifier">index_to_key</span>(<span class="ruby-identifier">i</span>, <span class="ruby-identifier">j</span>)] = <span class="ruby-identifier">proc</span>.<span class="ruby-identifier">call</span>(<span class="ruby-identifier">i</span>, <span class="ruby-identifier">j</span>)
|
@@ -442,7 +476,9 @@ Table.create_with_array(array)</pre>
|
|
442
476
|
<div class="method-heading">
|
443
477
|
<span class="method-name">collect</span><span
|
444
478
|
class="method-args">(&proc)</span>
|
479
|
+
|
445
480
|
<span class="method-click-advice">click to toggle source</span>
|
481
|
+
|
446
482
|
</div>
|
447
483
|
|
448
484
|
|
@@ -450,11 +486,12 @@ Table.create_with_array(array)</pre>
|
|
450
486
|
|
451
487
|
|
452
488
|
|
489
|
+
|
453
490
|
|
454
491
|
|
455
492
|
<div class="method-source-code" id="collect-source">
|
456
|
-
<pre><span class="ruby-comment"># File lib/metric_tools/table.rb, line
|
457
|
-
<span class="ruby-keyword">def</span> <span class="ruby-identifier">collect</span>(
|
493
|
+
<pre><span class="ruby-comment"># File lib/metric_tools/table.rb, line 179</span>
|
494
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">collect</span>(<span class="ruby-operator">&</span><span class="ruby-identifier">proc</span>)
|
458
495
|
<span class="ruby-identifier">new_one</span> = <span class="ruby-constant">Table</span>.<span class="ruby-identifier">create</span>(<span class="ruby-keyword">self</span>.<span class="ruby-identifier">rows</span>, <span class="ruby-keyword">self</span>.<span class="ruby-identifier">cols</span>){<span class="ruby-operator">|</span><span class="ruby-identifier">i</span>, <span class="ruby-identifier">j</span><span class="ruby-operator">|</span>
|
459
496
|
<span class="ruby-identifier">proc</span>.<span class="ruby-identifier">call</span>(<span class="ruby-keyword">self</span>[<span class="ruby-identifier">i</span>, <span class="ruby-identifier">j</span>], <span class="ruby-identifier">i</span>, <span class="ruby-identifier">j</span>)
|
460
497
|
}
|
@@ -475,7 +512,9 @@ Table.create_with_array(array)</pre>
|
|
475
512
|
<div class="method-heading">
|
476
513
|
<span class="method-name">cols</span><span
|
477
514
|
class="method-args">()</span>
|
515
|
+
|
478
516
|
<span class="method-click-advice">click to toggle source</span>
|
517
|
+
|
479
518
|
</div>
|
480
519
|
|
481
520
|
|
@@ -483,6 +522,7 @@ Table.create_with_array(array)</pre>
|
|
483
522
|
|
484
523
|
<p>tableの幅(列数)を取得します</p>
|
485
524
|
|
525
|
+
|
486
526
|
|
487
527
|
|
488
528
|
<div class="method-source-code" id="cols-source">
|
@@ -505,7 +545,9 @@ Table.create_with_array(array)</pre>
|
|
505
545
|
<div class="method-heading">
|
506
546
|
<span class="method-name">each</span><span
|
507
547
|
class="method-args">(&proc)</span>
|
548
|
+
|
508
549
|
<span class="method-click-advice">click to toggle source</span>
|
550
|
+
|
509
551
|
</div>
|
510
552
|
|
511
553
|
|
@@ -518,11 +560,12 @@ Table.create_with_array(array)</pre>
|
|
518
560
|
}
|
519
561
|
</pre>
|
520
562
|
|
563
|
+
|
521
564
|
|
522
565
|
|
523
566
|
<div class="method-source-code" id="each-source">
|
524
|
-
<pre><span class="ruby-comment"># File lib/metric_tools/table.rb, line
|
525
|
-
<span class="ruby-keyword">def</span> <span class="ruby-identifier">each</span>(
|
567
|
+
<pre><span class="ruby-comment"># File lib/metric_tools/table.rb, line 160</span>
|
568
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">each</span>(<span class="ruby-operator">&</span><span class="ruby-identifier">proc</span>)
|
526
569
|
<span class="ruby-ivar">@_inner_data</span>.<span class="ruby-identifier">keys</span>.<span class="ruby-identifier">each</span>{<span class="ruby-operator">|</span><span class="ruby-identifier">key</span><span class="ruby-operator">|</span>
|
527
570
|
<span class="ruby-identifier">proc</span>.<span class="ruby-identifier">call</span>(<span class="ruby-ivar">@_inner_data</span>[<span class="ruby-identifier">key</span>])
|
528
571
|
}
|
@@ -542,7 +585,9 @@ Table.create_with_array(array)</pre>
|
|
542
585
|
<div class="method-heading">
|
543
586
|
<span class="method-name">each_with_index</span><span
|
544
587
|
class="method-args">(&proc)</span>
|
588
|
+
|
545
589
|
<span class="method-click-advice">click to toggle source</span>
|
590
|
+
|
546
591
|
</div>
|
547
592
|
|
548
593
|
|
@@ -551,15 +596,16 @@ Table.create_with_array(array)</pre>
|
|
551
596
|
<p>全データに対して処理を行います。(i, j)にデータの座標が入ります。</p>
|
552
597
|
|
553
598
|
<pre class="ruby"><span class="ruby-identifier">table</span>.<span class="ruby-identifier">each</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">cell</span>, <span class="ruby-identifier">i</span>, <span class="ruby-identifier">j</span><span class="ruby-operator">|</span>
|
554
|
-
<span class="ruby-identifier">cell</span> = <span class="ruby-identifier">i</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">j</span>
|
599
|
+
<span class="ruby-identifier">cell</span> = <span class="ruby-identifier">i</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">j</span> <span class="ruby-operator">*</span> <span class="ruby-identifier">table</span>.<span class="ruby-identifier">width</span>
|
555
600
|
}
|
556
601
|
</pre>
|
557
602
|
|
603
|
+
|
558
604
|
|
559
605
|
|
560
606
|
<div class="method-source-code" id="each_with_index-source">
|
561
|
-
<pre><span class="ruby-comment"># File lib/metric_tools/table.rb, line
|
562
|
-
<span class="ruby-keyword">def</span> <span class="ruby-identifier">each_with_index</span>(
|
607
|
+
<pre><span class="ruby-comment"># File lib/metric_tools/table.rb, line 172</span>
|
608
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">each_with_index</span>(<span class="ruby-operator">&</span><span class="ruby-identifier">proc</span>)
|
563
609
|
<span class="ruby-ivar">@_inner_data</span>.<span class="ruby-identifier">keys</span>.<span class="ruby-identifier">each</span>{<span class="ruby-operator">|</span><span class="ruby-identifier">key</span><span class="ruby-operator">|</span>
|
564
610
|
<span class="ruby-identifier">i</span>, <span class="ruby-identifier">j</span> = <span class="ruby-identifier">key_to_index</span>(<span class="ruby-identifier">key</span>)
|
565
611
|
<span class="ruby-identifier">proc</span>.<span class="ruby-identifier">call</span>(<span class="ruby-ivar">@_inner_data</span>[<span class="ruby-identifier">key</span>], <span class="ruby-identifier">i</span>, <span class="ruby-identifier">j</span>)
|
@@ -575,12 +621,51 @@ Table.create_with_array(array)</pre>
|
|
575
621
|
</div><!-- each_with_index-method -->
|
576
622
|
|
577
623
|
|
624
|
+
<div id="method-i-header" class="method-detail ">
|
625
|
+
|
626
|
+
<div class="method-heading">
|
627
|
+
<span class="method-name">header</span><span
|
628
|
+
class="method-args">()</span>
|
629
|
+
|
630
|
+
<span class="method-click-advice">click to toggle source</span>
|
631
|
+
|
632
|
+
</div>
|
633
|
+
|
634
|
+
|
635
|
+
<div class="method-description">
|
636
|
+
|
637
|
+
<p>一行目を配列で返します</p>
|
638
|
+
|
639
|
+
|
640
|
+
|
641
|
+
|
642
|
+
<div class="method-source-code" id="header-source">
|
643
|
+
<pre><span class="ruby-comment"># File lib/metric_tools/table.rb, line 110</span>
|
644
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">header</span>
|
645
|
+
<span class="ruby-identifier">ret</span> = []
|
646
|
+
<span class="ruby-keyword">for</span> <span class="ruby-identifier">i</span> <span class="ruby-keyword">in</span> <span class="ruby-value">0</span><span class="ruby-operator">...</span><span class="ruby-keyword">self</span>.<span class="ruby-identifier">width</span>
|
647
|
+
<span class="ruby-identifier">ret</span>[<span class="ruby-identifier">i</span>] = <span class="ruby-keyword">self</span>[<span class="ruby-value">0</span>, <span class="ruby-identifier">i</span>]
|
648
|
+
<span class="ruby-keyword">end</span>
|
649
|
+
<span class="ruby-identifier">ret</span>
|
650
|
+
<span class="ruby-keyword">end</span></pre>
|
651
|
+
</div><!-- header-source -->
|
652
|
+
|
653
|
+
</div>
|
654
|
+
|
655
|
+
|
656
|
+
|
657
|
+
|
658
|
+
</div><!-- header-method -->
|
659
|
+
|
660
|
+
|
578
661
|
<div id="method-i-height" class="method-detail ">
|
579
662
|
|
580
663
|
<div class="method-heading">
|
581
664
|
<span class="method-name">height</span><span
|
582
665
|
class="method-args">()</span>
|
666
|
+
|
583
667
|
<span class="method-click-advice">click to toggle source</span>
|
668
|
+
|
584
669
|
</div>
|
585
670
|
|
586
671
|
|
@@ -588,6 +673,7 @@ Table.create_with_array(array)</pre>
|
|
588
673
|
|
589
674
|
<p>tableの高さ(行数)を取得します</p>
|
590
675
|
|
676
|
+
|
591
677
|
|
592
678
|
|
593
679
|
<div class="method-source-code" id="height-source">
|
@@ -615,7 +701,9 @@ Table.create_with_array(array)</pre>
|
|
615
701
|
<div class="method-heading">
|
616
702
|
<span class="method-name">output_csv_file</span><span
|
617
703
|
class="method-args">(path)</span>
|
704
|
+
|
618
705
|
<span class="method-click-advice">click to toggle source</span>
|
706
|
+
|
619
707
|
</div>
|
620
708
|
|
621
709
|
|
@@ -623,10 +711,11 @@ Table.create_with_array(array)</pre>
|
|
623
711
|
|
624
712
|
<p>csvファイルとして出力します</p>
|
625
713
|
|
714
|
+
|
626
715
|
|
627
716
|
|
628
717
|
<div class="method-source-code" id="output_csv_file-source">
|
629
|
-
<pre><span class="ruby-comment"># File lib/metric_tools/table.rb, line
|
718
|
+
<pre><span class="ruby-comment"># File lib/metric_tools/table.rb, line 218</span>
|
630
719
|
<span class="ruby-keyword">def</span> <span class="ruby-identifier">output_csv_file</span>(<span class="ruby-identifier">path</span>)
|
631
720
|
<span class="ruby-identifier">output_file_with_seperator</span>(<span class="ruby-string">","</span>, <span class="ruby-identifier">path</span>)
|
632
721
|
<span class="ruby-keyword">end</span></pre>
|
@@ -645,7 +734,9 @@ Table.create_with_array(array)</pre>
|
|
645
734
|
<div class="method-heading">
|
646
735
|
<span class="method-name">output_file_with_seperator</span><span
|
647
736
|
class="method-args">(s, path)</span>
|
737
|
+
|
648
738
|
<span class="method-click-advice">click to toggle source</span>
|
739
|
+
|
649
740
|
</div>
|
650
741
|
|
651
742
|
|
@@ -653,10 +744,11 @@ Table.create_with_array(array)</pre>
|
|
653
744
|
|
654
745
|
|
655
746
|
|
747
|
+
|
656
748
|
|
657
749
|
|
658
750
|
<div class="method-source-code" id="output_file_with_seperator-source">
|
659
|
-
<pre><span class="ruby-comment"># File lib/metric_tools/table.rb, line
|
751
|
+
<pre><span class="ruby-comment"># File lib/metric_tools/table.rb, line 229</span>
|
660
752
|
<span class="ruby-keyword">def</span> <span class="ruby-identifier">output_file_with_seperator</span>(<span class="ruby-identifier">s</span>, <span class="ruby-identifier">path</span>)
|
661
753
|
<span class="ruby-identifier">puts</span> <span class="ruby-node">"start output >> #{path}..."</span>
|
662
754
|
|
@@ -685,7 +777,9 @@ Table.create_with_array(array)</pre>
|
|
685
777
|
<div class="method-heading">
|
686
778
|
<span class="method-name">output_tsv_file</span><span
|
687
779
|
class="method-args">(path)</span>
|
780
|
+
|
688
781
|
<span class="method-click-advice">click to toggle source</span>
|
782
|
+
|
689
783
|
</div>
|
690
784
|
|
691
785
|
|
@@ -693,10 +787,11 @@ Table.create_with_array(array)</pre>
|
|
693
787
|
|
694
788
|
<p>tsvファイルとして出力します</p>
|
695
789
|
|
790
|
+
|
696
791
|
|
697
792
|
|
698
793
|
<div class="method-source-code" id="output_tsv_file-source">
|
699
|
-
<pre><span class="ruby-comment"># File lib/metric_tools/table.rb, line
|
794
|
+
<pre><span class="ruby-comment"># File lib/metric_tools/table.rb, line 225</span>
|
700
795
|
<span class="ruby-keyword">def</span> <span class="ruby-identifier">output_tsv_file</span>(<span class="ruby-identifier">path</span>)
|
701
796
|
<span class="ruby-identifier">output_file_with_seperator</span>(<span class="ruby-string">"\t"</span>, <span class="ruby-identifier">path</span>)
|
702
797
|
<span class="ruby-keyword">end</span></pre>
|
@@ -715,7 +810,9 @@ Table.create_with_array(array)</pre>
|
|
715
810
|
<div class="method-heading">
|
716
811
|
<span class="method-name">print_csv</span><span
|
717
812
|
class="method-args">()</span>
|
813
|
+
|
718
814
|
<span class="method-click-advice">click to toggle source</span>
|
815
|
+
|
719
816
|
</div>
|
720
817
|
|
721
818
|
|
@@ -723,10 +820,11 @@ Table.create_with_array(array)</pre>
|
|
723
820
|
|
724
821
|
<p>コンソールにcsv形式で出力します</p>
|
725
822
|
|
823
|
+
|
726
824
|
|
727
825
|
|
728
826
|
<div class="method-source-code" id="print_csv-source">
|
729
|
-
<pre><span class="ruby-comment"># File lib/metric_tools/table.rb, line
|
827
|
+
<pre><span class="ruby-comment"># File lib/metric_tools/table.rb, line 198</span>
|
730
828
|
<span class="ruby-keyword">def</span> <span class="ruby-identifier">print_csv</span>
|
731
829
|
<span class="ruby-identifier">print_with_seperator</span>(<span class="ruby-string">","</span>)
|
732
830
|
<span class="ruby-keyword">end</span></pre>
|
@@ -745,7 +843,9 @@ Table.create_with_array(array)</pre>
|
|
745
843
|
<div class="method-heading">
|
746
844
|
<span class="method-name">print_for_docs</span><span
|
747
845
|
class="method-args">()</span>
|
846
|
+
|
748
847
|
<span class="method-click-advice">click to toggle source</span>
|
848
|
+
|
749
849
|
</div>
|
750
850
|
|
751
851
|
|
@@ -753,10 +853,11 @@ Table.create_with_array(array)</pre>
|
|
753
853
|
|
754
854
|
<p>コンソールにtsv形式で出力します</p>
|
755
855
|
|
856
|
+
|
756
857
|
|
757
858
|
|
758
859
|
<div class="method-source-code" id="print_for_docs-source">
|
759
|
-
<pre><span class="ruby-comment"># File lib/metric_tools/table.rb, line
|
860
|
+
<pre><span class="ruby-comment"># File lib/metric_tools/table.rb, line 205</span>
|
760
861
|
<span class="ruby-keyword">def</span> <span class="ruby-identifier">print_for_docs</span>
|
761
862
|
<span class="ruby-identifier">print_with_seperator</span>(<span class="ruby-string">"\t"</span>)
|
762
863
|
<span class="ruby-keyword">end</span></pre>
|
@@ -775,7 +876,9 @@ Table.create_with_array(array)</pre>
|
|
775
876
|
<div class="method-heading">
|
776
877
|
<span class="method-name">print_pretty</span><span
|
777
878
|
class="method-args">()</span>
|
879
|
+
|
778
880
|
<span class="method-click-advice">click to toggle source</span>
|
881
|
+
|
779
882
|
</div>
|
780
883
|
|
781
884
|
|
@@ -783,10 +886,11 @@ Table.create_with_array(array)</pre>
|
|
783
886
|
|
784
887
|
<p>コンソールに綺麗な表形式で出力します(Hirbを使用)</p>
|
785
888
|
|
889
|
+
|
786
890
|
|
787
891
|
|
788
892
|
<div class="method-source-code" id="print_pretty-source">
|
789
|
-
<pre><span class="ruby-comment"># File lib/metric_tools/table.rb, line
|
893
|
+
<pre><span class="ruby-comment"># File lib/metric_tools/table.rb, line 191</span>
|
790
894
|
<span class="ruby-keyword">def</span> <span class="ruby-identifier">print_pretty</span>
|
791
895
|
<span class="ruby-identifier">puts</span> <span class="ruby-constant">Hirb</span><span class="ruby-operator">::</span><span class="ruby-constant">Helpers</span><span class="ruby-operator">::</span><span class="ruby-constant">Table</span>.<span class="ruby-identifier">render</span> <span class="ruby-ivar">@data</span>, <span class="ruby-value">:headers</span> =<span class="ruby-operator">></span> <span class="ruby-ivar">@headers</span>, <span class="ruby-value">:resize</span> =<span class="ruby-operator">></span> <span class="ruby-keyword">false</span>
|
792
896
|
<span class="ruby-keyword">end</span></pre>
|
@@ -805,7 +909,9 @@ Table.create_with_array(array)</pre>
|
|
805
909
|
<div class="method-heading">
|
806
910
|
<span class="method-name">print_with_seperator</span><span
|
807
911
|
class="method-args">(s)</span>
|
912
|
+
|
808
913
|
<span class="method-click-advice">click to toggle source</span>
|
914
|
+
|
809
915
|
</div>
|
810
916
|
|
811
917
|
|
@@ -813,10 +919,11 @@ Table.create_with_array(array)</pre>
|
|
813
919
|
|
814
920
|
|
815
921
|
|
922
|
+
|
816
923
|
|
817
924
|
|
818
925
|
<div class="method-source-code" id="print_with_seperator-source">
|
819
|
-
<pre><span class="ruby-comment"># File lib/metric_tools/table.rb, line
|
926
|
+
<pre><span class="ruby-comment"># File lib/metric_tools/table.rb, line 209</span>
|
820
927
|
<span class="ruby-keyword">def</span> <span class="ruby-identifier">print_with_seperator</span>(<span class="ruby-identifier">s</span>)
|
821
928
|
<span class="ruby-identifier">to_a</span>.<span class="ruby-identifier">each</span>{<span class="ruby-operator">|</span><span class="ruby-identifier">row</span><span class="ruby-operator">|</span>
|
822
929
|
<span class="ruby-identifier">puts</span> <span class="ruby-identifier">row</span>.<span class="ruby-identifier">join</span>(<span class="ruby-identifier">s</span>)
|
@@ -837,7 +944,9 @@ Table.create_with_array(array)</pre>
|
|
837
944
|
<div class="method-heading">
|
838
945
|
<span class="method-name">rows</span><span
|
839
946
|
class="method-args">()</span>
|
947
|
+
|
840
948
|
<span class="method-click-advice">click to toggle source</span>
|
949
|
+
|
841
950
|
</div>
|
842
951
|
|
843
952
|
|
@@ -845,6 +954,7 @@ Table.create_with_array(array)</pre>
|
|
845
954
|
|
846
955
|
<p>tableの高さ(行数)を取得します</p>
|
847
956
|
|
957
|
+
|
848
958
|
|
849
959
|
|
850
960
|
<div class="method-source-code" id="rows-source">
|
@@ -867,7 +977,9 @@ Table.create_with_array(array)</pre>
|
|
867
977
|
<div class="method-heading">
|
868
978
|
<span class="method-name">to_a</span><span
|
869
979
|
class="method-args">()</span>
|
980
|
+
|
870
981
|
<span class="method-click-advice">click to toggle source</span>
|
982
|
+
|
871
983
|
</div>
|
872
984
|
|
873
985
|
|
@@ -878,10 +990,11 @@ Table.create_with_array(array)</pre>
|
|
878
990
|
<pre class="ruby"><span class="ruby-identifier">table</span>.<span class="ruby-identifier">to_a</span> =<span class="ruby-operator">></span> [[<span class="ruby-value">1</span>,<span class="ruby-value">2</span>,<span class="ruby-value">3</span>], [<span class="ruby-value">4</span>,<span class="ruby-value">5</span>,<span class="ruby-value">6</span>], [<span class="ruby-value">9</span>,<span class="ruby-value">0</span>,<span class="ruby-string">'#'</span>]]
|
879
991
|
</pre>
|
880
992
|
|
993
|
+
|
881
994
|
|
882
995
|
|
883
996
|
<div class="method-source-code" id="to_a-source">
|
884
|
-
<pre><span class="ruby-comment"># File lib/metric_tools/table.rb, line
|
997
|
+
<pre><span class="ruby-comment"># File lib/metric_tools/table.rb, line 122</span>
|
885
998
|
<span class="ruby-keyword">def</span> <span class="ruby-identifier">to_a</span>
|
886
999
|
<span class="ruby-identifier">ret</span> = []
|
887
1000
|
<span class="ruby-ivar">@_inner_data</span>.<span class="ruby-identifier">each</span>{<span class="ruby-operator">|</span><span class="ruby-identifier">key</span>, <span class="ruby-identifier">val</span><span class="ruby-operator">|</span>
|
@@ -902,12 +1015,60 @@ Table.create_with_array(array)</pre>
|
|
902
1015
|
</div><!-- to_a-method -->
|
903
1016
|
|
904
1017
|
|
1018
|
+
<div id="method-i-to_obj" class="method-detail ">
|
1019
|
+
|
1020
|
+
<div class="method-heading">
|
1021
|
+
<span class="method-name">to_obj</span><span
|
1022
|
+
class="method-args">()</span>
|
1023
|
+
|
1024
|
+
<span class="method-click-advice">click to toggle source</span>
|
1025
|
+
|
1026
|
+
</div>
|
1027
|
+
|
1028
|
+
|
1029
|
+
<div class="method-description">
|
1030
|
+
|
1031
|
+
<p>一行目をkeyとしたhashのarrayとして返します。 自身は変更されません。</p>
|
1032
|
+
|
1033
|
+
|
1034
|
+
|
1035
|
+
|
1036
|
+
<div class="method-source-code" id="to_obj-source">
|
1037
|
+
<pre><span class="ruby-comment"># File lib/metric_tools/table.rb, line 137</span>
|
1038
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">to_obj</span>
|
1039
|
+
<span class="ruby-identifier">ret</span> = []
|
1040
|
+
<span class="ruby-keyword">self</span>.<span class="ruby-identifier">header</span>.<span class="ruby-identifier">each_with_index</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">key</span>, <span class="ruby-identifier">index</span><span class="ruby-operator">|</span>
|
1041
|
+
<span class="ruby-ivar">@_inner_data</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">k</span>, <span class="ruby-identifier">val</span><span class="ruby-operator">|</span>
|
1042
|
+
<span class="ruby-identifier">i</span>, <span class="ruby-identifier">j</span> = <span class="ruby-identifier">key_to_index</span>(<span class="ruby-identifier">k</span>)
|
1043
|
+
|
1044
|
+
<span class="ruby-keyword">next</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">i</span> <span class="ruby-operator">==</span> <span class="ruby-value">0</span> <span class="ruby-comment"># when header row</span>
|
1045
|
+
|
1046
|
+
<span class="ruby-keyword">if</span> <span class="ruby-identifier">j</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">index</span>
|
1047
|
+
<span class="ruby-identifier">ret</span>[<span class="ruby-identifier">i</span><span class="ruby-operator">-</span><span class="ruby-value">1</span>] <span class="ruby-operator">||=</span> {}
|
1048
|
+
<span class="ruby-identifier">ret</span>[<span class="ruby-identifier">i</span><span class="ruby-operator">-</span><span class="ruby-value">1</span>][<span class="ruby-identifier">key</span>] = <span class="ruby-identifier">val</span>
|
1049
|
+
<span class="ruby-keyword">end</span>
|
1050
|
+
<span class="ruby-keyword">end</span>
|
1051
|
+
<span class="ruby-keyword">end</span>
|
1052
|
+
<span class="ruby-identifier">ret</span>
|
1053
|
+
<span class="ruby-keyword">end</span></pre>
|
1054
|
+
</div><!-- to_obj-source -->
|
1055
|
+
|
1056
|
+
</div>
|
1057
|
+
|
1058
|
+
|
1059
|
+
|
1060
|
+
|
1061
|
+
</div><!-- to_obj-method -->
|
1062
|
+
|
1063
|
+
|
905
1064
|
<div id="method-i-width" class="method-detail ">
|
906
1065
|
|
907
1066
|
<div class="method-heading">
|
908
1067
|
<span class="method-name">width</span><span
|
909
1068
|
class="method-args">()</span>
|
1069
|
+
|
910
1070
|
<span class="method-click-advice">click to toggle source</span>
|
1071
|
+
|
911
1072
|
</div>
|
912
1073
|
|
913
1074
|
|
@@ -915,6 +1076,7 @@ Table.create_with_array(array)</pre>
|
|
915
1076
|
|
916
1077
|
<p>tableの幅(列数)を取得します</p>
|
917
1078
|
|
1079
|
+
|
918
1080
|
|
919
1081
|
|
920
1082
|
<div class="method-source-code" id="width-source">
|
@@ -946,7 +1108,7 @@ Table.create_with_array(array)</pre>
|
|
946
1108
|
|
947
1109
|
<footer id="validator-badges">
|
948
1110
|
<p><a href="http://validator.w3.org/check/referer">[Validate]</a>
|
949
|
-
<p>Generated by <a href="https://github.com/rdoc/rdoc">RDoc</a>
|
1111
|
+
<p>Generated by <a href="https://github.com/rdoc/rdoc">RDoc</a> 4.0.0.
|
950
1112
|
<p>Generated with the <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish Rdoc Generator</a> 3.
|
951
1113
|
</footer>
|
952
1114
|
|