methodchain 0.2.0 → 0.2.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,689 @@
1
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
2
+ <html lang='en' xml:lang='en' xmlns='http://www.w3.org/1999/xhtml'>
3
+ <head>
4
+ <title>lib/methodchain/not_included.rb - C0 code coverage information</title>
5
+ <style type='text/css'>body { background-color: rgb(240, 240, 245); }</style>
6
+ <style type='text/css'>span.cross-ref-title {
7
+ font-size: 140%;
8
+ }
9
+ span.cross-ref a {
10
+ text-decoration: none;
11
+ }
12
+ span.cross-ref {
13
+ background-color:#f3f7fa;
14
+ border: 1px dashed #333;
15
+ margin: 1em;
16
+ padding: 0.5em;
17
+ overflow: hidden;
18
+ }
19
+ a.crossref-toggle {
20
+ text-decoration: none;
21
+ }
22
+ span.marked0 {
23
+ background-color: rgb(185, 210, 200);
24
+ display: block;
25
+ }
26
+ span.marked1 {
27
+ background-color: rgb(190, 215, 205);
28
+ display: block;
29
+ }
30
+ span.inferred0 {
31
+ background-color: rgb(175, 200, 200);
32
+ display: block;
33
+ }
34
+ span.inferred1 {
35
+ background-color: rgb(180, 205, 205);
36
+ display: block;
37
+ }
38
+ span.uncovered0 {
39
+ background-color: rgb(225, 110, 110);
40
+ display: block;
41
+ }
42
+ span.uncovered1 {
43
+ background-color: rgb(235, 120, 120);
44
+ display: block;
45
+ }
46
+ span.overview {
47
+ border-bottom: 8px solid black;
48
+ }
49
+ div.overview {
50
+ border-bottom: 8px solid black;
51
+ }
52
+ body {
53
+ font-family: verdana, arial, helvetica;
54
+ }
55
+ div.footer {
56
+ font-size: 68%;
57
+ margin-top: 1.5em;
58
+ }
59
+ h1, h2, h3, h4, h5, h6 {
60
+ margin-bottom: 0.5em;
61
+ }
62
+ h5 {
63
+ margin-top: 0.5em;
64
+ }
65
+ .hidden {
66
+ display: none;
67
+ }
68
+ div.separator {
69
+ height: 10px;
70
+ }
71
+ /* Commented out for better readability, esp. on IE */
72
+ /*
73
+ table tr td, table tr th {
74
+ font-size: 68%;
75
+ }
76
+ td.value table tr td {
77
+ font-size: 11px;
78
+ }
79
+ */
80
+ table.percent_graph {
81
+ height: 12px;
82
+ border: #808080 1px solid;
83
+ empty-cells: show;
84
+ }
85
+ table.percent_graph td.covered {
86
+ height: 10px;
87
+ background: #00f000;
88
+ }
89
+ table.percent_graph td.uncovered {
90
+ height: 10px;
91
+ background: #e00000;
92
+ }
93
+ table.percent_graph td.NA {
94
+ height: 10px;
95
+ background: #eaeaea;
96
+ }
97
+ table.report {
98
+ border-collapse: collapse;
99
+ width: 100%;
100
+ }
101
+ table.report td.heading {
102
+ background: #dcecff;
103
+ border: #d0d0d0 1px solid;
104
+ font-weight: bold;
105
+ text-align: center;
106
+ }
107
+ table.report td.heading:hover {
108
+ background: #c0ffc0;
109
+ }
110
+ table.report td.text {
111
+ border: #d0d0d0 1px solid;
112
+ }
113
+ table.report td.value,
114
+ table.report td.lines_total,
115
+ table.report td.lines_code {
116
+ text-align: right;
117
+ border: #d0d0d0 1px solid;
118
+ }
119
+ table.report tr.light {
120
+ background-color: rgb(240, 240, 245);
121
+ }
122
+ table.report tr.dark {
123
+ background-color: rgb(230, 230, 235);
124
+ }
125
+ </style>
126
+ <script type='text/javascript'>
127
+ // <![CDATA[
128
+ function toggleCode( id ) {
129
+ if ( document.getElementById )
130
+ elem = document.getElementById( id );
131
+ else if ( document.all )
132
+ elem = eval( "document.all." + id );
133
+ else
134
+ return false;
135
+
136
+ elemStyle = elem.style;
137
+
138
+ if ( elemStyle.display != "block" ) {
139
+ elemStyle.display = "block"
140
+ } else {
141
+ elemStyle.display = "none"
142
+ }
143
+
144
+ return true;
145
+ }
146
+
147
+ // Make cross-references hidden by default
148
+ document.writeln( "<style type=\"text/css\">span.cross-ref { display: none }</style>" )
149
+ // ]]>
150
+ </script>
151
+ <style type='text/css'>span.run0 {
152
+ background-color: rgb(178, 204, 255);
153
+ display: block;
154
+ }
155
+ span.run1 {
156
+ background-color: rgb(178, 206, 255);
157
+ display: block;
158
+ }
159
+ span.run2 {
160
+ background-color: rgb(178, 209, 255);
161
+ display: block;
162
+ }
163
+ span.run3 {
164
+ background-color: rgb(178, 211, 255);
165
+ display: block;
166
+ }
167
+ span.run4 {
168
+ background-color: rgb(178, 214, 255);
169
+ display: block;
170
+ }
171
+ span.run5 {
172
+ background-color: rgb(178, 218, 255);
173
+ display: block;
174
+ }
175
+ span.run6 {
176
+ background-color: rgb(178, 220, 255);
177
+ display: block;
178
+ }
179
+ span.run7 {
180
+ background-color: rgb(178, 223, 255);
181
+ display: block;
182
+ }
183
+ span.run8 {
184
+ background-color: rgb(178, 225, 255);
185
+ display: block;
186
+ }
187
+ span.run9 {
188
+ background-color: rgb(178, 228, 255);
189
+ display: block;
190
+ }
191
+ span.run10 {
192
+ background-color: rgb(178, 232, 255);
193
+ display: block;
194
+ }
195
+ span.run11 {
196
+ background-color: rgb(178, 234, 255);
197
+ display: block;
198
+ }
199
+ span.run12 {
200
+ background-color: rgb(178, 237, 255);
201
+ display: block;
202
+ }
203
+ span.run13 {
204
+ background-color: rgb(178, 239, 255);
205
+ display: block;
206
+ }
207
+ span.run14 {
208
+ background-color: rgb(178, 242, 255);
209
+ display: block;
210
+ }
211
+ span.run15 {
212
+ background-color: rgb(178, 246, 255);
213
+ display: block;
214
+ }
215
+ span.run16 {
216
+ background-color: rgb(178, 248, 255);
217
+ display: block;
218
+ }
219
+ span.run17 {
220
+ background-color: rgb(178, 251, 255);
221
+ display: block;
222
+ }
223
+ span.run18 {
224
+ background-color: rgb(178, 253, 255);
225
+ display: block;
226
+ }
227
+ span.run19 {
228
+ background-color: rgb(178, 255, 253);
229
+ display: block;
230
+ }
231
+ span.run20 {
232
+ background-color: rgb(178, 255, 249);
233
+ display: block;
234
+ }
235
+ span.run21 {
236
+ background-color: rgb(178, 255, 247);
237
+ display: block;
238
+ }
239
+ span.run22 {
240
+ background-color: rgb(178, 255, 244);
241
+ display: block;
242
+ }
243
+ span.run23 {
244
+ background-color: rgb(178, 255, 242);
245
+ display: block;
246
+ }
247
+ span.run24 {
248
+ background-color: rgb(178, 255, 239);
249
+ display: block;
250
+ }
251
+ span.run25 {
252
+ background-color: rgb(178, 255, 235);
253
+ display: block;
254
+ }
255
+ span.run26 {
256
+ background-color: rgb(178, 255, 233);
257
+ display: block;
258
+ }
259
+ span.run27 {
260
+ background-color: rgb(178, 255, 230);
261
+ display: block;
262
+ }
263
+ span.run28 {
264
+ background-color: rgb(178, 255, 228);
265
+ display: block;
266
+ }
267
+ span.run29 {
268
+ background-color: rgb(178, 255, 225);
269
+ display: block;
270
+ }
271
+ span.run30 {
272
+ background-color: rgb(178, 255, 221);
273
+ display: block;
274
+ }
275
+ span.run31 {
276
+ background-color: rgb(178, 255, 219);
277
+ display: block;
278
+ }
279
+ span.run32 {
280
+ background-color: rgb(178, 255, 216);
281
+ display: block;
282
+ }
283
+ span.run33 {
284
+ background-color: rgb(178, 255, 214);
285
+ display: block;
286
+ }
287
+ span.run34 {
288
+ background-color: rgb(178, 255, 211);
289
+ display: block;
290
+ }
291
+ span.run35 {
292
+ background-color: rgb(178, 255, 207);
293
+ display: block;
294
+ }
295
+ span.run36 {
296
+ background-color: rgb(178, 255, 205);
297
+ display: block;
298
+ }
299
+ span.run37 {
300
+ background-color: rgb(178, 255, 202);
301
+ display: block;
302
+ }
303
+ span.run38 {
304
+ background-color: rgb(178, 255, 200);
305
+ display: block;
306
+ }
307
+ span.run39 {
308
+ background-color: rgb(178, 255, 197);
309
+ display: block;
310
+ }
311
+ span.run40 {
312
+ background-color: rgb(178, 255, 193);
313
+ display: block;
314
+ }
315
+ span.run41 {
316
+ background-color: rgb(178, 255, 191);
317
+ display: block;
318
+ }
319
+ span.run42 {
320
+ background-color: rgb(178, 255, 188);
321
+ display: block;
322
+ }
323
+ span.run43 {
324
+ background-color: rgb(178, 255, 186);
325
+ display: block;
326
+ }
327
+ span.run44 {
328
+ background-color: rgb(178, 255, 183);
329
+ display: block;
330
+ }
331
+ span.run45 {
332
+ background-color: rgb(178, 255, 179);
333
+ display: block;
334
+ }
335
+ span.run46 {
336
+ background-color: rgb(179, 255, 178);
337
+ display: block;
338
+ }
339
+ span.run47 {
340
+ background-color: rgb(182, 255, 178);
341
+ display: block;
342
+ }
343
+ span.run48 {
344
+ background-color: rgb(184, 255, 178);
345
+ display: block;
346
+ }
347
+ span.run49 {
348
+ background-color: rgb(187, 255, 178);
349
+ display: block;
350
+ }
351
+ span.run50 {
352
+ background-color: rgb(191, 255, 178);
353
+ display: block;
354
+ }
355
+ span.run51 {
356
+ background-color: rgb(193, 255, 178);
357
+ display: block;
358
+ }
359
+ span.run52 {
360
+ background-color: rgb(196, 255, 178);
361
+ display: block;
362
+ }
363
+ span.run53 {
364
+ background-color: rgb(198, 255, 178);
365
+ display: block;
366
+ }
367
+ span.run54 {
368
+ background-color: rgb(201, 255, 178);
369
+ display: block;
370
+ }
371
+ span.run55 {
372
+ background-color: rgb(205, 255, 178);
373
+ display: block;
374
+ }
375
+ span.run56 {
376
+ background-color: rgb(207, 255, 178);
377
+ display: block;
378
+ }
379
+ span.run57 {
380
+ background-color: rgb(210, 255, 178);
381
+ display: block;
382
+ }
383
+ span.run58 {
384
+ background-color: rgb(212, 255, 178);
385
+ display: block;
386
+ }
387
+ span.run59 {
388
+ background-color: rgb(215, 255, 178);
389
+ display: block;
390
+ }
391
+ span.run60 {
392
+ background-color: rgb(219, 255, 178);
393
+ display: block;
394
+ }
395
+ span.run61 {
396
+ background-color: rgb(221, 255, 178);
397
+ display: block;
398
+ }
399
+ span.run62 {
400
+ background-color: rgb(224, 255, 178);
401
+ display: block;
402
+ }
403
+ span.run63 {
404
+ background-color: rgb(226, 255, 178);
405
+ display: block;
406
+ }
407
+ span.run64 {
408
+ background-color: rgb(229, 255, 178);
409
+ display: block;
410
+ }
411
+ span.run65 {
412
+ background-color: rgb(233, 255, 178);
413
+ display: block;
414
+ }
415
+ span.run66 {
416
+ background-color: rgb(235, 255, 178);
417
+ display: block;
418
+ }
419
+ span.run67 {
420
+ background-color: rgb(238, 255, 178);
421
+ display: block;
422
+ }
423
+ span.run68 {
424
+ background-color: rgb(240, 255, 178);
425
+ display: block;
426
+ }
427
+ span.run69 {
428
+ background-color: rgb(243, 255, 178);
429
+ display: block;
430
+ }
431
+ span.run70 {
432
+ background-color: rgb(247, 255, 178);
433
+ display: block;
434
+ }
435
+ span.run71 {
436
+ background-color: rgb(249, 255, 178);
437
+ display: block;
438
+ }
439
+ span.run72 {
440
+ background-color: rgb(252, 255, 178);
441
+ display: block;
442
+ }
443
+ span.run73 {
444
+ background-color: rgb(255, 255, 178);
445
+ display: block;
446
+ }
447
+ span.run74 {
448
+ background-color: rgb(255, 252, 178);
449
+ display: block;
450
+ }
451
+ span.run75 {
452
+ background-color: rgb(255, 248, 178);
453
+ display: block;
454
+ }
455
+ span.run76 {
456
+ background-color: rgb(255, 246, 178);
457
+ display: block;
458
+ }
459
+ span.run77 {
460
+ background-color: rgb(255, 243, 178);
461
+ display: block;
462
+ }
463
+ span.run78 {
464
+ background-color: rgb(255, 240, 178);
465
+ display: block;
466
+ }
467
+ span.run79 {
468
+ background-color: rgb(255, 238, 178);
469
+ display: block;
470
+ }
471
+ span.run80 {
472
+ background-color: rgb(255, 234, 178);
473
+ display: block;
474
+ }
475
+ span.run81 {
476
+ background-color: rgb(255, 232, 178);
477
+ display: block;
478
+ }
479
+ span.run82 {
480
+ background-color: rgb(255, 229, 178);
481
+ display: block;
482
+ }
483
+ span.run83 {
484
+ background-color: rgb(255, 226, 178);
485
+ display: block;
486
+ }
487
+ span.run84 {
488
+ background-color: rgb(255, 224, 178);
489
+ display: block;
490
+ }
491
+ span.run85 {
492
+ background-color: rgb(255, 220, 178);
493
+ display: block;
494
+ }
495
+ span.run86 {
496
+ background-color: rgb(255, 218, 178);
497
+ display: block;
498
+ }
499
+ span.run87 {
500
+ background-color: rgb(255, 215, 178);
501
+ display: block;
502
+ }
503
+ span.run88 {
504
+ background-color: rgb(255, 212, 178);
505
+ display: block;
506
+ }
507
+ span.run89 {
508
+ background-color: rgb(255, 210, 178);
509
+ display: block;
510
+ }
511
+ span.run90 {
512
+ background-color: rgb(255, 206, 178);
513
+ display: block;
514
+ }
515
+ span.run91 {
516
+ background-color: rgb(255, 204, 178);
517
+ display: block;
518
+ }
519
+ span.run92 {
520
+ background-color: rgb(255, 201, 178);
521
+ display: block;
522
+ }
523
+ span.run93 {
524
+ background-color: rgb(255, 198, 178);
525
+ display: block;
526
+ }
527
+ span.run94 {
528
+ background-color: rgb(255, 196, 178);
529
+ display: block;
530
+ }
531
+ span.run95 {
532
+ background-color: rgb(255, 192, 178);
533
+ display: block;
534
+ }
535
+ span.run96 {
536
+ background-color: rgb(255, 189, 178);
537
+ display: block;
538
+ }
539
+ span.run97 {
540
+ background-color: rgb(255, 187, 178);
541
+ display: block;
542
+ }
543
+ span.run98 {
544
+ background-color: rgb(255, 184, 178);
545
+ display: block;
546
+ }
547
+ span.run99 {
548
+ background-color: rgb(255, 182, 178);
549
+ display: block;
550
+ }
551
+ span.run100 {
552
+ background-color: rgb(255, 178, 178);
553
+ display: block;
554
+ }
555
+ </style>
556
+ </head>
557
+ <body>
558
+ <h3>C0 code coverage information</h3>
559
+ <p>Generated on Mon Mar 10 10:31:09 -0500 2008 with <a href='http://eigenclass.org/hiki.rb?rcov'>rcov 0.8.0</a>
560
+ </p>
561
+ <hr /><pre><span class='marked0'>Code reported as executed by Ruby looks like this...
562
+ </span><span class='marked1'>and this: this line is also marked as covered.
563
+ </span><span class='inferred0'>Lines considered as run by rcov, but not reported by Ruby, look like this,
564
+ </span><span class='inferred1'>and this: these lines were inferred by rcov (using simple heuristics).
565
+ </span><span class='uncovered0'>Finally, here&apos;s a line marked as not executed.
566
+ </span></pre>
567
+ <table class='report'>
568
+ <thead>
569
+ <tr>
570
+ <td class='heading'>Name</td>
571
+ <td class='heading'>Total lines</td>
572
+ <td class='heading'>Lines of code</td>
573
+ <td class='heading'>Total coverage</td>
574
+ <td class='heading'>Code coverage</td>
575
+ </tr>
576
+ </thead>
577
+ <tbody>
578
+ <tr class='light'>
579
+ <td>
580
+ <a href='lib-methodchain-not_included_rb.html'>lib/methodchain/not_included.rb</a>
581
+ </td>
582
+ <td class='lines_total'>
583
+ <tt>58</tt>
584
+ </td>
585
+ <td class='lines_code'>
586
+ <tt>39</tt>
587
+ </td>
588
+ <td>
589
+ <table cellspacing='0' cellpadding='0' align='right'>
590
+ <tr>
591
+ <td>
592
+ <tt class='coverage_total'>100.0%</tt>&nbsp;</td>
593
+ <td>
594
+ <table cellspacing='0' class='percent_graph' cellpadding='0' width='100'>
595
+ <tr>
596
+ <td class='covered' width='100' />
597
+ <td class='uncovered' width='0' />
598
+ </tr>
599
+ </table>
600
+ </td>
601
+ </tr>
602
+ </table>
603
+ </td>
604
+ <td>
605
+ <table cellspacing='0' cellpadding='0' align='right'>
606
+ <tr>
607
+ <td>
608
+ <tt class='coverage_code'>100.0%</tt>&nbsp;</td>
609
+ <td>
610
+ <table cellspacing='0' class='percent_graph' cellpadding='0' width='100'>
611
+ <tr>
612
+ <td class='covered' width='100' />
613
+ <td class='uncovered' width='0' />
614
+ </tr>
615
+ </table>
616
+ </td>
617
+ </tr>
618
+ </table>
619
+ </td>
620
+ </tr>
621
+ </tbody>
622
+ </table><pre><span class="inferred1"><a name="line1" /> 1 # :main: README
623
+ </span><span class="marked0"><a name="line2" /> 2 module MethodChain
624
+ </span><span class="inferred1"><a name="line3" /> 3
625
+ </span><span class="inferred0"><a name="line4" /> 4 # send a method, evaluate a block, but always return self
626
+ </span><span class="marked1"><a name="line5" /> 5 def tap meth=nil, &amp;block
627
+ </span><span class="marked0"><a name="line6" /> 6 __send__ meth if meth
628
+ </span><span class="marked1"><a name="line7" /> 7 yield_or_eval &amp;block if block_given?
629
+ </span><span class="marked0"><a name="line8" /> 8 self
630
+ </span><span class="inferred1"><a name="line9" /> 9 end
631
+ </span><span class="inferred0"><a name="line10" />10
632
+ </span><span class="inferred1"><a name="line11" />11 # method chaining with a guard.
633
+ </span><span class="inferred0"><a name="line12" />12 # If no guard block is given then guard against nil and false
634
+ </span><span class="inferred1"><a name="line13" />13 # *methods = [method] where
635
+ </span><span class="inferred0"><a name="line14" />14 # method = Message | Code
636
+ </span><span class="inferred1"><a name="line15" />15 # Message = Symbol | [Symbol, *arguments]
637
+ </span><span class="inferred0"><a name="line16" />16 # Code.to_proc = Proc
638
+ </span><span class="marked1"><a name="line17" />17 def chain *methods, &amp;guard
639
+ </span><span class="inferred0"><a name="line18" />18 return self if methods.empty? or not(
640
+ </span><span class="marked1"><a name="line19" />19 (block_given? ? (yield_or_eval &amp;guard) : self))
641
+ </span><span class="inferred0"><a name="line20" />20
642
+ </span><span class="marked1"><a name="line21" />21 case(meth = methods.shift)
643
+ </span><span class="marked0"><a name="line22" />22 when Symbol then __send__ meth
644
+ </span><span class="marked1"><a name="line23" />23 when Array then __send__ *meth
645
+ </span><span class="marked0"><a name="line24" />24 else yield_or_eval &amp;meth
646
+ </span><span class="marked1"><a name="line25" />25 end.chain(*methods, &amp;guard)
647
+ </span><span class="inferred0"><a name="line26" />26 end
648
+ </span><span class="inferred1"><a name="line27" />27
649
+ </span><span class="inferred0"><a name="line28" />28 # yield or eval based on the block arity
650
+ </span><span class="marked1"><a name="line29" />29 def yield_or_eval &amp;block
651
+ </span><span class="marked0"><a name="line30" />30 case block.arity
652
+ </span><span class="inferred1"><a name="line31" />31 # ruby bug for -1
653
+ </span><span class="marked0"><a name="line32" />32 when 0, -1 then instance_eval(&amp;block)
654
+ </span><span class="marked1"><a name="line33" />33 when 1 then yield(self)
655
+ </span><span class="marked0"><a name="line34" />34 else raise ArgumentError, &quot;too many arguments required by block&quot;
656
+ </span><span class="inferred1"><a name="line35" />35 end
657
+ </span><span class="inferred0"><a name="line36" />36 end
658
+ </span><span class="inferred1"><a name="line37" />37
659
+ </span><span class="inferred0"><a name="line38" />38 # return self if self evaluates to false, otherwise
660
+ </span><span class="inferred1"><a name="line39" />39 # evaluate the block or return the default argument
661
+ </span><span class="marked0"><a name="line40" />40 def then default=nil, &amp;block
662
+ </span><span class="marked1"><a name="line41" />41 if self
663
+ </span><span class="marked0"><a name="line42" />42 block_given? ? (yield_or_eval &amp;block) : (default || (fail \
664
+ </span><span class="marked1"><a name="line43" />43 ArgumentError, &quot;#then must be called with an argument or a block&quot;))
665
+ </span><span class="inferred0"><a name="line44" />44 else
666
+ </span><span class="marked1"><a name="line45" />45 self
667
+ </span><span class="inferred0"><a name="line46" />46 end
668
+ </span><span class="inferred1"><a name="line47" />47 end
669
+ </span><span class="inferred0"><a name="line48" />48
670
+ </span><span class="inferred1"><a name="line49" />49 # the inverse of then
671
+ </span><span class="marked0"><a name="line50" />50 def else arg=nil, &amp;block
672
+ </span><span class="marked1"><a name="line51" />51 if self
673
+ </span><span class="marked0"><a name="line52" />52 self
674
+ </span><span class="inferred1"><a name="line53" />53 else
675
+ </span><span class="marked0"><a name="line54" />54 block_given? ? (yield_or_eval &amp;block) : (arg || (fail \
676
+ </span><span class="marked1"><a name="line55" />55 ArgumentError, &quot;#else must be called with an argument or a bloc&quot;))
677
+ </span><span class="inferred0"><a name="line56" />56 end
678
+ </span><span class="inferred1"><a name="line57" />57 end
679
+ </span><span class="inferred0"><a name="line58" />58 end
680
+ </span></pre><hr /> <p>Generated using the <a href='http://eigenclass.org/hiki.rb?rcov'>rcov code coverage analysis tool for Ruby</a> version 0.8.0.</p><p>
681
+ <a href='http://validator.w3.org/check/referer'>
682
+ <img src='http://www.w3.org/Icons/valid-xhtml10' height='31' alt='Valid XHTML 1.0!' width='88' />
683
+ </a>
684
+ <a href='http://jigsaw.w3.org/css-validator/check/referer'>
685
+ <img src='http://jigsaw.w3.org/css-validator/images/vcss' alt='Valid CSS!' style='border:0;width:88px;height:31px' />
686
+ </a>
687
+ </p>
688
+ </body>
689
+ </html>