hash_dealer 1.5.0 → 1.5.1
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/coverage/index.html +876 -484
- data/hash_dealer.gemspec +1 -1
- data/lib/hash_dealer.rb +8 -3
- data/spec/lib/hash_dealer_spec.rb +13 -0
- metadata +1 -1
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.5.
|
1
|
+
1.5.1
|
data/coverage/index.html
CHANGED
@@ -14,7 +14,7 @@
|
|
14
14
|
<link href='./assets/0.5.3/highlight.css' media='screen, projection, print' rel='stylesheet' type='text/css'>
|
15
15
|
<link href='./assets/0.5.3/fancybox/jquery.fancybox-1.3.1.css' media='screen, projection, print' rel='stylesheet' type='text/css'>
|
16
16
|
<link href='./assets/0.5.3/smoothness/jquery-ui-1.8.4.custom.css' media='screen, projection, print' rel='stylesheet' type='text/css'>
|
17
|
-
<link rel="shortcut icon" type="image/png" href="./assets/0.5.3/
|
17
|
+
<link rel="shortcut icon" type="image/png" href="./assets/0.5.3/favicon_red.png" />
|
18
18
|
<link rel="icon" type="image/png" href="./assets/0.5.3/favicon.png" />
|
19
19
|
</head>
|
20
20
|
|
@@ -23,27 +23,27 @@
|
|
23
23
|
<img src="./assets/0.5.3/loading.gif" alt="loading"/>
|
24
24
|
</div>
|
25
25
|
<div id="wrapper" style="display:none;">
|
26
|
-
<div class="timestamp">Generated <abbr class="timeago" title="2012-12-
|
26
|
+
<div class="timestamp">Generated <abbr class="timeago" title="2012-12-27T13:11:12-05:00">2012-12-27T13:11:12-05:00</abbr></div>
|
27
27
|
<ul class="group_tabs"></ul>
|
28
28
|
|
29
29
|
<div id="content">
|
30
30
|
<div class="file_list_container" id="AllFiles">
|
31
31
|
<h2>
|
32
32
|
<span class="group_name">All Files</span>
|
33
|
-
(<span class="covered_percent"><span class="
|
33
|
+
(<span class="covered_percent"><span class="red">29.69%</span></span>
|
34
34
|
covered at
|
35
35
|
<span class="covered_strength">
|
36
36
|
<span class="green">
|
37
|
-
|
37
|
+
3.4
|
38
38
|
</span>
|
39
39
|
</span> hits/line)
|
40
40
|
</h2>
|
41
41
|
<a name="AllFiles"></a>
|
42
42
|
<div>
|
43
|
-
<b>
|
44
|
-
<b>
|
45
|
-
<span class="green"><b>
|
46
|
-
<span class="red"><b>
|
43
|
+
<b>7</b> files in total.
|
44
|
+
<b>320</b> relevant lines.
|
45
|
+
<span class="green"><b>95</b> lines covered</span> and
|
46
|
+
<span class="red"><b>225</b> lines missed </span>
|
47
47
|
</div>
|
48
48
|
<table class="file_list">
|
49
49
|
<thead>
|
@@ -61,62 +61,72 @@
|
|
61
61
|
|
62
62
|
<tr>
|
63
63
|
<td class="strong"><a href="#23ece676ee554bd0a62670e8964fe96af2adc01a" class="src_link" title="lib/comparator.rb">lib/comparator.rb</a></td>
|
64
|
-
<td class="
|
64
|
+
<td class="red strong">17.78 %</td>
|
65
65
|
<td>74</td>
|
66
66
|
<td>45</td>
|
67
|
-
<td>
|
68
|
-
<td>
|
69
|
-
<td>
|
67
|
+
<td>8</td>
|
68
|
+
<td>37</td>
|
69
|
+
<td>0.2</td>
|
70
70
|
</tr>
|
71
71
|
|
72
72
|
<tr>
|
73
73
|
<td class="strong"><a href="#62f8063523b24e1e0397e524e8e048ddb0ac289c" class="src_link" title="lib/core_extensions.rb">lib/core_extensions.rb</a></td>
|
74
|
-
<td class="
|
74
|
+
<td class="red strong">45.88 %</td>
|
75
75
|
<td>183</td>
|
76
76
|
<td>85</td>
|
77
|
-
<td>
|
78
|
-
<td>
|
79
|
-
<td>
|
77
|
+
<td>39</td>
|
78
|
+
<td>46</td>
|
79
|
+
<td>22.1</td>
|
80
|
+
</tr>
|
81
|
+
|
82
|
+
<tr>
|
83
|
+
<td class="strong"><a href="#7ee6b0eb3c9dcde6be408d6b4f636325ec8416f6" class="src_link" title="lib/hash.rb">lib/hash.rb</a></td>
|
84
|
+
<td class="red strong">36.84 %</td>
|
85
|
+
<td>34</td>
|
86
|
+
<td>19</td>
|
87
|
+
<td>7</td>
|
88
|
+
<td>12</td>
|
89
|
+
<td>0.4</td>
|
80
90
|
</tr>
|
81
91
|
|
82
92
|
<tr>
|
83
93
|
<td class="strong"><a href="#9082f1e417147c61ee326c565b15a99cad953b35" class="src_link" title="lib/hash_dealer.rb">lib/hash_dealer.rb</a></td>
|
84
|
-
<td class="
|
85
|
-
<td>
|
86
|
-
<td>
|
87
|
-
<td>
|
88
|
-
<td>
|
89
|
-
<td>
|
94
|
+
<td class="red strong">39.58 %</td>
|
95
|
+
<td>97</td>
|
96
|
+
<td>48</td>
|
97
|
+
<td>19</td>
|
98
|
+
<td>29</td>
|
99
|
+
<td>0.4</td>
|
90
100
|
</tr>
|
91
101
|
|
92
102
|
<tr>
|
93
103
|
<td class="strong"><a href="#4cc7721b735165eef9b1e5afd4a168c1a72d5103" class="src_link" title="lib/matcher.rb">lib/matcher.rb</a></td>
|
94
|
-
<td class="red strong">
|
104
|
+
<td class="red strong">11.63 %</td>
|
95
105
|
<td>69</td>
|
96
106
|
<td>43</td>
|
97
|
-
<td>
|
98
|
-
<td>
|
99
|
-
<td>
|
107
|
+
<td>5</td>
|
108
|
+
<td>38</td>
|
109
|
+
<td>0.1</td>
|
100
110
|
</tr>
|
101
111
|
|
102
112
|
<tr>
|
103
113
|
<td class="strong"><a href="#a262d63e5dc399019853b13f0e4b947eb9908f86" class="src_link" title="lib/path_string.rb">lib/path_string.rb</a></td>
|
104
|
-
<td class="red strong">
|
114
|
+
<td class="red strong">18.84 %</td>
|
105
115
|
<td>125</td>
|
106
116
|
<td>69</td>
|
107
|
-
<td>
|
108
|
-
<td>
|
109
|
-
<td>
|
117
|
+
<td>13</td>
|
118
|
+
<td>56</td>
|
119
|
+
<td>0.2</td>
|
110
120
|
</tr>
|
111
121
|
|
112
122
|
<tr>
|
113
123
|
<td class="strong"><a href="#a53828a5413df9e3a1d0192504eac81ee4166020" class="src_link" title="lib/variable_array.rb">lib/variable_array.rb</a></td>
|
114
|
-
<td class="
|
124
|
+
<td class="red strong">36.36 %</td>
|
115
125
|
<td>18</td>
|
116
126
|
<td>11</td>
|
117
|
-
<td>
|
118
|
-
<td>
|
119
|
-
<td>
|
127
|
+
<td>4</td>
|
128
|
+
<td>7</td>
|
129
|
+
<td>0.4</td>
|
120
130
|
</tr>
|
121
131
|
|
122
132
|
</tbody>
|
@@ -276,20 +286,20 @@
|
|
276
286
|
<div class="file_list_container" id="Libraries">
|
277
287
|
<h2>
|
278
288
|
<span class="group_name">Libraries</span>
|
279
|
-
(<span class="covered_percent"><span class="
|
289
|
+
(<span class="covered_percent"><span class="red">29.69%</span></span>
|
280
290
|
covered at
|
281
291
|
<span class="covered_strength">
|
282
292
|
<span class="green">
|
283
|
-
|
293
|
+
3.4
|
284
294
|
</span>
|
285
295
|
</span> hits/line)
|
286
296
|
</h2>
|
287
297
|
<a name="Libraries"></a>
|
288
298
|
<div>
|
289
|
-
<b>
|
290
|
-
<b>
|
291
|
-
<span class="green"><b>
|
292
|
-
<span class="red"><b>
|
299
|
+
<b>7</b> files in total.
|
300
|
+
<b>320</b> relevant lines.
|
301
|
+
<span class="green"><b>95</b> lines covered</span> and
|
302
|
+
<span class="red"><b>225</b> lines missed </span>
|
293
303
|
</div>
|
294
304
|
<table class="file_list">
|
295
305
|
<thead>
|
@@ -307,62 +317,72 @@
|
|
307
317
|
|
308
318
|
<tr>
|
309
319
|
<td class="strong"><a href="#23ece676ee554bd0a62670e8964fe96af2adc01a" class="src_link" title="lib/comparator.rb">lib/comparator.rb</a></td>
|
310
|
-
<td class="
|
320
|
+
<td class="red strong">17.78 %</td>
|
311
321
|
<td>74</td>
|
312
322
|
<td>45</td>
|
313
|
-
<td>
|
314
|
-
<td>
|
315
|
-
<td>
|
323
|
+
<td>8</td>
|
324
|
+
<td>37</td>
|
325
|
+
<td>0.2</td>
|
316
326
|
</tr>
|
317
327
|
|
318
328
|
<tr>
|
319
329
|
<td class="strong"><a href="#62f8063523b24e1e0397e524e8e048ddb0ac289c" class="src_link" title="lib/core_extensions.rb">lib/core_extensions.rb</a></td>
|
320
|
-
<td class="
|
330
|
+
<td class="red strong">45.88 %</td>
|
321
331
|
<td>183</td>
|
322
332
|
<td>85</td>
|
323
|
-
<td>
|
324
|
-
<td>
|
325
|
-
<td>
|
333
|
+
<td>39</td>
|
334
|
+
<td>46</td>
|
335
|
+
<td>22.1</td>
|
336
|
+
</tr>
|
337
|
+
|
338
|
+
<tr>
|
339
|
+
<td class="strong"><a href="#7ee6b0eb3c9dcde6be408d6b4f636325ec8416f6" class="src_link" title="lib/hash.rb">lib/hash.rb</a></td>
|
340
|
+
<td class="red strong">36.84 %</td>
|
341
|
+
<td>34</td>
|
342
|
+
<td>19</td>
|
343
|
+
<td>7</td>
|
344
|
+
<td>12</td>
|
345
|
+
<td>0.4</td>
|
326
346
|
</tr>
|
327
347
|
|
328
348
|
<tr>
|
329
349
|
<td class="strong"><a href="#9082f1e417147c61ee326c565b15a99cad953b35" class="src_link" title="lib/hash_dealer.rb">lib/hash_dealer.rb</a></td>
|
330
|
-
<td class="
|
331
|
-
<td>
|
332
|
-
<td>
|
333
|
-
<td>
|
334
|
-
<td>
|
335
|
-
<td>
|
350
|
+
<td class="red strong">39.58 %</td>
|
351
|
+
<td>97</td>
|
352
|
+
<td>48</td>
|
353
|
+
<td>19</td>
|
354
|
+
<td>29</td>
|
355
|
+
<td>0.4</td>
|
336
356
|
</tr>
|
337
357
|
|
338
358
|
<tr>
|
339
359
|
<td class="strong"><a href="#4cc7721b735165eef9b1e5afd4a168c1a72d5103" class="src_link" title="lib/matcher.rb">lib/matcher.rb</a></td>
|
340
|
-
<td class="red strong">
|
360
|
+
<td class="red strong">11.63 %</td>
|
341
361
|
<td>69</td>
|
342
362
|
<td>43</td>
|
343
|
-
<td>
|
344
|
-
<td>
|
345
|
-
<td>
|
363
|
+
<td>5</td>
|
364
|
+
<td>38</td>
|
365
|
+
<td>0.1</td>
|
346
366
|
</tr>
|
347
367
|
|
348
368
|
<tr>
|
349
369
|
<td class="strong"><a href="#a262d63e5dc399019853b13f0e4b947eb9908f86" class="src_link" title="lib/path_string.rb">lib/path_string.rb</a></td>
|
350
|
-
<td class="red strong">
|
370
|
+
<td class="red strong">18.84 %</td>
|
351
371
|
<td>125</td>
|
352
372
|
<td>69</td>
|
353
|
-
<td>
|
354
|
-
<td>
|
355
|
-
<td>
|
373
|
+
<td>13</td>
|
374
|
+
<td>56</td>
|
375
|
+
<td>0.2</td>
|
356
376
|
</tr>
|
357
377
|
|
358
378
|
<tr>
|
359
379
|
<td class="strong"><a href="#a53828a5413df9e3a1d0192504eac81ee4166020" class="src_link" title="lib/variable_array.rb">lib/variable_array.rb</a></td>
|
360
|
-
<td class="
|
380
|
+
<td class="red strong">36.36 %</td>
|
361
381
|
<td>18</td>
|
362
382
|
<td>11</td>
|
363
|
-
<td>
|
364
|
-
<td>
|
365
|
-
<td>
|
383
|
+
<td>4</td>
|
384
|
+
<td>7</td>
|
385
|
+
<td>0.4</td>
|
366
386
|
</tr>
|
367
387
|
|
368
388
|
</tbody>
|
@@ -420,11 +440,11 @@
|
|
420
440
|
<div class="source_table" id="23ece676ee554bd0a62670e8964fe96af2adc01a">
|
421
441
|
<div class="header">
|
422
442
|
<h3>lib/comparator.rb</h3>
|
423
|
-
<h4><span class="
|
443
|
+
<h4><span class="red">17.78 %</span> covered</h4>
|
424
444
|
<div>
|
425
445
|
<b>45</b> relevant lines.
|
426
|
-
<span class="green"><b>
|
427
|
-
<span class="red"><b>
|
446
|
+
<span class="green"><b>8</b> lines covered</span> and
|
447
|
+
<span class="red"><b>37</b> lines missed.</span>
|
428
448
|
</div>
|
429
449
|
</div>
|
430
450
|
|
@@ -461,8 +481,8 @@
|
|
461
481
|
<code class="ruby"> def self.formatted_value(val)</code>
|
462
482
|
</li>
|
463
483
|
|
464
|
-
<li class="
|
465
|
-
|
484
|
+
<li class="missed" data-hits="0" data-linenumber="6">
|
485
|
+
|
466
486
|
|
467
487
|
<code class="ruby"> if val.nil?</code>
|
468
488
|
</li>
|
@@ -473,20 +493,20 @@
|
|
473
493
|
<code class="ruby"> return "NilClass::nil"</code>
|
474
494
|
</li>
|
475
495
|
|
476
|
-
<li class="
|
477
|
-
|
496
|
+
<li class="missed" data-hits="0" data-linenumber="8">
|
497
|
+
|
478
498
|
|
479
499
|
<code class="ruby"> elsif val.is_a?(PathString)</code>
|
480
500
|
</li>
|
481
501
|
|
482
|
-
<li class="
|
483
|
-
|
502
|
+
<li class="missed" data-hits="0" data-linenumber="9">
|
503
|
+
|
484
504
|
|
485
505
|
<code class="ruby"> return val.gsub(":","")</code>
|
486
506
|
</li>
|
487
507
|
|
488
|
-
<li class="
|
489
|
-
|
508
|
+
<li class="missed" data-hits="0" data-linenumber="10">
|
509
|
+
|
490
510
|
|
491
511
|
<code class="ruby"> elsif val == ""</code>
|
492
512
|
</li>
|
@@ -503,8 +523,8 @@
|
|
503
523
|
<code class="ruby"> else</code>
|
504
524
|
</li>
|
505
525
|
|
506
|
-
<li class="
|
507
|
-
|
526
|
+
<li class="missed" data-hits="0" data-linenumber="13">
|
527
|
+
|
508
528
|
|
509
529
|
<code class="ruby"> return val</code>
|
510
530
|
</li>
|
@@ -533,32 +553,32 @@
|
|
533
553
|
<code class="ruby"> def self.normalize_value(val)</code>
|
534
554
|
</li>
|
535
555
|
|
536
|
-
<li class="
|
537
|
-
|
556
|
+
<li class="missed" data-hits="0" data-linenumber="18">
|
557
|
+
|
538
558
|
|
539
559
|
<code class="ruby"> return val if val.is_a?(TimeDateMatcher)</code>
|
540
560
|
</li>
|
541
561
|
|
542
|
-
<li class="
|
543
|
-
|
562
|
+
<li class="missed" data-hits="0" data-linenumber="19">
|
563
|
+
|
544
564
|
|
545
565
|
<code class="ruby"> val = ActiveSupport::JSON.decode(val) if val.is_a?(String)</code>
|
546
566
|
</li>
|
547
567
|
|
548
|
-
<li class="
|
549
|
-
|
568
|
+
<li class="missed" data-hits="0" data-linenumber="20">
|
569
|
+
|
550
570
|
|
551
571
|
<code class="ruby"> val = self.stringify_keys(val) if val.is_a?(Hash)</code>
|
552
572
|
</li>
|
553
573
|
|
554
|
-
<li class="
|
555
|
-
|
574
|
+
<li class="missed" data-hits="0" data-linenumber="21">
|
575
|
+
|
556
576
|
|
557
577
|
<code class="ruby"> val = val.collect{|v| v.is_a?(Hash) || v.is_a?(Array) ? self.normalize_value(v) : v} if val.is_a?(Array)</code>
|
558
578
|
</li>
|
559
579
|
|
560
|
-
<li class="
|
561
|
-
|
580
|
+
<li class="missed" data-hits="0" data-linenumber="22">
|
581
|
+
|
562
582
|
|
563
583
|
<code class="ruby"> val</code>
|
564
584
|
</li>
|
@@ -581,20 +601,20 @@
|
|
581
601
|
<code class="ruby"> def self.diff(obj1, obj2)</code>
|
582
602
|
</li>
|
583
603
|
|
584
|
-
<li class="
|
585
|
-
|
604
|
+
<li class="missed" data-hits="0" data-linenumber="26">
|
605
|
+
|
586
606
|
|
587
607
|
<code class="ruby"> return {} if obj1 == obj2</code>
|
588
608
|
</li>
|
589
609
|
|
590
|
-
<li class="
|
591
|
-
|
610
|
+
<li class="missed" data-hits="0" data-linenumber="27">
|
611
|
+
|
592
612
|
|
593
613
|
<code class="ruby"> if obj1.is_a?(Array) && obj2.is_a?(Array)</code>
|
594
614
|
</li>
|
595
615
|
|
596
|
-
<li class="
|
597
|
-
|
616
|
+
<li class="missed" data-hits="0" data-linenumber="28">
|
617
|
+
|
598
618
|
|
599
619
|
<code class="ruby"> return self.array_diff(obj1, obj2) </code>
|
600
620
|
</li>
|
@@ -605,8 +625,8 @@
|
|
605
625
|
<code class="ruby"> elsif obj1.is_a?(Hash) && obj2.is_a?(Hash)</code>
|
606
626
|
</li>
|
607
627
|
|
608
|
-
<li class="
|
609
|
-
|
628
|
+
<li class="missed" data-hits="0" data-linenumber="30">
|
629
|
+
|
610
630
|
|
611
631
|
<code class="ruby"> return self.hash_diff(obj1, obj2) </code>
|
612
632
|
</li>
|
@@ -617,20 +637,20 @@
|
|
617
637
|
<code class="ruby"> end</code>
|
618
638
|
</li>
|
619
639
|
|
620
|
-
<li class="
|
621
|
-
|
640
|
+
<li class="missed" data-hits="0" data-linenumber="32">
|
641
|
+
|
622
642
|
|
623
643
|
<code class="ruby"> return [formatted_value(obj1), "KEY MISSING"] if obj2.nil?</code>
|
624
644
|
</li>
|
625
645
|
|
626
|
-
<li class="
|
627
|
-
|
646
|
+
<li class="missed" data-hits="0" data-linenumber="33">
|
647
|
+
|
628
648
|
|
629
649
|
<code class="ruby"> return ["KEY MISSING", formatted_value(obj2)] if obj1.nil?</code>
|
630
650
|
</li>
|
631
651
|
|
632
|
-
<li class="
|
633
|
-
|
652
|
+
<li class="missed" data-hits="0" data-linenumber="34">
|
653
|
+
|
634
654
|
|
635
655
|
<code class="ruby"> return [formatted_value(obj1), formatted_value(obj2)]</code>
|
636
656
|
</li>
|
@@ -653,8 +673,8 @@
|
|
653
673
|
<code class="ruby"> def self.array_diff(obj1, obj2)</code>
|
654
674
|
</li>
|
655
675
|
|
656
|
-
<li class="
|
657
|
-
|
676
|
+
<li class="missed" data-hits="0" data-linenumber="38">
|
677
|
+
|
658
678
|
|
659
679
|
<code class="ruby"> {}.tap do |ret|</code>
|
660
680
|
</li>
|
@@ -671,20 +691,20 @@
|
|
671
691
|
<code class="ruby"> # of non-VariableArrays and the 2nd element of VariableArrays</code>
|
672
692
|
</li>
|
673
693
|
|
674
|
-
<li class="
|
675
|
-
|
694
|
+
<li class="missed" data-hits="0" data-linenumber="41">
|
695
|
+
|
676
696
|
|
677
697
|
<code class="ruby"> if obj1.is_a?(VariableArray) || obj2.is_a?(VariableArray)</code>
|
678
698
|
</li>
|
679
699
|
|
680
|
-
<li class="
|
681
|
-
|
700
|
+
<li class="missed" data-hits="0" data-linenumber="42">
|
701
|
+
|
682
702
|
|
683
703
|
<code class="ruby"> obj1 = obj1.is_a?(VariableArray) ? [obj1[1]] : [obj1[0]]</code>
|
684
704
|
</li>
|
685
705
|
|
686
|
-
<li class="
|
687
|
-
|
706
|
+
<li class="missed" data-hits="0" data-linenumber="43">
|
707
|
+
|
688
708
|
|
689
709
|
<code class="ruby"> obj2 = obj2.is_a?(VariableArray) ? [obj2[1]] : [obj2[0]]</code>
|
690
710
|
</li>
|
@@ -695,20 +715,20 @@
|
|
695
715
|
<code class="ruby"> end</code>
|
696
716
|
</li>
|
697
717
|
|
698
|
-
<li class="
|
699
|
-
|
718
|
+
<li class="missed" data-hits="0" data-linenumber="45">
|
719
|
+
|
700
720
|
|
701
721
|
<code class="ruby"> bigger_arr = obj1.size >= obj2.size ? obj1 : obj2</code>
|
702
722
|
</li>
|
703
723
|
|
704
|
-
<li class="
|
705
|
-
|
724
|
+
<li class="missed" data-hits="0" data-linenumber="46">
|
725
|
+
|
706
726
|
|
707
727
|
<code class="ruby"> bigger_arr.each_index do |k|</code>
|
708
728
|
</li>
|
709
729
|
|
710
|
-
<li class="
|
711
|
-
|
730
|
+
<li class="missed" data-hits="0" data-linenumber="47">
|
731
|
+
|
712
732
|
|
713
733
|
<code class="ruby"> ret[k] = self.diff(obj1[k], obj2[k]) unless obj1[k] == obj2[k]</code>
|
714
734
|
</li>
|
@@ -743,26 +763,26 @@
|
|
743
763
|
<code class="ruby"> def self.hash_diff(obj1, obj2)</code>
|
744
764
|
</li>
|
745
765
|
|
746
|
-
<li class="
|
747
|
-
|
766
|
+
<li class="missed" data-hits="0" data-linenumber="53">
|
767
|
+
|
748
768
|
|
749
769
|
<code class="ruby"> obj1, obj2 = self.stringify_keys(obj1), self.stringify_keys(obj2)</code>
|
750
770
|
</li>
|
751
771
|
|
752
|
-
<li class="
|
753
|
-
|
772
|
+
<li class="missed" data-hits="0" data-linenumber="54">
|
773
|
+
|
754
774
|
|
755
775
|
<code class="ruby"> (obj1.keys + obj2.keys).uniq.inject({}) do |memo, key|</code>
|
756
776
|
</li>
|
757
777
|
|
758
|
-
<li class="
|
759
|
-
|
778
|
+
<li class="missed" data-hits="0" data-linenumber="55">
|
779
|
+
|
760
780
|
|
761
781
|
<code class="ruby"> if !obj1.keys.include?(key) </code>
|
762
782
|
</li>
|
763
783
|
|
764
|
-
<li class="
|
765
|
-
|
784
|
+
<li class="missed" data-hits="0" data-linenumber="56">
|
785
|
+
|
766
786
|
|
767
787
|
<code class="ruby"> memo[key] = ["KEY MISSING", formatted_value(obj2[key])]</code>
|
768
788
|
</li>
|
@@ -773,8 +793,8 @@
|
|
773
793
|
<code class="ruby"> elsif !obj2.keys.include?(key) </code>
|
774
794
|
</li>
|
775
795
|
|
776
|
-
<li class="
|
777
|
-
|
796
|
+
<li class="missed" data-hits="0" data-linenumber="58">
|
797
|
+
|
778
798
|
|
779
799
|
<code class="ruby"> memo[key] = [formatted_value(obj1[key]), "KEY MISSING"]</code>
|
780
800
|
</li>
|
@@ -785,8 +805,8 @@
|
|
785
805
|
<code class="ruby"> elsif obj1[key] != obj2[key]</code>
|
786
806
|
</li>
|
787
807
|
|
788
|
-
<li class="
|
789
|
-
|
808
|
+
<li class="missed" data-hits="0" data-linenumber="60">
|
809
|
+
|
790
810
|
|
791
811
|
<code class="ruby"> memo[key] = self.diff(obj1[key], obj2[key])</code>
|
792
812
|
</li>
|
@@ -797,8 +817,8 @@
|
|
797
817
|
<code class="ruby"> end</code>
|
798
818
|
</li>
|
799
819
|
|
800
|
-
<li class="
|
801
|
-
|
820
|
+
<li class="missed" data-hits="0" data-linenumber="62">
|
821
|
+
|
802
822
|
|
803
823
|
<code class="ruby"> memo</code>
|
804
824
|
</li>
|
@@ -827,26 +847,26 @@
|
|
827
847
|
<code class="ruby"> def self.stringify_keys(hash_or_array)</code>
|
828
848
|
</li>
|
829
849
|
|
830
|
-
<li class="
|
831
|
-
|
850
|
+
<li class="missed" data-hits="0" data-linenumber="67">
|
851
|
+
|
832
852
|
|
833
853
|
<code class="ruby"> return hash_or_array.collect{|v| v.is_a?(Hash) || v.is_a?(Array) ? self.stringify_keys(v) : v} if hash_or_array.is_a?(Array)</code>
|
834
854
|
</li>
|
835
855
|
|
836
|
-
<li class="
|
837
|
-
|
856
|
+
<li class="missed" data-hits="0" data-linenumber="68">
|
857
|
+
|
838
858
|
|
839
859
|
<code class="ruby"> {}.tap do |ret|</code>
|
840
860
|
</li>
|
841
861
|
|
842
|
-
<li class="
|
843
|
-
|
862
|
+
<li class="missed" data-hits="0" data-linenumber="69">
|
863
|
+
|
844
864
|
|
845
865
|
<code class="ruby"> hash_or_array.each_pair.each do |k, v|</code>
|
846
866
|
</li>
|
847
867
|
|
848
|
-
<li class="
|
849
|
-
|
868
|
+
<li class="missed" data-hits="0" data-linenumber="70">
|
869
|
+
|
850
870
|
|
851
871
|
<code class="ruby"> ret[k.to_s] = v.is_a?(Hash) || v.is_a?(Array) ? self.stringify_keys(v) : v</code>
|
852
872
|
</li>
|
@@ -882,11 +902,11 @@
|
|
882
902
|
<div class="source_table" id="62f8063523b24e1e0397e524e8e048ddb0ac289c">
|
883
903
|
<div class="header">
|
884
904
|
<h3>lib/core_extensions.rb</h3>
|
885
|
-
<h4><span class="
|
905
|
+
<h4><span class="red">45.88 %</span> covered</h4>
|
886
906
|
<div>
|
887
907
|
<b>85</b> relevant lines.
|
888
|
-
<span class="green"><b>
|
889
|
-
<span class="red"><b>
|
908
|
+
<span class="green"><b>39</b> lines covered</span> and
|
909
|
+
<span class="red"><b>46</b> lines missed.</span>
|
890
910
|
</div>
|
891
911
|
</div>
|
892
912
|
|
@@ -953,8 +973,8 @@
|
|
953
973
|
<code class="ruby"> def initialize(instance)</code>
|
954
974
|
</li>
|
955
975
|
|
956
|
-
<li class="
|
957
|
-
|
976
|
+
<li class="missed" data-hits="0" data-linenumber="11">
|
977
|
+
|
958
978
|
|
959
979
|
<code class="ruby"> @instance = instance</code>
|
960
980
|
</li>
|
@@ -977,8 +997,8 @@
|
|
977
997
|
<code class="ruby"> # allow nils to match</code>
|
978
998
|
</li>
|
979
999
|
|
980
|
-
<li class="
|
981
|
-
|
1000
|
+
<li class="missed" data-hits="0" data-linenumber="15">
|
1001
|
+
|
982
1002
|
|
983
1003
|
<code class="ruby"> return true if other.nil?</code>
|
984
1004
|
</li>
|
@@ -989,20 +1009,20 @@
|
|
989
1009
|
<code class="ruby"> # attempt to parse any strings</code>
|
990
1010
|
</li>
|
991
1011
|
|
992
|
-
<li class="
|
993
|
-
|
1012
|
+
<li class="missed" data-hits="0" data-linenumber="17">
|
1013
|
+
|
994
1014
|
|
995
1015
|
<code class="ruby"> if other.is_a?(String)</code>
|
996
1016
|
</li>
|
997
1017
|
|
998
|
-
<li class="
|
999
|
-
|
1018
|
+
<li class="missed" data-hits="0" data-linenumber="18">
|
1019
|
+
|
1000
1020
|
|
1001
1021
|
<code class="ruby"> begin</code>
|
1002
1022
|
</li>
|
1003
1023
|
|
1004
|
-
<li class="
|
1005
|
-
|
1024
|
+
<li class="missed" data-hits="0" data-linenumber="19">
|
1025
|
+
|
1006
1026
|
|
1007
1027
|
<code class="ruby"> other = self.instance.class.parse(other)</code>
|
1008
1028
|
</li>
|
@@ -1031,8 +1051,8 @@
|
|
1031
1051
|
<code class="ruby"> end</code>
|
1032
1052
|
</li>
|
1033
1053
|
|
1034
|
-
<li class="
|
1035
|
-
|
1054
|
+
<li class="missed" data-hits="0" data-linenumber="24">
|
1055
|
+
|
1036
1056
|
|
1037
1057
|
<code class="ruby"> self.instance.class == other.class</code>
|
1038
1058
|
</li>
|
@@ -1217,8 +1237,8 @@
|
|
1217
1237
|
<code class="ruby"> def initialize(instance)</code>
|
1218
1238
|
</li>
|
1219
1239
|
|
1220
|
-
<li class="
|
1221
|
-
|
1240
|
+
<li class="missed" data-hits="0" data-linenumber="55">
|
1241
|
+
|
1222
1242
|
|
1223
1243
|
<code class="ruby"> @instance = instance</code>
|
1224
1244
|
</li>
|
@@ -1235,8 +1255,8 @@
|
|
1235
1255
|
<code class="ruby"> def ==(other)</code>
|
1236
1256
|
</li>
|
1237
1257
|
|
1238
|
-
<li class="
|
1239
|
-
|
1258
|
+
<li class="missed" data-hits="0" data-linenumber="58">
|
1259
|
+
|
1240
1260
|
|
1241
1261
|
<code class="ruby"> return (other.is_a?(TrueClass) || other.is_a?(FalseClass) || other.is_a?(BooleanMatcher))</code>
|
1242
1262
|
</li>
|
@@ -1403,8 +1423,8 @@
|
|
1403
1423
|
<code class="ruby"> def matcher(opts={})</code>
|
1404
1424
|
</li>
|
1405
1425
|
|
1406
|
-
<li class="
|
1407
|
-
|
1426
|
+
<li class="missed" data-hits="0" data-linenumber="86">
|
1427
|
+
|
1408
1428
|
|
1409
1429
|
<code class="ruby"> PathString.new(":#{self}")</code>
|
1410
1430
|
</li>
|
@@ -1421,14 +1441,14 @@
|
|
1421
1441
|
<code class="ruby"> def ==(other)</code>
|
1422
1442
|
</li>
|
1423
1443
|
|
1424
|
-
<li class="
|
1425
|
-
|
1444
|
+
<li class="missed" data-hits="0" data-linenumber="89">
|
1445
|
+
|
1426
1446
|
|
1427
1447
|
<code class="ruby"> return true if other.is_a?(PathString) && other =~ /^:/</code>
|
1428
1448
|
</li>
|
1429
1449
|
|
1430
|
-
<li class="
|
1431
|
-
|
1450
|
+
<li class="missed" data-hits="0" data-linenumber="90">
|
1451
|
+
|
1432
1452
|
|
1433
1453
|
<code class="ruby"> super</code>
|
1434
1454
|
</li>
|
@@ -1481,8 +1501,8 @@
|
|
1481
1501
|
<code class="ruby"> # if we have a leading : or a /:xyz - a matcher is already defined</code>
|
1482
1502
|
</li>
|
1483
1503
|
|
1484
|
-
<li class="
|
1485
|
-
|
1504
|
+
<li class="missed" data-hits="0" data-linenumber="99">
|
1505
|
+
|
1486
1506
|
|
1487
1507
|
<code class="ruby"> self =~ /(^:|\/:)/ ? PathString.new(self) : PathString.new(":#{self}")</code>
|
1488
1508
|
</li>
|
@@ -1499,20 +1519,20 @@
|
|
1499
1519
|
<code class="ruby"> define_method "==_with_path_string" do |other|</code>
|
1500
1520
|
</li>
|
1501
1521
|
|
1502
|
-
<li class="covered" data-hits="
|
1503
|
-
<span class="hits">
|
1522
|
+
<li class="covered" data-hits="920" data-linenumber="102">
|
1523
|
+
<span class="hits">920</span>
|
1504
1524
|
|
1505
1525
|
<code class="ruby"> if other.is_a?(PathString)</code>
|
1506
1526
|
</li>
|
1507
1527
|
|
1508
|
-
<li class="
|
1509
|
-
|
1528
|
+
<li class="missed" data-hits="0" data-linenumber="103">
|
1529
|
+
|
1510
1530
|
|
1511
1531
|
<code class="ruby"> return true if self.is_a?(PathString)</code>
|
1512
1532
|
</li>
|
1513
1533
|
|
1514
|
-
<li class="
|
1515
|
-
|
1534
|
+
<li class="missed" data-hits="0" data-linenumber="104">
|
1535
|
+
|
1516
1536
|
|
1517
1537
|
<code class="ruby"> return other == self </code>
|
1518
1538
|
</li>
|
@@ -1523,8 +1543,8 @@
|
|
1523
1543
|
<code class="ruby"> end</code>
|
1524
1544
|
</li>
|
1525
1545
|
|
1526
|
-
<li class="covered" data-hits="
|
1527
|
-
<span class="hits">
|
1546
|
+
<li class="covered" data-hits="920" data-linenumber="106">
|
1547
|
+
<span class="hits">920</span>
|
1528
1548
|
|
1529
1549
|
<code class="ruby"> return self.send("==_without_path_string", other)</code>
|
1530
1550
|
</li>
|
@@ -1667,20 +1687,20 @@
|
|
1667
1687
|
<code class="ruby"> def matcher(opts = {})</code>
|
1668
1688
|
</li>
|
1669
1689
|
|
1670
|
-
<li class="
|
1671
|
-
|
1690
|
+
<li class="missed" data-hits="0" data-linenumber="130">
|
1691
|
+
|
1672
1692
|
|
1673
1693
|
<code class="ruby"> opts[:only] ||= self.keys.collect(&:to_sym)</code>
|
1674
1694
|
</li>
|
1675
1695
|
|
1676
|
-
<li class="
|
1677
|
-
|
1696
|
+
<li class="missed" data-hits="0" data-linenumber="131">
|
1697
|
+
|
1678
1698
|
|
1679
1699
|
<code class="ruby"> opts[:only] = opts[:only].collect(&:to_sym)</code>
|
1680
1700
|
</li>
|
1681
1701
|
|
1682
|
-
<li class="
|
1683
|
-
|
1702
|
+
<li class="missed" data-hits="0" data-linenumber="132">
|
1703
|
+
|
1684
1704
|
|
1685
1705
|
<code class="ruby"> opts[:only] -= (opts[:except] || []).collect(&:to_sym)</code>
|
1686
1706
|
</li>
|
@@ -1691,26 +1711,26 @@
|
|
1691
1711
|
<code class="ruby"> </code>
|
1692
1712
|
</li>
|
1693
1713
|
|
1694
|
-
<li class="
|
1695
|
-
|
1714
|
+
<li class="missed" data-hits="0" data-linenumber="134">
|
1715
|
+
|
1696
1716
|
|
1697
1717
|
<code class="ruby"> ret = self.class.new</code>
|
1698
1718
|
</li>
|
1699
1719
|
|
1700
|
-
<li class="
|
1701
|
-
|
1720
|
+
<li class="missed" data-hits="0" data-linenumber="135">
|
1721
|
+
|
1702
1722
|
|
1703
1723
|
<code class="ruby"> self.each_pair do |k,v|</code>
|
1704
1724
|
</li>
|
1705
1725
|
|
1706
|
-
<li class="
|
1707
|
-
|
1726
|
+
<li class="missed" data-hits="0" data-linenumber="136">
|
1727
|
+
|
1708
1728
|
|
1709
1729
|
<code class="ruby"> if opts[:only].include?(k.to_sym)</code>
|
1710
1730
|
</li>
|
1711
1731
|
|
1712
|
-
<li class="
|
1713
|
-
|
1732
|
+
<li class="missed" data-hits="0" data-linenumber="137">
|
1733
|
+
|
1714
1734
|
|
1715
1735
|
<code class="ruby"> ret[k] = v.matcher(opts[k.to_sym] || {})</code>
|
1716
1736
|
</li>
|
@@ -1727,8 +1747,8 @@
|
|
1727
1747
|
<code class="ruby"> # Still try to pathify strings if this is an array or hash</code>
|
1728
1748
|
</li>
|
1729
1749
|
|
1730
|
-
<li class="
|
1731
|
-
|
1750
|
+
<li class="missed" data-hits="0" data-linenumber="140">
|
1751
|
+
|
1732
1752
|
|
1733
1753
|
<code class="ruby"> if v.is_a?(Array) || v.is_a?(Hash)</code>
|
1734
1754
|
</li>
|
@@ -1745,8 +1765,8 @@
|
|
1745
1765
|
<code class="ruby"> else</code>
|
1746
1766
|
</li>
|
1747
1767
|
|
1748
|
-
<li class="
|
1749
|
-
|
1768
|
+
<li class="missed" data-hits="0" data-linenumber="143">
|
1769
|
+
|
1750
1770
|
|
1751
1771
|
<code class="ruby"> ret[k] = v</code>
|
1752
1772
|
</li>
|
@@ -1769,8 +1789,8 @@
|
|
1769
1789
|
<code class="ruby"> end</code>
|
1770
1790
|
</li>
|
1771
1791
|
|
1772
|
-
<li class="
|
1773
|
-
|
1792
|
+
<li class="missed" data-hits="0" data-linenumber="147">
|
1793
|
+
|
1774
1794
|
|
1775
1795
|
<code class="ruby"> ret</code>
|
1776
1796
|
</li>
|
@@ -1799,8 +1819,8 @@
|
|
1799
1819
|
<code class="ruby"> def pathify_strings</code>
|
1800
1820
|
</li>
|
1801
1821
|
|
1802
|
-
<li class="
|
1803
|
-
|
1822
|
+
<li class="missed" data-hits="0" data-linenumber="152">
|
1823
|
+
|
1804
1824
|
|
1805
1825
|
<code class="ruby"> if self.first == ":matcher"</code>
|
1806
1826
|
</li>
|
@@ -1817,8 +1837,8 @@
|
|
1817
1837
|
<code class="ruby"> else</code>
|
1818
1838
|
</li>
|
1819
1839
|
|
1820
|
-
<li class="
|
1821
|
-
|
1840
|
+
<li class="missed" data-hits="0" data-linenumber="155">
|
1841
|
+
|
1822
1842
|
|
1823
1843
|
<code class="ruby"> val = self</code>
|
1824
1844
|
</li>
|
@@ -1829,20 +1849,20 @@
|
|
1829
1849
|
<code class="ruby"> end</code>
|
1830
1850
|
</li>
|
1831
1851
|
|
1832
|
-
<li class="
|
1833
|
-
|
1852
|
+
<li class="missed" data-hits="0" data-linenumber="157">
|
1853
|
+
|
1834
1854
|
|
1835
1855
|
<code class="ruby"> val.each_with_index do |v,k|</code>
|
1836
1856
|
</li>
|
1837
1857
|
|
1838
|
-
<li class="
|
1839
|
-
|
1858
|
+
<li class="missed" data-hits="0" data-linenumber="158">
|
1859
|
+
|
1840
1860
|
|
1841
1861
|
<code class="ruby"> if v.is_a?(Array) || v.is_a?(Hash)</code>
|
1842
1862
|
</li>
|
1843
1863
|
|
1844
|
-
<li class="
|
1845
|
-
|
1864
|
+
<li class="missed" data-hits="0" data-linenumber="159">
|
1865
|
+
|
1846
1866
|
|
1847
1867
|
<code class="ruby"> val[k] = v.pathify_strings</code>
|
1848
1868
|
</li>
|
@@ -1853,8 +1873,8 @@
|
|
1853
1873
|
<code class="ruby"> elsif v.instance_of?(String) || v.is_a?(Numeric)</code>
|
1854
1874
|
</li>
|
1855
1875
|
|
1856
|
-
<li class="
|
1857
|
-
|
1876
|
+
<li class="missed" data-hits="0" data-linenumber="161">
|
1877
|
+
|
1858
1878
|
|
1859
1879
|
<code class="ruby"> val[k] = PathString.new(URI.decode(v.to_s))</code>
|
1860
1880
|
</li>
|
@@ -1871,8 +1891,8 @@
|
|
1871
1891
|
<code class="ruby"> end</code>
|
1872
1892
|
</li>
|
1873
1893
|
|
1874
|
-
<li class="
|
1875
|
-
|
1894
|
+
<li class="missed" data-hits="0" data-linenumber="164">
|
1895
|
+
|
1876
1896
|
|
1877
1897
|
<code class="ruby"> val</code>
|
1878
1898
|
</li>
|
@@ -1895,20 +1915,20 @@
|
|
1895
1915
|
<code class="ruby"> def matcher(opts = {})</code>
|
1896
1916
|
</li>
|
1897
1917
|
|
1898
|
-
<li class="
|
1899
|
-
|
1918
|
+
<li class="missed" data-hits="0" data-linenumber="168">
|
1919
|
+
|
1900
1920
|
|
1901
1921
|
<code class="ruby"> klone = self.clone</code>
|
1902
1922
|
</li>
|
1903
1923
|
|
1904
|
-
<li class="
|
1905
|
-
|
1924
|
+
<li class="missed" data-hits="0" data-linenumber="169">
|
1925
|
+
|
1906
1926
|
|
1907
1927
|
<code class="ruby"> klone.unshift(":matcher")</code>
|
1908
1928
|
</li>
|
1909
1929
|
|
1910
|
-
<li class="
|
1911
|
-
|
1930
|
+
<li class="missed" data-hits="0" data-linenumber="170">
|
1931
|
+
|
1912
1932
|
|
1913
1933
|
<code class="ruby"> VariableArray.new(klone.collect(&:matcher))</code>
|
1914
1934
|
</li>
|
@@ -1943,14 +1963,14 @@
|
|
1943
1963
|
<code class="ruby"> define_method "==_with_variable_array" do |other|</code>
|
1944
1964
|
</li>
|
1945
1965
|
|
1946
|
-
<li class="
|
1947
|
-
|
1966
|
+
<li class="missed" data-hits="0" data-linenumber="176">
|
1967
|
+
|
1948
1968
|
|
1949
1969
|
<code class="ruby"> return other == self if other.is_a?(VariableArray)</code>
|
1950
1970
|
</li>
|
1951
1971
|
|
1952
|
-
<li class="
|
1953
|
-
|
1972
|
+
<li class="missed" data-hits="0" data-linenumber="177">
|
1973
|
+
|
1954
1974
|
|
1955
1975
|
<code class="ruby"> self.send("==_without_variable_array",other)</code>
|
1956
1976
|
</li>
|
@@ -1995,14 +2015,14 @@
|
|
1995
2015
|
</pre>
|
1996
2016
|
</div>
|
1997
2017
|
|
1998
|
-
<div class="source_table" id="
|
2018
|
+
<div class="source_table" id="7ee6b0eb3c9dcde6be408d6b4f636325ec8416f6">
|
1999
2019
|
<div class="header">
|
2000
|
-
<h3>lib/
|
2001
|
-
<h4><span class="
|
2020
|
+
<h3>lib/hash.rb</h3>
|
2021
|
+
<h4><span class="red">36.84 %</span> covered</h4>
|
2002
2022
|
<div>
|
2003
|
-
<b>
|
2004
|
-
<span class="green"><b>
|
2005
|
-
<span class="red"><b>
|
2023
|
+
<b>19</b> relevant lines.
|
2024
|
+
<span class="green"><b>7</b> lines covered</span> and
|
2025
|
+
<span class="red"><b>12</b> lines missed.</span>
|
2006
2026
|
</div>
|
2007
2027
|
</div>
|
2008
2028
|
|
@@ -2012,430 +2032,802 @@
|
|
2012
2032
|
<li class="covered" data-hits="1" data-linenumber="1">
|
2013
2033
|
<span class="hits">1</span>
|
2014
2034
|
|
2015
|
-
<code class="ruby">
|
2035
|
+
<code class="ruby">class HashDealer</code>
|
2016
2036
|
</li>
|
2017
2037
|
|
2018
|
-
<li class="
|
2019
|
-
|
2038
|
+
<li class="covered" data-hits="1" data-linenumber="2">
|
2039
|
+
<span class="hits">1</span>
|
2020
2040
|
|
2021
|
-
<code class="ruby"
|
2041
|
+
<code class="ruby"> class Hash < ::Hash</code>
|
2022
2042
|
</li>
|
2023
2043
|
|
2024
|
-
<li class="
|
2025
|
-
<span class="hits">1</span>
|
2044
|
+
<li class="never" data-hits="" data-linenumber="3">
|
2026
2045
|
|
2027
|
-
|
2046
|
+
|
2047
|
+
<code class="ruby"></code>
|
2028
2048
|
</li>
|
2029
2049
|
|
2030
2050
|
<li class="covered" data-hits="1" data-linenumber="4">
|
2031
2051
|
<span class="hits">1</span>
|
2032
2052
|
|
2033
|
-
<code class="ruby">
|
2053
|
+
<code class="ruby"> def initialize(optional_attributes = [])</code>
|
2034
2054
|
</li>
|
2035
2055
|
|
2036
|
-
<li class="
|
2037
|
-
<span class="hits">1</span>
|
2056
|
+
<li class="missed" data-hits="0" data-linenumber="5">
|
2038
2057
|
|
2039
|
-
<code class="ruby">require File.expand_path('../core_extensions', __FILE__)</code>
|
2040
|
-
</li>
|
2041
|
-
|
2042
|
-
<li class="covered" data-hits="1" data-linenumber="6">
|
2043
|
-
<span class="hits">1</span>
|
2044
2058
|
|
2045
|
-
<code class="ruby">
|
2059
|
+
<code class="ruby"> @optional_attributes = optional_attributes</code>
|
2046
2060
|
</li>
|
2047
2061
|
|
2048
|
-
<li class="
|
2049
|
-
<span class="hits">1</span>
|
2062
|
+
<li class="never" data-hits="" data-linenumber="6">
|
2050
2063
|
|
2051
|
-
|
2064
|
+
|
2065
|
+
<code class="ruby"> end</code>
|
2052
2066
|
</li>
|
2053
2067
|
|
2054
|
-
<li class="never" data-hits="" data-linenumber="
|
2068
|
+
<li class="never" data-hits="" data-linenumber="7">
|
2055
2069
|
|
2056
2070
|
|
2057
2071
|
<code class="ruby"></code>
|
2058
2072
|
</li>
|
2059
2073
|
|
2060
|
-
<li class="covered" data-hits="1" data-linenumber="
|
2074
|
+
<li class="covered" data-hits="1" data-linenumber="8">
|
2061
2075
|
<span class="hits">1</span>
|
2062
2076
|
|
2063
|
-
<code class="ruby">
|
2077
|
+
<code class="ruby"> def eql?(other)</code>
|
2064
2078
|
</li>
|
2065
2079
|
|
2066
|
-
<li class="
|
2080
|
+
<li class="missed" data-hits="0" data-linenumber="9">
|
2067
2081
|
|
2068
2082
|
|
2069
|
-
<code class="ruby">
|
2083
|
+
<code class="ruby"> self_for_comparison = self.remove_optional_keys(self)</code>
|
2070
2084
|
</li>
|
2071
2085
|
|
2072
|
-
<li class="
|
2073
|
-
<span class="hits">1</span>
|
2086
|
+
<li class="missed" data-hits="0" data-linenumber="10">
|
2074
2087
|
|
2075
|
-
|
2088
|
+
|
2089
|
+
<code class="ruby"> other_for_comparison = self.remove_optional_keys(other)</code>
|
2076
2090
|
</li>
|
2077
2091
|
|
2078
|
-
<li class="never" data-hits="" data-linenumber="
|
2092
|
+
<li class="never" data-hits="" data-linenumber="11">
|
2079
2093
|
|
2080
2094
|
|
2081
2095
|
<code class="ruby"></code>
|
2082
2096
|
</li>
|
2083
2097
|
|
2098
|
+
<li class="missed" data-hits="0" data-linenumber="12">
|
2099
|
+
|
2100
|
+
|
2101
|
+
<code class="ruby"> self_for_comparison.eql?(other_for_comparison)</code>
|
2102
|
+
</li>
|
2103
|
+
|
2084
2104
|
<li class="never" data-hits="" data-linenumber="13">
|
2085
2105
|
|
2086
2106
|
|
2087
|
-
<code class="ruby">
|
2107
|
+
<code class="ruby"> end</code>
|
2088
2108
|
</li>
|
2089
2109
|
|
2090
|
-
<li class="
|
2091
|
-
<span class="hits">1</span>
|
2110
|
+
<li class="never" data-hits="" data-linenumber="14">
|
2092
2111
|
|
2093
|
-
|
2112
|
+
|
2113
|
+
<code class="ruby"></code>
|
2094
2114
|
</li>
|
2095
2115
|
|
2096
|
-
<li class="covered" data-hits="
|
2097
|
-
<span class="hits">
|
2116
|
+
<li class="covered" data-hits="1" data-linenumber="15">
|
2117
|
+
<span class="hits">1</span>
|
2098
2118
|
|
2099
|
-
<code class="ruby">
|
2119
|
+
<code class="ruby"> def to_hash</code>
|
2100
2120
|
</li>
|
2101
2121
|
|
2102
|
-
<li class="
|
2122
|
+
<li class="missed" data-hits="0" data-linenumber="16">
|
2103
2123
|
|
2104
2124
|
|
2105
|
-
<code class="ruby">
|
2125
|
+
<code class="ruby"> ret = ::Hash.new</code>
|
2106
2126
|
</li>
|
2107
2127
|
|
2108
|
-
<li class="
|
2128
|
+
<li class="missed" data-hits="0" data-linenumber="17">
|
2109
2129
|
|
2110
2130
|
|
2111
|
-
<code class="ruby">
|
2131
|
+
<code class="ruby"> self.each_pair do |k,v|</code>
|
2112
2132
|
</li>
|
2113
2133
|
|
2114
|
-
<li class="
|
2134
|
+
<li class="missed" data-hits="0" data-linenumber="18">
|
2115
2135
|
|
2116
2136
|
|
2117
|
-
<code class="ruby">
|
2137
|
+
<code class="ruby"> ret[k] = v</code>
|
2118
2138
|
</li>
|
2119
2139
|
|
2120
|
-
<li class="
|
2121
|
-
<span class="hits">1</span>
|
2140
|
+
<li class="never" data-hits="" data-linenumber="19">
|
2122
2141
|
|
2123
|
-
|
2142
|
+
|
2143
|
+
<code class="ruby"> end</code>
|
2124
2144
|
</li>
|
2125
2145
|
|
2126
|
-
<li class="
|
2127
|
-
<span class="hits">23</span>
|
2146
|
+
<li class="missed" data-hits="0" data-linenumber="20">
|
2128
2147
|
|
2129
|
-
|
2148
|
+
|
2149
|
+
<code class="ruby"> ret</code>
|
2130
2150
|
</li>
|
2131
2151
|
|
2132
2152
|
<li class="never" data-hits="" data-linenumber="21">
|
2133
2153
|
|
2134
2154
|
|
2135
|
-
<code class="ruby">
|
2155
|
+
<code class="ruby"> end</code>
|
2136
2156
|
</li>
|
2137
2157
|
|
2138
2158
|
<li class="never" data-hits="" data-linenumber="22">
|
2139
2159
|
|
2140
2160
|
|
2141
|
-
<code class="ruby"
|
2161
|
+
<code class="ruby"></code>
|
2142
2162
|
</li>
|
2143
2163
|
|
2144
2164
|
<li class="covered" data-hits="1" data-linenumber="23">
|
2145
2165
|
<span class="hits">1</span>
|
2146
2166
|
|
2147
|
-
<code class="ruby">
|
2167
|
+
<code class="ruby"> protected</code>
|
2148
2168
|
</li>
|
2149
2169
|
|
2150
|
-
<li class="
|
2151
|
-
<span class="hits">40</span>
|
2170
|
+
<li class="never" data-hits="" data-linenumber="24">
|
2152
2171
|
|
2153
|
-
|
2172
|
+
|
2173
|
+
<code class="ruby"></code>
|
2154
2174
|
</li>
|
2155
2175
|
|
2156
|
-
<li class="covered" data-hits="
|
2157
|
-
<span class="hits">
|
2176
|
+
<li class="covered" data-hits="1" data-linenumber="25">
|
2177
|
+
<span class="hits">1</span>
|
2158
2178
|
|
2159
|
-
<code class="ruby">
|
2179
|
+
<code class="ruby"> def remove_optional_keys(hash)</code>
|
2160
2180
|
</li>
|
2161
2181
|
|
2162
|
-
<li class="
|
2182
|
+
<li class="missed" data-hits="0" data-linenumber="26">
|
2163
2183
|
|
2164
2184
|
|
2165
|
-
<code class="ruby"
|
2185
|
+
<code class="ruby"> hash = hash.clone.to_hash</code>
|
2166
2186
|
</li>
|
2167
2187
|
|
2168
|
-
<li class="
|
2169
|
-
<span class="hits">40</span>
|
2188
|
+
<li class="missed" data-hits="0" data-linenumber="27">
|
2170
2189
|
|
2171
|
-
|
2190
|
+
|
2191
|
+
<code class="ruby"> @optional_attributes.each do |optional_attribute|</code>
|
2172
2192
|
</li>
|
2173
2193
|
|
2174
|
-
<li class="
|
2194
|
+
<li class="missed" data-hits="0" data-linenumber="28">
|
2175
2195
|
|
2176
2196
|
|
2177
|
-
<code class="ruby">
|
2197
|
+
<code class="ruby"> hash.delete(optional_attribute)</code>
|
2178
2198
|
</li>
|
2179
2199
|
|
2180
2200
|
<li class="never" data-hits="" data-linenumber="29">
|
2181
2201
|
|
2182
2202
|
|
2183
|
-
<code class="ruby">
|
2203
|
+
<code class="ruby"> end</code>
|
2184
2204
|
</li>
|
2185
2205
|
|
2186
|
-
<li class="
|
2206
|
+
<li class="missed" data-hits="0" data-linenumber="30">
|
2187
2207
|
|
2188
2208
|
|
2189
|
-
<code class="ruby">
|
2209
|
+
<code class="ruby"> hash</code>
|
2190
2210
|
</li>
|
2191
2211
|
|
2192
|
-
<li class="
|
2193
|
-
<span class="hits">1</span>
|
2212
|
+
<li class="never" data-hits="" data-linenumber="31">
|
2194
2213
|
|
2195
|
-
<code class="ruby"> def initialize(opts = {}, &block)</code>
|
2196
|
-
</li>
|
2197
|
-
|
2198
|
-
<li class="covered" data-hits="23" data-linenumber="32">
|
2199
|
-
<span class="hits">23</span>
|
2200
2214
|
|
2201
|
-
<code class="ruby">
|
2215
|
+
<code class="ruby"> end</code>
|
2202
2216
|
</li>
|
2203
2217
|
|
2204
|
-
<li class="
|
2205
|
-
<span class="hits">23</span>
|
2218
|
+
<li class="never" data-hits="" data-linenumber="32">
|
2206
2219
|
|
2207
|
-
|
2220
|
+
|
2221
|
+
<code class="ruby"></code>
|
2208
2222
|
</li>
|
2209
2223
|
|
2210
|
-
<li class="never" data-hits="" data-linenumber="
|
2224
|
+
<li class="never" data-hits="" data-linenumber="33">
|
2211
2225
|
|
2212
2226
|
|
2213
2227
|
<code class="ruby"> end</code>
|
2214
2228
|
</li>
|
2215
2229
|
|
2216
|
-
<li class="never" data-hits="" data-linenumber="
|
2230
|
+
<li class="never" data-hits="" data-linenumber="34">
|
2217
2231
|
|
2218
2232
|
|
2219
|
-
<code class="ruby">
|
2233
|
+
<code class="ruby">end</code>
|
2220
2234
|
</li>
|
2221
2235
|
|
2222
|
-
|
2223
|
-
|
2224
|
-
|
2225
|
-
<code class="ruby"> # set the value as the root element for attributes</code>
|
2226
|
-
</li>
|
2236
|
+
</ol>
|
2237
|
+
</pre>
|
2238
|
+
</div>
|
2227
2239
|
|
2228
|
-
<
|
2240
|
+
<div class="source_table" id="9082f1e417147c61ee326c565b15a99cad953b35">
|
2241
|
+
<div class="header">
|
2242
|
+
<h3>lib/hash_dealer.rb</h3>
|
2243
|
+
<h4><span class="red">39.58 %</span> covered</h4>
|
2244
|
+
<div>
|
2245
|
+
<b>48</b> relevant lines.
|
2246
|
+
<span class="green"><b>19</b> lines covered</span> and
|
2247
|
+
<span class="red"><b>29</b> lines missed.</span>
|
2248
|
+
</div>
|
2249
|
+
</div>
|
2250
|
+
|
2251
|
+
<pre>
|
2252
|
+
<ol>
|
2253
|
+
|
2254
|
+
<li class="covered" data-hits="1" data-linenumber="1">
|
2255
|
+
<span class="hits">1</span>
|
2256
|
+
|
2257
|
+
<code class="ruby">require 'colorize'</code>
|
2258
|
+
</li>
|
2259
|
+
|
2260
|
+
<li class="never" data-hits="" data-linenumber="2">
|
2261
|
+
|
2262
|
+
|
2263
|
+
<code class="ruby"></code>
|
2264
|
+
</li>
|
2265
|
+
|
2266
|
+
<li class="covered" data-hits="1" data-linenumber="3">
|
2267
|
+
<span class="hits">1</span>
|
2268
|
+
|
2269
|
+
<code class="ruby">require File.expand_path('../path_string', __FILE__)</code>
|
2270
|
+
</li>
|
2271
|
+
|
2272
|
+
<li class="covered" data-hits="1" data-linenumber="4">
|
2273
|
+
<span class="hits">1</span>
|
2274
|
+
|
2275
|
+
<code class="ruby">require File.expand_path('../variable_array', __FILE__)</code>
|
2276
|
+
</li>
|
2277
|
+
|
2278
|
+
<li class="covered" data-hits="1" data-linenumber="5">
|
2279
|
+
<span class="hits">1</span>
|
2280
|
+
|
2281
|
+
<code class="ruby">require File.expand_path('../core_extensions', __FILE__)</code>
|
2282
|
+
</li>
|
2283
|
+
|
2284
|
+
<li class="covered" data-hits="1" data-linenumber="6">
|
2285
|
+
<span class="hits">1</span>
|
2286
|
+
|
2287
|
+
<code class="ruby">require File.expand_path('../matcher', __FILE__)</code>
|
2288
|
+
</li>
|
2289
|
+
|
2290
|
+
<li class="covered" data-hits="1" data-linenumber="7">
|
2291
|
+
<span class="hits">1</span>
|
2292
|
+
|
2293
|
+
<code class="ruby">require File.expand_path('../comparator', __FILE__)</code>
|
2294
|
+
</li>
|
2295
|
+
|
2296
|
+
<li class="covered" data-hits="1" data-linenumber="8">
|
2297
|
+
<span class="hits">1</span>
|
2298
|
+
|
2299
|
+
<code class="ruby">require File.expand_path('../hash', __FILE__)</code>
|
2300
|
+
</li>
|
2301
|
+
|
2302
|
+
<li class="never" data-hits="" data-linenumber="9">
|
2303
|
+
|
2304
|
+
|
2305
|
+
<code class="ruby"></code>
|
2306
|
+
</li>
|
2307
|
+
|
2308
|
+
<li class="covered" data-hits="1" data-linenumber="10">
|
2309
|
+
<span class="hits">1</span>
|
2310
|
+
|
2311
|
+
<code class="ruby">class HashDealer</code>
|
2312
|
+
</li>
|
2313
|
+
|
2314
|
+
<li class="never" data-hits="" data-linenumber="11">
|
2315
|
+
|
2316
|
+
|
2317
|
+
<code class="ruby"> </code>
|
2318
|
+
</li>
|
2319
|
+
|
2320
|
+
<li class="covered" data-hits="1" data-linenumber="12">
|
2321
|
+
<span class="hits">1</span>
|
2322
|
+
|
2323
|
+
<code class="ruby"> attr_accessor :parent</code>
|
2324
|
+
</li>
|
2325
|
+
|
2326
|
+
<li class="covered" data-hits="1" data-linenumber="13">
|
2327
|
+
<span class="hits">1</span>
|
2328
|
+
|
2329
|
+
<code class="ruby"> attr_accessor :optional_attributes</code>
|
2330
|
+
</li>
|
2331
|
+
|
2332
|
+
<li class="never" data-hits="" data-linenumber="14">
|
2333
|
+
|
2334
|
+
|
2335
|
+
<code class="ruby"></code>
|
2336
|
+
</li>
|
2337
|
+
|
2338
|
+
<li class="never" data-hits="" data-linenumber="15">
|
2339
|
+
|
2340
|
+
|
2341
|
+
<code class="ruby"> # cattr_accessor</code>
|
2342
|
+
</li>
|
2343
|
+
|
2344
|
+
<li class="covered" data-hits="1" data-linenumber="16">
|
2345
|
+
<span class="hits">1</span>
|
2346
|
+
|
2347
|
+
<code class="ruby"> def self.hashes</code>
|
2348
|
+
</li>
|
2349
|
+
|
2350
|
+
<li class="missed" data-hits="0" data-linenumber="17">
|
2351
|
+
|
2352
|
+
|
2353
|
+
<code class="ruby"> @hashes ||= {}</code>
|
2354
|
+
</li>
|
2355
|
+
|
2356
|
+
<li class="never" data-hits="" data-linenumber="18">
|
2357
|
+
|
2358
|
+
|
2359
|
+
<code class="ruby"> end</code>
|
2360
|
+
</li>
|
2361
|
+
|
2362
|
+
<li class="never" data-hits="" data-linenumber="19">
|
2363
|
+
|
2364
|
+
|
2365
|
+
<code class="ruby"> </code>
|
2366
|
+
</li>
|
2367
|
+
|
2368
|
+
<li class="never" data-hits="" data-linenumber="20">
|
2369
|
+
|
2370
|
+
|
2371
|
+
<code class="ruby"> # define a method of the request factory</code>
|
2372
|
+
</li>
|
2373
|
+
|
2374
|
+
<li class="covered" data-hits="1" data-linenumber="21">
|
2375
|
+
<span class="hits">1</span>
|
2376
|
+
|
2377
|
+
<code class="ruby"> def self.define(name, opts = {}, &block)</code>
|
2378
|
+
</li>
|
2379
|
+
|
2380
|
+
<li class="missed" data-hits="0" data-linenumber="22">
|
2381
|
+
|
2382
|
+
|
2383
|
+
<code class="ruby"> self.hashes[name] = [opts, block]</code>
|
2384
|
+
</li>
|
2385
|
+
|
2386
|
+
<li class="never" data-hits="" data-linenumber="23">
|
2387
|
+
|
2388
|
+
|
2389
|
+
<code class="ruby"> end</code>
|
2390
|
+
</li>
|
2391
|
+
|
2392
|
+
<li class="never" data-hits="" data-linenumber="24">
|
2393
|
+
|
2394
|
+
|
2395
|
+
<code class="ruby"> </code>
|
2396
|
+
</li>
|
2397
|
+
|
2398
|
+
<li class="covered" data-hits="1" data-linenumber="25">
|
2399
|
+
<span class="hits">1</span>
|
2400
|
+
|
2401
|
+
<code class="ruby"> def self.roll(name, overrides = {})</code>
|
2402
|
+
</li>
|
2403
|
+
|
2404
|
+
<li class="missed" data-hits="0" data-linenumber="26">
|
2405
|
+
|
2406
|
+
|
2407
|
+
<code class="ruby"> raise Exception.new("No HashDealer called #{name}") unless self.hashes[name]</code>
|
2408
|
+
</li>
|
2409
|
+
|
2410
|
+
<li class="missed" data-hits="0" data-linenumber="27">
|
2411
|
+
|
2412
|
+
|
2413
|
+
<code class="ruby"> self.hashes[name] = self.new(self.hashes[name][0], &self.hashes[name][1]) unless self.hashes[name].is_a?(HashDealer)</code>
|
2414
|
+
</li>
|
2415
|
+
|
2416
|
+
<li class="never" data-hits="" data-linenumber="28">
|
2417
|
+
|
2418
|
+
|
2419
|
+
<code class="ruby"></code>
|
2420
|
+
</li>
|
2421
|
+
|
2422
|
+
<li class="missed" data-hits="0" data-linenumber="29">
|
2423
|
+
|
2424
|
+
|
2425
|
+
<code class="ruby"> self.hashes[name]._attributes(overrides)</code>
|
2426
|
+
</li>
|
2427
|
+
|
2428
|
+
<li class="never" data-hits="" data-linenumber="30">
|
2429
|
+
|
2430
|
+
|
2431
|
+
<code class="ruby"> end</code>
|
2432
|
+
</li>
|
2433
|
+
|
2434
|
+
<li class="never" data-hits="" data-linenumber="31">
|
2435
|
+
|
2436
|
+
|
2437
|
+
<code class="ruby"> </code>
|
2438
|
+
</li>
|
2439
|
+
|
2440
|
+
<li class="never" data-hits="" data-linenumber="32">
|
2441
|
+
|
2442
|
+
|
2443
|
+
<code class="ruby"> # initializer just calls the block from within our DSL</code>
|
2444
|
+
</li>
|
2445
|
+
|
2446
|
+
<li class="covered" data-hits="1" data-linenumber="33">
|
2447
|
+
<span class="hits">1</span>
|
2448
|
+
|
2449
|
+
<code class="ruby"> def initialize(opts = {}, &block)</code>
|
2450
|
+
</li>
|
2451
|
+
|
2452
|
+
<li class="missed" data-hits="0" data-linenumber="34">
|
2453
|
+
|
2454
|
+
|
2455
|
+
<code class="ruby"> @parent = opts[:parent]</code>
|
2456
|
+
</li>
|
2457
|
+
|
2458
|
+
<li class="missed" data-hits="0" data-linenumber="35">
|
2459
|
+
|
2460
|
+
|
2461
|
+
<code class="ruby"> @optional_attributes = []</code>
|
2462
|
+
</li>
|
2463
|
+
|
2464
|
+
<li class="missed" data-hits="0" data-linenumber="36">
|
2465
|
+
|
2466
|
+
|
2467
|
+
<code class="ruby"> instance_eval(&block)</code>
|
2468
|
+
</li>
|
2469
|
+
|
2470
|
+
<li class="never" data-hits="" data-linenumber="37">
|
2471
|
+
|
2472
|
+
|
2473
|
+
<code class="ruby"> end</code>
|
2474
|
+
</li>
|
2475
|
+
|
2476
|
+
<li class="never" data-hits="" data-linenumber="38">
|
2477
|
+
|
2478
|
+
|
2479
|
+
<code class="ruby"> </code>
|
2480
|
+
</li>
|
2481
|
+
|
2482
|
+
<li class="never" data-hits="" data-linenumber="39">
|
2483
|
+
|
2484
|
+
|
2485
|
+
<code class="ruby"> # set the value as the root element for attributes</code>
|
2486
|
+
</li>
|
2487
|
+
|
2488
|
+
<li class="covered" data-hits="1" data-linenumber="40">
|
2229
2489
|
<span class="hits">1</span>
|
2230
2490
|
|
2231
2491
|
<code class="ruby"> def root(value)</code>
|
2232
2492
|
</li>
|
2233
2493
|
|
2234
|
-
<li class="
|
2235
|
-
|
2494
|
+
<li class="missed" data-hits="0" data-linenumber="41">
|
2495
|
+
|
2236
2496
|
|
2237
2497
|
<code class="ruby"> @attributes = value</code>
|
2238
2498
|
</li>
|
2239
2499
|
|
2240
|
-
<li class="never" data-hits="" data-linenumber="
|
2500
|
+
<li class="never" data-hits="" data-linenumber="42">
|
2241
2501
|
|
2242
2502
|
|
2243
2503
|
<code class="ruby"> end</code>
|
2244
2504
|
</li>
|
2245
2505
|
|
2246
|
-
<li class="never" data-hits="" data-linenumber="
|
2506
|
+
<li class="never" data-hits="" data-linenumber="43">
|
2247
2507
|
|
2248
2508
|
|
2249
2509
|
<code class="ruby"></code>
|
2250
2510
|
</li>
|
2251
2511
|
|
2252
|
-
<li class="covered" data-hits="1" data-linenumber="
|
2512
|
+
<li class="covered" data-hits="1" data-linenumber="44">
|
2253
2513
|
<span class="hits">1</span>
|
2254
2514
|
|
2255
2515
|
<code class="ruby"> def [](val)</code>
|
2256
2516
|
</li>
|
2257
2517
|
|
2258
|
-
<li class="missed" data-hits="0" data-linenumber="
|
2518
|
+
<li class="missed" data-hits="0" data-linenumber="45">
|
2259
2519
|
|
2260
2520
|
|
2261
2521
|
<code class="ruby"> @attributes[val]</code>
|
2262
2522
|
</li>
|
2263
2523
|
|
2264
|
-
<li class="never" data-hits="" data-linenumber="
|
2524
|
+
<li class="never" data-hits="" data-linenumber="46">
|
2265
2525
|
|
2266
2526
|
|
2267
2527
|
<code class="ruby"> end</code>
|
2268
2528
|
</li>
|
2269
2529
|
|
2270
|
-
<li class="never" data-hits="" data-linenumber="
|
2530
|
+
<li class="never" data-hits="" data-linenumber="47">
|
2271
2531
|
|
2272
2532
|
|
2273
2533
|
<code class="ruby"> </code>
|
2274
2534
|
</li>
|
2275
2535
|
|
2276
|
-
<li class="never" data-hits="" data-linenumber="
|
2536
|
+
<li class="never" data-hits="" data-linenumber="48">
|
2277
2537
|
|
2278
2538
|
|
2279
2539
|
<code class="ruby"> # get the stored attributes for this HashDealer</code>
|
2280
2540
|
</li>
|
2281
2541
|
|
2282
|
-
<li class="covered" data-hits="1" data-linenumber="
|
2542
|
+
<li class="covered" data-hits="1" data-linenumber="49">
|
2283
2543
|
<span class="hits">1</span>
|
2284
2544
|
|
2285
2545
|
<code class="ruby"> def _attributes(overrides)</code>
|
2286
2546
|
</li>
|
2287
2547
|
|
2288
|
-
<li class="never" data-hits="" data-linenumber="
|
2548
|
+
<li class="never" data-hits="" data-linenumber="50">
|
2289
2549
|
|
2290
2550
|
|
2291
2551
|
<code class="ruby"> # allows us to set a root value</code>
|
2292
2552
|
</li>
|
2293
2553
|
|
2294
|
-
<li class="
|
2295
|
-
|
2554
|
+
<li class="missed" data-hits="0" data-linenumber="51">
|
2555
|
+
|
2296
2556
|
|
2297
2557
|
<code class="ruby"> return @attributes.clone unless @attributes.is_a?(Hash)</code>
|
2298
2558
|
</li>
|
2299
2559
|
|
2300
|
-
<li class="
|
2301
|
-
|
2560
|
+
<li class="never" data-hits="" data-linenumber="52">
|
2561
|
+
|
2562
|
+
|
2563
|
+
<code class="ruby"></code>
|
2564
|
+
</li>
|
2565
|
+
|
2566
|
+
<li class="missed" data-hits="0" data-linenumber="53">
|
2567
|
+
|
2568
|
+
|
2569
|
+
<code class="ruby"> if @parent.present?</code>
|
2570
|
+
</li>
|
2571
|
+
|
2572
|
+
<li class="missed" data-hits="0" data-linenumber="54">
|
2573
|
+
|
2574
|
+
|
2575
|
+
<code class="ruby"> att = HashDealer.roll(@parent.to_sym)</code>
|
2576
|
+
</li>
|
2577
|
+
|
2578
|
+
<li class="never" data-hits="" data-linenumber="55">
|
2579
|
+
|
2580
|
+
|
2581
|
+
<code class="ruby"> else</code>
|
2582
|
+
</li>
|
2583
|
+
|
2584
|
+
<li class="missed" data-hits="0" data-linenumber="56">
|
2585
|
+
|
2586
|
+
|
2587
|
+
<code class="ruby"> att = HashDealer::Hash.new(self.optional_attributes)</code>
|
2588
|
+
</li>
|
2589
|
+
|
2590
|
+
<li class="never" data-hits="" data-linenumber="57">
|
2591
|
+
|
2592
|
+
|
2593
|
+
<code class="ruby"> end</code>
|
2594
|
+
</li>
|
2595
|
+
|
2596
|
+
<li class="never" data-hits="" data-linenumber="58">
|
2597
|
+
|
2302
2598
|
|
2303
|
-
<code class="ruby"
|
2599
|
+
<code class="ruby"></code>
|
2304
2600
|
</li>
|
2305
2601
|
|
2306
|
-
<li class="
|
2307
|
-
|
2602
|
+
<li class="missed" data-hits="0" data-linenumber="59">
|
2603
|
+
|
2308
2604
|
|
2309
2605
|
<code class="ruby"> @attributes.each do |k,v|</code>
|
2310
2606
|
</li>
|
2311
2607
|
|
2312
|
-
<li class="
|
2313
|
-
|
2608
|
+
<li class="missed" data-hits="0" data-linenumber="60">
|
2609
|
+
|
2314
2610
|
|
2315
2611
|
<code class="ruby"> att[k] = v.is_a?(Proc) ? v.call(att.merge(overrides)) : v</code>
|
2316
2612
|
</li>
|
2317
2613
|
|
2318
|
-
<li class="never" data-hits="" data-linenumber="
|
2614
|
+
<li class="never" data-hits="" data-linenumber="61">
|
2319
2615
|
|
2320
2616
|
|
2321
2617
|
<code class="ruby"> end</code>
|
2322
2618
|
</li>
|
2323
2619
|
|
2324
|
-
<li class="never" data-hits="" data-linenumber="
|
2620
|
+
<li class="never" data-hits="" data-linenumber="62">
|
2325
2621
|
|
2326
2622
|
|
2327
2623
|
<code class="ruby"> # if we have a hash as the first arg, it would override the attributes</code>
|
2328
2624
|
</li>
|
2329
2625
|
|
2330
|
-
<li class="
|
2331
|
-
|
2626
|
+
<li class="missed" data-hits="0" data-linenumber="63">
|
2627
|
+
|
2332
2628
|
|
2333
2629
|
<code class="ruby"> overrides.each_pair do |k,v|</code>
|
2334
2630
|
</li>
|
2335
2631
|
|
2336
|
-
<li class="
|
2337
|
-
|
2632
|
+
<li class="missed" data-hits="0" data-linenumber="64">
|
2633
|
+
|
2338
2634
|
|
2339
2635
|
<code class="ruby"> att[k.to_sym] = v if att.has_key?(k.to_sym)</code>
|
2340
2636
|
</li>
|
2341
2637
|
|
2342
|
-
<li class="never" data-hits="" data-linenumber="
|
2638
|
+
<li class="never" data-hits="" data-linenumber="65">
|
2343
2639
|
|
2344
2640
|
|
2345
2641
|
<code class="ruby"> end</code>
|
2346
2642
|
</li>
|
2347
2643
|
|
2348
|
-
<li class="
|
2349
|
-
|
2644
|
+
<li class="missed" data-hits="0" data-linenumber="66">
|
2645
|
+
|
2350
2646
|
|
2351
2647
|
<code class="ruby"> att</code>
|
2352
2648
|
</li>
|
2353
2649
|
|
2354
|
-
<li class="never" data-hits="" data-linenumber="
|
2650
|
+
<li class="never" data-hits="" data-linenumber="67">
|
2355
2651
|
|
2356
2652
|
|
2357
2653
|
<code class="ruby"> end</code>
|
2358
2654
|
</li>
|
2359
2655
|
|
2360
|
-
<li class="never" data-hits="" data-linenumber="
|
2656
|
+
<li class="never" data-hits="" data-linenumber="68">
|
2361
2657
|
|
2362
2658
|
|
2363
2659
|
<code class="ruby"> </code>
|
2364
2660
|
</li>
|
2365
2661
|
|
2366
|
-
<li class="covered" data-hits="1" data-linenumber="
|
2662
|
+
<li class="covered" data-hits="1" data-linenumber="69">
|
2367
2663
|
<span class="hits">1</span>
|
2368
2664
|
|
2369
2665
|
<code class="ruby"> protected</code>
|
2370
2666
|
</li>
|
2371
2667
|
|
2372
|
-
<li class="never" data-hits="" data-linenumber="
|
2668
|
+
<li class="never" data-hits="" data-linenumber="70">
|
2373
2669
|
|
2374
2670
|
|
2375
2671
|
<code class="ruby"> </code>
|
2376
2672
|
</li>
|
2377
2673
|
|
2378
|
-
<li class="never" data-hits="" data-linenumber="
|
2674
|
+
<li class="never" data-hits="" data-linenumber="71">
|
2379
2675
|
|
2380
2676
|
|
2381
2677
|
<code class="ruby"> # method missing</code>
|
2382
2678
|
</li>
|
2383
2679
|
|
2384
|
-
<li class="covered" data-hits="1" data-linenumber="
|
2680
|
+
<li class="covered" data-hits="1" data-linenumber="72">
|
2385
2681
|
<span class="hits">1</span>
|
2386
2682
|
|
2387
2683
|
<code class="ruby"> def method_missing(meth, *args, &block)</code>
|
2388
2684
|
</li>
|
2389
2685
|
|
2390
|
-
<li class="
|
2391
|
-
|
2686
|
+
<li class="never" data-hits="" data-linenumber="73">
|
2687
|
+
|
2688
|
+
|
2689
|
+
<code class="ruby"></code>
|
2690
|
+
</li>
|
2691
|
+
|
2692
|
+
<li class="missed" data-hits="0" data-linenumber="74">
|
2693
|
+
|
2694
|
+
|
2695
|
+
<code class="ruby"> unless args.length > 0 || block_given?</code>
|
2696
|
+
</li>
|
2697
|
+
|
2698
|
+
<li class="never" data-hits="" data-linenumber="75">
|
2699
|
+
|
2700
|
+
|
2701
|
+
<code class="ruby"> raise Exception.new(</code>
|
2702
|
+
</li>
|
2703
|
+
|
2704
|
+
<li class="never" data-hits="" data-linenumber="76">
|
2705
|
+
|
2706
|
+
|
2707
|
+
<code class="ruby"> "Please provide either a String or a block to #{meth}"</code>
|
2708
|
+
</li>
|
2709
|
+
|
2710
|
+
<li class="missed" data-hits="0" data-linenumber="77">
|
2711
|
+
|
2712
|
+
|
2713
|
+
<code class="ruby"> )</code>
|
2714
|
+
</li>
|
2715
|
+
|
2716
|
+
<li class="never" data-hits="" data-linenumber="78">
|
2717
|
+
|
2718
|
+
|
2719
|
+
<code class="ruby"> end</code>
|
2720
|
+
</li>
|
2721
|
+
|
2722
|
+
<li class="never" data-hits="" data-linenumber="79">
|
2723
|
+
|
2724
|
+
|
2725
|
+
<code class="ruby"> # a second arg is the options hash</code>
|
2726
|
+
</li>
|
2727
|
+
|
2728
|
+
<li class="missed" data-hits="0" data-linenumber="80">
|
2729
|
+
|
2730
|
+
|
2731
|
+
<code class="ruby"> opts = args[1] || {}</code>
|
2732
|
+
</li>
|
2733
|
+
|
2734
|
+
<li class="never" data-hits="" data-linenumber="81">
|
2735
|
+
|
2736
|
+
|
2737
|
+
<code class="ruby"> </code>
|
2738
|
+
</li>
|
2739
|
+
|
2740
|
+
<li class="never" data-hits="" data-linenumber="82">
|
2741
|
+
|
2742
|
+
|
2743
|
+
<code class="ruby"> # the value is the first arg</code>
|
2744
|
+
</li>
|
2745
|
+
|
2746
|
+
<li class="missed" data-hits="0" data-linenumber="83">
|
2747
|
+
|
2748
|
+
|
2749
|
+
<code class="ruby"> value = args[0]</code>
|
2750
|
+
</li>
|
2751
|
+
|
2752
|
+
<li class="never" data-hits="" data-linenumber="84">
|
2753
|
+
|
2754
|
+
|
2755
|
+
<code class="ruby"> </code>
|
2756
|
+
</li>
|
2757
|
+
|
2758
|
+
<li class="missed" data-hits="0" data-linenumber="85">
|
2759
|
+
|
2760
|
+
|
2761
|
+
<code class="ruby"> if opts[:optional]</code>
|
2762
|
+
</li>
|
2763
|
+
|
2764
|
+
<li class="missed" data-hits="0" data-linenumber="86">
|
2765
|
+
|
2766
|
+
|
2767
|
+
<code class="ruby"> @optional_attributes << meth.to_sym</code>
|
2768
|
+
</li>
|
2769
|
+
|
2770
|
+
<li class="never" data-hits="" data-linenumber="87">
|
2771
|
+
|
2772
|
+
|
2773
|
+
<code class="ruby"> end</code>
|
2774
|
+
</li>
|
2775
|
+
|
2776
|
+
<li class="never" data-hits="" data-linenumber="88">
|
2777
|
+
|
2392
2778
|
|
2393
|
-
<code class="ruby"
|
2779
|
+
<code class="ruby"></code>
|
2394
2780
|
</li>
|
2395
2781
|
|
2396
|
-
<li class="
|
2397
|
-
|
2782
|
+
<li class="missed" data-hits="0" data-linenumber="89">
|
2783
|
+
|
2398
2784
|
|
2399
2785
|
<code class="ruby"> @attributes ||= Hash.new</code>
|
2400
2786
|
</li>
|
2401
2787
|
|
2402
|
-
<li class="
|
2403
|
-
|
2788
|
+
<li class="never" data-hits="" data-linenumber="90">
|
2789
|
+
|
2790
|
+
|
2791
|
+
<code class="ruby"> </code>
|
2792
|
+
</li>
|
2793
|
+
|
2794
|
+
<li class="missed" data-hits="0" data-linenumber="91">
|
2795
|
+
|
2404
2796
|
|
2405
2797
|
<code class="ruby"> if block_given?</code>
|
2406
2798
|
</li>
|
2407
2799
|
|
2408
|
-
<li class="
|
2409
|
-
|
2800
|
+
<li class="missed" data-hits="0" data-linenumber="92">
|
2801
|
+
|
2410
2802
|
|
2411
2803
|
<code class="ruby"> @attributes[meth.to_sym] = block</code>
|
2412
2804
|
</li>
|
2413
2805
|
|
2414
|
-
<li class="never" data-hits="" data-linenumber="
|
2806
|
+
<li class="never" data-hits="" data-linenumber="93">
|
2415
2807
|
|
2416
2808
|
|
2417
2809
|
<code class="ruby"> else</code>
|
2418
2810
|
</li>
|
2419
2811
|
|
2420
|
-
<li class="
|
2421
|
-
|
2812
|
+
<li class="missed" data-hits="0" data-linenumber="94">
|
2813
|
+
|
2422
2814
|
|
2423
|
-
<code class="ruby"> @attributes[meth.to_sym] =
|
2815
|
+
<code class="ruby"> @attributes[meth.to_sym] = value</code>
|
2424
2816
|
</li>
|
2425
2817
|
|
2426
|
-
<li class="never" data-hits="" data-linenumber="
|
2818
|
+
<li class="never" data-hits="" data-linenumber="95">
|
2427
2819
|
|
2428
2820
|
|
2429
2821
|
<code class="ruby"> end</code>
|
2430
2822
|
</li>
|
2431
2823
|
|
2432
|
-
<li class="never" data-hits="" data-linenumber="
|
2824
|
+
<li class="never" data-hits="" data-linenumber="96">
|
2433
2825
|
|
2434
2826
|
|
2435
2827
|
<code class="ruby"> end</code>
|
2436
2828
|
</li>
|
2437
2829
|
|
2438
|
-
<li class="never" data-hits="" data-linenumber="
|
2830
|
+
<li class="never" data-hits="" data-linenumber="97">
|
2439
2831
|
|
2440
2832
|
|
2441
2833
|
<code class="ruby">end</code>
|
@@ -2448,11 +2840,11 @@
|
|
2448
2840
|
<div class="source_table" id="4cc7721b735165eef9b1e5afd4a168c1a72d5103">
|
2449
2841
|
<div class="header">
|
2450
2842
|
<h3>lib/matcher.rb</h3>
|
2451
|
-
<h4><span class="red">
|
2843
|
+
<h4><span class="red">11.63 %</span> covered</h4>
|
2452
2844
|
<div>
|
2453
2845
|
<b>43</b> relevant lines.
|
2454
|
-
<span class="green"><b>
|
2455
|
-
<span class="red"><b>
|
2846
|
+
<span class="green"><b>5</b> lines covered</span> and
|
2847
|
+
<span class="red"><b>38</b> lines missed.</span>
|
2456
2848
|
</div>
|
2457
2849
|
</div>
|
2458
2850
|
|
@@ -2567,8 +2959,8 @@
|
|
2567
2959
|
<code class="ruby"> </code>
|
2568
2960
|
</li>
|
2569
2961
|
|
2570
|
-
<li class="
|
2571
|
-
|
2962
|
+
<li class="missed" data-hits="0" data-linenumber="19">
|
2963
|
+
|
2572
2964
|
|
2573
2965
|
<code class="ruby"> actual = Comparator.normalize_value(actual)</code>
|
2574
2966
|
</li>
|
@@ -2579,26 +2971,26 @@
|
|
2579
2971
|
<code class="ruby"> </code>
|
2580
2972
|
</li>
|
2581
2973
|
|
2582
|
-
<li class="
|
2583
|
-
|
2974
|
+
<li class="missed" data-hits="0" data-linenumber="21">
|
2975
|
+
|
2584
2976
|
|
2585
2977
|
<code class="ruby"> match do |expected|</code>
|
2586
2978
|
</li>
|
2587
2979
|
|
2588
|
-
<li class="
|
2589
|
-
|
2980
|
+
<li class="missed" data-hits="0" data-linenumber="22">
|
2981
|
+
|
2590
2982
|
|
2591
2983
|
<code class="ruby"> expected = Comparator.normalize_value(expected)</code>
|
2592
2984
|
</li>
|
2593
2985
|
|
2594
|
-
<li class="
|
2595
|
-
|
2986
|
+
<li class="missed" data-hits="0" data-linenumber="23">
|
2987
|
+
|
2596
2988
|
|
2597
2989
|
<code class="ruby"> @diff = Comparator.diff(actual, expected)</code>
|
2598
2990
|
</li>
|
2599
2991
|
|
2600
|
-
<li class="
|
2601
|
-
|
2992
|
+
<li class="missed" data-hits="0" data-linenumber="24">
|
2993
|
+
|
2602
2994
|
|
2603
2995
|
<code class="ruby"> @diff == {}</code>
|
2604
2996
|
</li>
|
@@ -2615,8 +3007,8 @@
|
|
2615
3007
|
<code class="ruby"> </code>
|
2616
3008
|
</li>
|
2617
3009
|
|
2618
|
-
<li class="
|
2619
|
-
|
3010
|
+
<li class="missed" data-hits="0" data-linenumber="27">
|
3011
|
+
|
2620
3012
|
|
2621
3013
|
<code class="ruby"> failure_message_for_should do |container|</code>
|
2622
3014
|
</li>
|
@@ -2657,8 +3049,8 @@
|
|
2657
3049
|
<code class="ruby"> </code>
|
2658
3050
|
</li>
|
2659
3051
|
|
2660
|
-
<li class="
|
2661
|
-
|
3052
|
+
<li class="missed" data-hits="0" data-linenumber="34">
|
3053
|
+
|
2662
3054
|
|
2663
3055
|
<code class="ruby"> failure_message_for_should_not do |container|</code>
|
2664
3056
|
</li>
|
@@ -2723,8 +3115,8 @@
|
|
2723
3115
|
<code class="ruby"> </code>
|
2724
3116
|
</li>
|
2725
3117
|
|
2726
|
-
<li class="
|
2727
|
-
|
3118
|
+
<li class="missed" data-hits="0" data-linenumber="45">
|
3119
|
+
|
2728
3120
|
|
2729
3121
|
<code class="ruby"> actual = Comparator.normalize_value(actual)</code>
|
2730
3122
|
</li>
|
@@ -2735,38 +3127,38 @@
|
|
2735
3127
|
<code class="ruby"> </code>
|
2736
3128
|
</li>
|
2737
3129
|
|
2738
|
-
<li class="
|
2739
|
-
|
3130
|
+
<li class="missed" data-hits="0" data-linenumber="47">
|
3131
|
+
|
2740
3132
|
|
2741
3133
|
<code class="ruby"> match do |expected|</code>
|
2742
3134
|
</li>
|
2743
3135
|
|
2744
|
-
<li class="
|
2745
|
-
|
3136
|
+
<li class="missed" data-hits="0" data-linenumber="48">
|
3137
|
+
|
2746
3138
|
|
2747
3139
|
<code class="ruby"> expected = Comparator.normalize_value(expected)</code>
|
2748
3140
|
</li>
|
2749
3141
|
|
2750
|
-
<li class="
|
2751
|
-
|
3142
|
+
<li class="missed" data-hits="0" data-linenumber="49">
|
3143
|
+
|
2752
3144
|
|
2753
3145
|
<code class="ruby"> expected = expected.first if expected.is_a?(Array)</code>
|
2754
3146
|
</li>
|
2755
3147
|
|
2756
|
-
<li class="
|
2757
|
-
|
3148
|
+
<li class="missed" data-hits="0" data-linenumber="50">
|
3149
|
+
|
2758
3150
|
|
2759
3151
|
<code class="ruby"> actual = actual.first if actual.is_a?(Array)</code>
|
2760
3152
|
</li>
|
2761
3153
|
|
2762
|
-
<li class="
|
2763
|
-
|
3154
|
+
<li class="missed" data-hits="0" data-linenumber="51">
|
3155
|
+
|
2764
3156
|
|
2765
3157
|
<code class="ruby"> @diff = Comparator.diff(actual, expected)</code>
|
2766
3158
|
</li>
|
2767
3159
|
|
2768
|
-
<li class="
|
2769
|
-
|
3160
|
+
<li class="missed" data-hits="0" data-linenumber="52">
|
3161
|
+
|
2770
3162
|
|
2771
3163
|
<code class="ruby"> @diff == {}</code>
|
2772
3164
|
</li>
|
@@ -2783,8 +3175,8 @@
|
|
2783
3175
|
<code class="ruby"> </code>
|
2784
3176
|
</li>
|
2785
3177
|
|
2786
|
-
<li class="
|
2787
|
-
|
3178
|
+
<li class="missed" data-hits="0" data-linenumber="55">
|
3179
|
+
|
2788
3180
|
|
2789
3181
|
<code class="ruby"> failure_message_for_should do |container|</code>
|
2790
3182
|
</li>
|
@@ -2825,8 +3217,8 @@
|
|
2825
3217
|
<code class="ruby"> </code>
|
2826
3218
|
</li>
|
2827
3219
|
|
2828
|
-
<li class="
|
2829
|
-
|
3220
|
+
<li class="missed" data-hits="0" data-linenumber="62">
|
3221
|
+
|
2830
3222
|
|
2831
3223
|
<code class="ruby"> failure_message_for_should_not do |container|</code>
|
2832
3224
|
</li>
|
@@ -2880,11 +3272,11 @@
|
|
2880
3272
|
<div class="source_table" id="a262d63e5dc399019853b13f0e4b947eb9908f86">
|
2881
3273
|
<div class="header">
|
2882
3274
|
<h3>lib/path_string.rb</h3>
|
2883
|
-
<h4><span class="red">
|
3275
|
+
<h4><span class="red">18.84 %</span> covered</h4>
|
2884
3276
|
<div>
|
2885
3277
|
<b>69</b> relevant lines.
|
2886
|
-
<span class="green"><b>
|
2887
|
-
<span class="red"><b>
|
3278
|
+
<span class="green"><b>13</b> lines covered</span> and
|
3279
|
+
<span class="red"><b>56</b> lines missed.</span>
|
2888
3280
|
</div>
|
2889
3281
|
</div>
|
2890
3282
|
|
@@ -2927,26 +3319,26 @@
|
|
2927
3319
|
<code class="ruby"> # if either is a string that starts with a :, return true</code>
|
2928
3320
|
</li>
|
2929
3321
|
|
2930
|
-
<li class="
|
2931
|
-
|
3322
|
+
<li class="missed" data-hits="0" data-linenumber="7">
|
3323
|
+
|
2932
3324
|
|
2933
3325
|
<code class="ruby"> if self =~ /^:/ || (other.is_a?(Numeric) && self =~ /^:\d+$/) || other =~ /^:/</code>
|
2934
3326
|
</li>
|
2935
3327
|
|
2936
|
-
<li class="
|
2937
|
-
|
3328
|
+
<li class="missed" data-hits="0" data-linenumber="8">
|
3329
|
+
|
2938
3330
|
|
2939
3331
|
<code class="ruby"> return true</code>
|
2940
3332
|
</li>
|
2941
3333
|
|
2942
|
-
<li class="
|
2943
|
-
|
3334
|
+
<li class="missed" data-hits="0" data-linenumber="9">
|
3335
|
+
|
2944
3336
|
|
2945
3337
|
<code class="ruby"> elsif self =~ /\/:/ || other =~ /\/:/</code>
|
2946
3338
|
</li>
|
2947
3339
|
|
2948
|
-
<li class="
|
2949
|
-
|
3340
|
+
<li class="missed" data-hits="0" data-linenumber="10">
|
3341
|
+
|
2950
3342
|
|
2951
3343
|
<code class="ruby"> return self.class.paths_match?(self, other)</code>
|
2952
3344
|
</li>
|
@@ -2957,8 +3349,8 @@
|
|
2957
3349
|
<code class="ruby"> else</code>
|
2958
3350
|
</li>
|
2959
3351
|
|
2960
|
-
<li class="
|
2961
|
-
|
3352
|
+
<li class="missed" data-hits="0" data-linenumber="12">
|
3353
|
+
|
2962
3354
|
|
2963
3355
|
<code class="ruby"> super</code>
|
2964
3356
|
</li>
|
@@ -2993,8 +3385,8 @@
|
|
2993
3385
|
<code class="ruby"> def self.paths_match?(a, b)</code>
|
2994
3386
|
</li>
|
2995
3387
|
|
2996
|
-
<li class="
|
2997
|
-
|
3388
|
+
<li class="missed" data-hits="0" data-linenumber="18">
|
3389
|
+
|
2998
3390
|
|
2999
3391
|
<code class="ruby"> self.get_zipped_array(a, b).each do |kp, ep|</code>
|
3000
3392
|
</li>
|
@@ -3005,8 +3397,8 @@
|
|
3005
3397
|
<code class="ruby"> # only known path can have things prefixed with colons which is protected</code>
|
3006
3398
|
</li>
|
3007
3399
|
|
3008
|
-
<li class="
|
3009
|
-
|
3400
|
+
<li class="missed" data-hits="0" data-linenumber="20">
|
3401
|
+
|
3010
3402
|
|
3011
3403
|
<code class="ruby"> if kp.nil? || ep.nil?</code>
|
3012
3404
|
</li>
|
@@ -3041,8 +3433,8 @@
|
|
3041
3433
|
<code class="ruby"> end</code>
|
3042
3434
|
</li>
|
3043
3435
|
|
3044
|
-
<li class="
|
3045
|
-
|
3436
|
+
<li class="missed" data-hits="0" data-linenumber="26">
|
3437
|
+
|
3046
3438
|
|
3047
3439
|
<code class="ruby"> return true</code>
|
3048
3440
|
</li>
|
@@ -3065,20 +3457,20 @@
|
|
3065
3457
|
<code class="ruby"> def self.as_sorted_json(val)</code>
|
3066
3458
|
</li>
|
3067
3459
|
|
3068
|
-
<li class="
|
3069
|
-
|
3460
|
+
<li class="missed" data-hits="0" data-linenumber="30">
|
3461
|
+
|
3070
3462
|
|
3071
3463
|
<code class="ruby"> val = self.sort_json(val)</code>
|
3072
3464
|
</li>
|
3073
3465
|
|
3074
|
-
<li class="
|
3075
|
-
|
3466
|
+
<li class="missed" data-hits="0" data-linenumber="31">
|
3467
|
+
|
3076
3468
|
|
3077
3469
|
<code class="ruby"> val = val.pathify_strings</code>
|
3078
3470
|
</li>
|
3079
3471
|
|
3080
|
-
<li class="
|
3081
|
-
|
3472
|
+
<li class="missed" data-hits="0" data-linenumber="32">
|
3473
|
+
|
3082
3474
|
|
3083
3475
|
<code class="ruby"> val</code>
|
3084
3476
|
</li>
|
@@ -3107,32 +3499,32 @@
|
|
3107
3499
|
<code class="ruby"> def self.sort_json(val)</code>
|
3108
3500
|
</li>
|
3109
3501
|
|
3110
|
-
<li class="
|
3111
|
-
|
3502
|
+
<li class="missed" data-hits="0" data-linenumber="37">
|
3503
|
+
|
3112
3504
|
|
3113
3505
|
<code class="ruby"> return val if val.is_a?(TimeDateMatcher)</code>
|
3114
3506
|
</li>
|
3115
3507
|
|
3116
|
-
<li class="
|
3117
|
-
|
3508
|
+
<li class="missed" data-hits="0" data-linenumber="38">
|
3509
|
+
|
3118
3510
|
|
3119
3511
|
<code class="ruby"> val = ActiveSupport::JSON.decode(val) if val.is_a?(String)</code>
|
3120
3512
|
</li>
|
3121
3513
|
|
3122
|
-
<li class="
|
3123
|
-
|
3514
|
+
<li class="missed" data-hits="0" data-linenumber="39">
|
3515
|
+
|
3124
3516
|
|
3125
3517
|
<code class="ruby"> val = self.stringify_keys(val).sort if val.is_a?(Hash)</code>
|
3126
3518
|
</li>
|
3127
3519
|
|
3128
|
-
<li class="
|
3129
|
-
|
3520
|
+
<li class="missed" data-hits="0" data-linenumber="40">
|
3521
|
+
|
3130
3522
|
|
3131
3523
|
<code class="ruby"> val = val.collect{|v| v.collect{|n| n.is_a?(Hash) ? self.sort_json(n) : n}} if val.is_a?(Array)</code>
|
3132
3524
|
</li>
|
3133
3525
|
|
3134
|
-
<li class="
|
3135
|
-
|
3526
|
+
<li class="missed" data-hits="0" data-linenumber="41">
|
3527
|
+
|
3136
3528
|
|
3137
3529
|
<code class="ruby"> val.sort</code>
|
3138
3530
|
</li>
|
@@ -3359,20 +3751,20 @@
|
|
3359
3751
|
<code class="ruby"> def self.stringify_keys(hash)</code>
|
3360
3752
|
</li>
|
3361
3753
|
|
3362
|
-
<li class="
|
3363
|
-
|
3754
|
+
<li class="missed" data-hits="0" data-linenumber="79">
|
3755
|
+
|
3364
3756
|
|
3365
3757
|
<code class="ruby"> new_hash = hash.class.new</code>
|
3366
3758
|
</li>
|
3367
3759
|
|
3368
|
-
<li class="
|
3369
|
-
|
3760
|
+
<li class="missed" data-hits="0" data-linenumber="80">
|
3761
|
+
|
3370
3762
|
|
3371
3763
|
<code class="ruby"> hash.each_pair do |k,v|</code>
|
3372
3764
|
</li>
|
3373
3765
|
|
3374
|
-
<li class="
|
3375
|
-
|
3766
|
+
<li class="missed" data-hits="0" data-linenumber="81">
|
3767
|
+
|
3376
3768
|
|
3377
3769
|
<code class="ruby"> new_hash[k.to_s] = case v</code>
|
3378
3770
|
</li>
|
@@ -3383,8 +3775,8 @@
|
|
3383
3775
|
<code class="ruby"> when Hash</code>
|
3384
3776
|
</li>
|
3385
3777
|
|
3386
|
-
<li class="
|
3387
|
-
|
3778
|
+
<li class="missed" data-hits="0" data-linenumber="83">
|
3779
|
+
|
3388
3780
|
|
3389
3781
|
<code class="ruby"> self.stringify_keys(v)</code>
|
3390
3782
|
</li>
|
@@ -3395,8 +3787,8 @@
|
|
3395
3787
|
<code class="ruby"> when Array</code>
|
3396
3788
|
</li>
|
3397
3789
|
|
3398
|
-
<li class="
|
3399
|
-
|
3790
|
+
<li class="missed" data-hits="0" data-linenumber="85">
|
3791
|
+
|
3400
3792
|
|
3401
3793
|
<code class="ruby"> self.stringify_array_keys(v)</code>
|
3402
3794
|
</li>
|
@@ -3407,8 +3799,8 @@
|
|
3407
3799
|
<code class="ruby"> else</code>
|
3408
3800
|
</li>
|
3409
3801
|
|
3410
|
-
<li class="
|
3411
|
-
|
3802
|
+
<li class="missed" data-hits="0" data-linenumber="87">
|
3803
|
+
|
3412
3804
|
|
3413
3805
|
<code class="ruby"> v </code>
|
3414
3806
|
</li>
|
@@ -3425,8 +3817,8 @@
|
|
3425
3817
|
<code class="ruby"> end</code>
|
3426
3818
|
</li>
|
3427
3819
|
|
3428
|
-
<li class="
|
3429
|
-
|
3820
|
+
<li class="missed" data-hits="0" data-linenumber="90">
|
3821
|
+
|
3430
3822
|
|
3431
3823
|
<code class="ruby"> new_hash</code>
|
3432
3824
|
</li>
|
@@ -3455,14 +3847,14 @@
|
|
3455
3847
|
<code class="ruby"> def self.stringify_array_keys(array)</code>
|
3456
3848
|
</li>
|
3457
3849
|
|
3458
|
-
<li class="
|
3459
|
-
|
3850
|
+
<li class="missed" data-hits="0" data-linenumber="95">
|
3851
|
+
|
3460
3852
|
|
3461
3853
|
<code class="ruby"> array.collect{|v|</code>
|
3462
3854
|
</li>
|
3463
3855
|
|
3464
|
-
<li class="
|
3465
|
-
|
3856
|
+
<li class="missed" data-hits="0" data-linenumber="96">
|
3857
|
+
|
3466
3858
|
|
3467
3859
|
<code class="ruby"> case v</code>
|
3468
3860
|
</li>
|
@@ -3497,8 +3889,8 @@
|
|
3497
3889
|
<code class="ruby"> else</code>
|
3498
3890
|
</li>
|
3499
3891
|
|
3500
|
-
<li class="
|
3501
|
-
|
3892
|
+
<li class="missed" data-hits="0" data-linenumber="102">
|
3893
|
+
|
3502
3894
|
|
3503
3895
|
<code class="ruby"> v</code>
|
3504
3896
|
</li>
|
@@ -3539,8 +3931,8 @@
|
|
3539
3931
|
<code class="ruby"> # make these strings</code>
|
3540
3932
|
</li>
|
3541
3933
|
|
3542
|
-
<li class="
|
3543
|
-
|
3934
|
+
<li class="missed" data-hits="0" data-linenumber="109">
|
3935
|
+
|
3544
3936
|
|
3545
3937
|
<code class="ruby"> known_path, entered_path = known_path.to_s, entered_path.to_s</code>
|
3546
3938
|
</li>
|
@@ -3551,44 +3943,44 @@
|
|
3551
3943
|
<code class="ruby"> # Remove the any beginning or trailing slashes from both paths if they exist</code>
|
3552
3944
|
</li>
|
3553
3945
|
|
3554
|
-
<li class="
|
3555
|
-
|
3946
|
+
<li class="missed" data-hits="0" data-linenumber="111">
|
3947
|
+
|
3556
3948
|
|
3557
3949
|
<code class="ruby"> known_path = known_path[1..-1] if known_path.start_with?("/")</code>
|
3558
3950
|
</li>
|
3559
3951
|
|
3560
|
-
<li class="
|
3561
|
-
|
3952
|
+
<li class="missed" data-hits="0" data-linenumber="112">
|
3953
|
+
|
3562
3954
|
|
3563
3955
|
<code class="ruby"> known_path = known_path[0..-2] if known_path.end_with?("/")</code>
|
3564
3956
|
</li>
|
3565
3957
|
|
3566
|
-
<li class="
|
3567
|
-
|
3958
|
+
<li class="missed" data-hits="0" data-linenumber="113">
|
3959
|
+
|
3568
3960
|
|
3569
3961
|
<code class="ruby"> entered_path = entered_path[1..-1] if entered_path.start_with?("/")</code>
|
3570
3962
|
</li>
|
3571
3963
|
|
3572
|
-
<li class="
|
3573
|
-
|
3964
|
+
<li class="missed" data-hits="0" data-linenumber="114">
|
3965
|
+
|
3574
3966
|
|
3575
3967
|
<code class="ruby"> entered_path = entered_path[0..-2] if entered_path.end_with?("/")</code>
|
3576
3968
|
</li>
|
3577
3969
|
|
3578
|
-
<li class="
|
3579
|
-
|
3970
|
+
<li class="missed" data-hits="0" data-linenumber="115">
|
3971
|
+
|
3580
3972
|
|
3581
3973
|
<code class="ruby"> known_path = known_path.split("/")</code>
|
3582
3974
|
</li>
|
3583
3975
|
|
3584
|
-
<li class="
|
3585
|
-
|
3976
|
+
<li class="missed" data-hits="0" data-linenumber="116">
|
3977
|
+
|
3586
3978
|
|
3587
3979
|
<code class="ruby"> entered_path = entered_path.split("/")</code>
|
3588
3980
|
</li>
|
3589
3981
|
|
3590
|
-
<li class="
|
3591
|
-
|
3982
|
+
<li class="missed" data-hits="0" data-linenumber="117">
|
3983
|
+
|
3592
3984
|
|
3593
3985
|
<code class="ruby"> if known_path.length < entered_path.length</code>
|
3594
3986
|
</li>
|
@@ -3617,8 +4009,8 @@
|
|
3617
4009
|
<code class="ruby"> end</code>
|
3618
4010
|
</li>
|
3619
4011
|
|
3620
|
-
<li class="
|
3621
|
-
|
4012
|
+
<li class="missed" data-hits="0" data-linenumber="122">
|
4013
|
+
|
3622
4014
|
|
3623
4015
|
<code class="ruby"> return known_path.zip(entered_path)</code>
|
3624
4016
|
</li>
|
@@ -3648,11 +4040,11 @@
|
|
3648
4040
|
<div class="source_table" id="a53828a5413df9e3a1d0192504eac81ee4166020">
|
3649
4041
|
<div class="header">
|
3650
4042
|
<h3>lib/variable_array.rb</h3>
|
3651
|
-
<h4><span class="
|
4043
|
+
<h4><span class="red">36.36 %</span> covered</h4>
|
3652
4044
|
<div>
|
3653
4045
|
<b>11</b> relevant lines.
|
3654
|
-
<span class="green"><b>
|
3655
|
-
<span class="red"><b>
|
4046
|
+
<span class="green"><b>4</b> lines covered</span> and
|
4047
|
+
<span class="red"><b>7</b> lines missed.</span>
|
3656
4048
|
</div>
|
3657
4049
|
</div>
|
3658
4050
|
|
@@ -3671,20 +4063,20 @@
|
|
3671
4063
|
<code class="ruby"> def ==(other)</code>
|
3672
4064
|
</li>
|
3673
4065
|
|
3674
|
-
<li class="
|
3675
|
-
|
4066
|
+
<li class="missed" data-hits="0" data-linenumber="3">
|
4067
|
+
|
3676
4068
|
|
3677
4069
|
<code class="ruby"> if other.is_a?(Array)</code>
|
3678
4070
|
</li>
|
3679
4071
|
|
3680
|
-
<li class="
|
3681
|
-
|
4072
|
+
<li class="missed" data-hits="0" data-linenumber="4">
|
4073
|
+
|
3682
4074
|
|
3683
4075
|
<code class="ruby"> comp = self[1..(self.length - 1)]</code>
|
3684
4076
|
</li>
|
3685
4077
|
|
3686
|
-
<li class="
|
3687
|
-
|
4078
|
+
<li class="missed" data-hits="0" data-linenumber="5">
|
4079
|
+
|
3688
4080
|
|
3689
4081
|
<code class="ruby"> return comp.first == other.first</code>
|
3690
4082
|
</li>
|
@@ -3719,20 +4111,20 @@
|
|
3719
4111
|
<code class="ruby"> def collect(&block)</code>
|
3720
4112
|
</li>
|
3721
4113
|
|
3722
|
-
<li class="
|
3723
|
-
|
4114
|
+
<li class="missed" data-hits="0" data-linenumber="11">
|
4115
|
+
|
3724
4116
|
|
3725
4117
|
<code class="ruby"> self.class.new.tap do |ret|</code>
|
3726
4118
|
</li>
|
3727
4119
|
|
3728
|
-
<li class="
|
3729
|
-
|
4120
|
+
<li class="missed" data-hits="0" data-linenumber="12">
|
4121
|
+
|
3730
4122
|
|
3731
4123
|
<code class="ruby"> self.each_with_index do |el, i|</code>
|
3732
4124
|
</li>
|
3733
4125
|
|
3734
|
-
<li class="
|
3735
|
-
|
4126
|
+
<li class="missed" data-hits="0" data-linenumber="13">
|
4127
|
+
|
3736
4128
|
|
3737
4129
|
<code class="ruby"> ret[i] = block.call(el)</code>
|
3738
4130
|
</li>
|