danger-slather 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/doc/Danger.html +1 -1
- data/doc/Danger/DangerSlather.html +74 -161
- data/doc/Slather.html +2 -2
- data/doc/_index.html +1 -1
- data/doc/file.README.html +1 -1
- data/doc/index.html +1 -1
- data/doc/method_list.html +6 -14
- data/doc/top-level-namespace.html +1 -1
- data/lib/slather/gem_version.rb +1 -1
- data/lib/slather/plugin.rb +31 -22
- data/spec/slather_spec.rb +6 -7
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e51644698ab760cdda67caf4fb4bd6e9057cf1a6
|
4
|
+
data.tar.gz: 7aaad9922d42b3641e08430838e4112d89157c8d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2cd0263b5cca27a20166d77889ca8c06c932e5815a4d9544d448e17543e205f49bc5617e968c28b7e9c7bc831439e3cd6fef2c340b6f34d023a8d3399d8585c9
|
7
|
+
data.tar.gz: 5157ca04a320231e6c6ebf2de4ccff838dde7631e82f44595ee3b46e25af0025d6bc422c087e3f4d2a21d0b96b9e90d1e804b6eb526b17af2d698f41681ecfe5
|
data/Gemfile.lock
CHANGED
data/doc/Danger.html
CHANGED
@@ -107,7 +107,7 @@
|
|
107
107
|
</div>
|
108
108
|
|
109
109
|
<div id="footer">
|
110
|
-
Generated on Sun Nov 27 19:
|
110
|
+
Generated on Sun Nov 27 19:51:45 2016 by
|
111
111
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
112
112
|
0.9.5 (ruby-2.3.1).
|
113
113
|
</div>
|
@@ -125,8 +125,7 @@ before using it.</p>
|
|
125
125
|
all modified files coverage</p>
|
126
126
|
</div></p>
|
127
127
|
|
128
|
-
<pre class="example code"><code>
|
129
|
-
<span class='id identifier rubyid_slather'>slather</span><span class='period'>.</span><span class='id identifier rubyid_configure'>configure</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Path/to/my/project.xcodeproj</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>MyScheme</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
|
128
|
+
<pre class="example code"><code><span class='id identifier rubyid_slather'>slather</span><span class='period'>.</span><span class='id identifier rubyid_configure'>configure</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Path/to/my/project.xcodeproj</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>MyScheme</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
|
130
129
|
<span class='id identifier rubyid_slather'>slather</span><span class='period'>.</span><span class='id identifier rubyid_notify_if_coverage_is_less_than'>notify_if_coverage_is_less_than</span><span class='lparen'>(</span><span class='label'>minimum_coverage:</span> <span class='int'>60</span><span class='rparen'>)</span>
|
131
130
|
<span class='id identifier rubyid_slather'>slather</span><span class='period'>.</span><span class='id identifier rubyid_notify_if_modified_file_is_less_than'>notify_if_modified_file_is_less_than</span><span class='lparen'>(</span><span class='label'>minimum_coverage:</span> <span class='int'>30</span><span class='rparen'>)</span>
|
132
131
|
<span class='id identifier rubyid_slather'>slather</span><span class='period'>.</span><span class='id identifier rubyid_show_coverage'>show_coverage</span></code></pre>
|
@@ -137,7 +136,7 @@ all modified files coverage</p>
|
|
137
136
|
<p class="tag_title">See Also:</p>
|
138
137
|
<ul class="see">
|
139
138
|
|
140
|
-
<li>
|
139
|
+
<li>BrunoMazzo/danger-slather</li>
|
141
140
|
|
142
141
|
</ul>
|
143
142
|
|
@@ -177,30 +176,6 @@ all modified files coverage</p>
|
|
177
176
|
<p>Required method to configure slather.</p>
|
178
177
|
</div></span>
|
179
178
|
|
180
|
-
</li>
|
181
|
-
|
182
|
-
|
183
|
-
<li class="public ">
|
184
|
-
<span class="summary_signature">
|
185
|
-
|
186
|
-
<a href="#modified_files_coverage-instance_method" title="#modified_files_coverage (instance method)">#<strong>modified_files_coverage</strong> ⇒ Array<File> </a>
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
</span>
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
<span class="summary_desc"><div class='inline'>
|
201
|
-
<p>Array of files that we have coverage information and was modified.</p>
|
202
|
-
</div></span>
|
203
|
-
|
204
179
|
</li>
|
205
180
|
|
206
181
|
|
@@ -409,26 +384,26 @@ to the project and the scheme used with code coverage enabled</p>
|
|
409
384
|
<pre class="lines">
|
410
385
|
|
411
386
|
|
412
|
-
|
413
|
-
|
414
|
-
|
415
|
-
|
416
|
-
|
417
|
-
|
418
|
-
|
419
|
-
|
420
|
-
|
421
|
-
|
422
|
-
|
423
|
-
|
424
|
-
|
425
|
-
|
426
|
-
|
427
|
-
|
428
|
-
|
387
|
+
19
|
388
|
+
20
|
389
|
+
21
|
390
|
+
22
|
391
|
+
23
|
392
|
+
24
|
393
|
+
25
|
394
|
+
26
|
395
|
+
27
|
396
|
+
28
|
397
|
+
29
|
398
|
+
30
|
399
|
+
31
|
400
|
+
32
|
401
|
+
33
|
402
|
+
34
|
403
|
+
35</pre>
|
429
404
|
</td>
|
430
405
|
<td>
|
431
|
-
<pre class="code"><span class="info file"># File 'lib/slather/plugin.rb', line
|
406
|
+
<pre class="code"><span class="info file"># File 'lib/slather/plugin.rb', line 19</span>
|
432
407
|
|
433
408
|
<span class='kw'>def</span> <span class='id identifier rubyid_configure'>configure</span><span class='lparen'>(</span><span class='id identifier rubyid_xcodeproj_path'>xcodeproj_path</span><span class='comma'>,</span> <span class='id identifier rubyid_scheme'>scheme</span><span class='comma'>,</span> <span class='label'>options:</span> <span class='lbrace'>{</span><span class='rbrace'>}</span><span class='rparen'>)</span>
|
434
409
|
<span class='ivar'>@project</span> <span class='op'>=</span> <span class='const'>Slather</span><span class='op'>::</span><span class='const'>Project</span><span class='period'>.</span><span class='id identifier rubyid_open'>open</span><span class='lparen'>(</span><span class='id identifier rubyid_xcodeproj_path'>xcodeproj_path</span><span class='rparen'>)</span>
|
@@ -450,68 +425,6 @@ to the project and the scheme used with code coverage enabled</p>
|
|
450
425
|
</td>
|
451
426
|
</tr>
|
452
427
|
</table>
|
453
|
-
</div>
|
454
|
-
|
455
|
-
<div class="method_details ">
|
456
|
-
<h3 class="signature " id="modified_files_coverage-instance_method">
|
457
|
-
|
458
|
-
#<strong>modified_files_coverage</strong> ⇒ <tt>Array<File></tt>
|
459
|
-
|
460
|
-
|
461
|
-
|
462
|
-
|
463
|
-
|
464
|
-
</h3><div class="docstring">
|
465
|
-
<div class="discussion">
|
466
|
-
|
467
|
-
<p>Array of files that we have coverage information and was modified</p>
|
468
|
-
|
469
|
-
|
470
|
-
</div>
|
471
|
-
</div>
|
472
|
-
<div class="tags">
|
473
|
-
|
474
|
-
<p class="tag_title">Returns:</p>
|
475
|
-
<ul class="return">
|
476
|
-
|
477
|
-
<li>
|
478
|
-
|
479
|
-
|
480
|
-
<span class='type'>(<tt>Array<File></tt>)</span>
|
481
|
-
|
482
|
-
|
483
|
-
|
484
|
-
</li>
|
485
|
-
|
486
|
-
</ul>
|
487
|
-
|
488
|
-
</div><table class="source_code">
|
489
|
-
<tr>
|
490
|
-
<td>
|
491
|
-
<pre class="lines">
|
492
|
-
|
493
|
-
|
494
|
-
147
|
495
|
-
148
|
496
|
-
149
|
497
|
-
150
|
498
|
-
151
|
499
|
-
152
|
500
|
-
153</pre>
|
501
|
-
</td>
|
502
|
-
<td>
|
503
|
-
<pre class="code"><span class="info file"># File 'lib/slather/plugin.rb', line 147</span>
|
504
|
-
|
505
|
-
<span class='kw'>def</span> <span class='id identifier rubyid_modified_files_coverage'>modified_files_coverage</span>
|
506
|
-
<span class='kw'>unless</span> <span class='ivar'>@project</span><span class='period'>.</span><span class='id identifier rubyid_nil?'>nil?</span>
|
507
|
-
<span class='ivar'>@project</span><span class='period'>.</span><span class='id identifier rubyid_coverage_files'>coverage_files</span><span class='period'>.</span><span class='id identifier rubyid_select'>select</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_file'>file</span><span class='op'>|</span>
|
508
|
-
<span class='id identifier rubyid_git'>git</span><span class='period'>.</span><span class='id identifier rubyid_modified_files'>modified_files</span><span class='period'>.</span><span class='id identifier rubyid_include?'>include?</span> <span class='id identifier rubyid_file'>file</span><span class='period'>.</span><span class='id identifier rubyid_source_file_pathname_relative_to_repo_root'>source_file_pathname_relative_to_repo_root</span><span class='period'>.</span><span class='id identifier rubyid_to_s'>to_s</span>
|
509
|
-
<span class='kw'>end</span>
|
510
|
-
<span class='kw'>end</span>
|
511
|
-
<span class='kw'>end</span></pre>
|
512
|
-
</td>
|
513
|
-
</tr>
|
514
|
-
</table>
|
515
428
|
</div>
|
516
429
|
|
517
430
|
<div class="method_details ">
|
@@ -553,13 +466,6 @@ to the project and the scheme used with code coverage enabled</p>
|
|
553
466
|
<pre class="lines">
|
554
467
|
|
555
468
|
|
556
|
-
109
|
557
|
-
110
|
558
|
-
111
|
559
|
-
112
|
560
|
-
113
|
561
|
-
114
|
562
|
-
115
|
563
469
|
116
|
564
470
|
117
|
565
471
|
118
|
@@ -567,10 +473,17 @@ to the project and the scheme used with code coverage enabled</p>
|
|
567
473
|
120
|
568
474
|
121
|
569
475
|
122
|
570
|
-
123
|
476
|
+
123
|
477
|
+
124
|
478
|
+
125
|
479
|
+
126
|
480
|
+
127
|
481
|
+
128
|
482
|
+
129
|
483
|
+
130</pre>
|
571
484
|
</td>
|
572
485
|
<td>
|
573
|
-
<pre class="code"><span class="info file"># File 'lib/slather/plugin.rb', line
|
486
|
+
<pre class="code"><span class="info file"># File 'lib/slather/plugin.rb', line 116</span>
|
574
487
|
|
575
488
|
<span class='kw'>def</span> <span class='id identifier rubyid_modified_files_coverage_table'>modified_files_coverage_table</span>
|
576
489
|
<span class='kw'>unless</span> <span class='ivar'>@project</span><span class='period'>.</span><span class='id identifier rubyid_nil?'>nil?</span>
|
@@ -581,7 +494,7 @@ to the project and the scheme used with code coverage enabled</p>
|
|
581
494
|
<span class='id identifier rubyid_modified_files_coverage'>modified_files_coverage</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_coverage_file'>coverage_file</span><span class='op'>|</span>
|
582
495
|
<span class='id identifier rubyid_file_name'>file_name</span> <span class='op'>=</span> <span class='id identifier rubyid_coverage_file'>coverage_file</span><span class='period'>.</span><span class='id identifier rubyid_source_file_pathname_relative_to_repo_root'>source_file_pathname_relative_to_repo_root</span><span class='period'>.</span><span class='id identifier rubyid_to_s'>to_s</span>
|
583
496
|
<span class='id identifier rubyid_percentage'>percentage</span> <span class='op'>=</span> <span class='ivar'>@project</span><span class='period'>.</span><span class='id identifier rubyid_decimal_f'>decimal_f</span><span class='lparen'>(</span><span class='lbracket'>[</span><span class='id identifier rubyid_coverage_file'>coverage_file</span><span class='period'>.</span><span class='id identifier rubyid_percentage_lines_tested'>percentage_lines_tested</span><span class='rbracket'>]</span><span class='rparen'>)</span>
|
584
|
-
<span class='id identifier rubyid_line'>line</span> <span class='op'><<</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_file_name'>file_name</span><span class='embexpr_end'>}</span><span class='tstring_content'> |
|
497
|
+
<span class='id identifier rubyid_line'>line</span> <span class='op'><<</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_file_name'>file_name</span><span class='embexpr_end'>}</span><span class='tstring_content'> | **`</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_percentage'>percentage</span><span class='embexpr_end'>}</span><span class='tstring_content'>%`**\n</span><span class='tstring_end'>"</span></span>
|
585
498
|
<span class='kw'>end</span>
|
586
499
|
<span class='kw'>end</span>
|
587
500
|
<span class='kw'>return</span> <span class='id identifier rubyid_line'>line</span>
|
@@ -686,6 +599,7 @@ to the project and the scheme used with code coverage enabled</p>
|
|
686
599
|
<pre class="lines">
|
687
600
|
|
688
601
|
|
602
|
+
58
|
689
603
|
59
|
690
604
|
60
|
691
605
|
61
|
@@ -696,11 +610,10 @@ to the project and the scheme used with code coverage enabled</p>
|
|
696
610
|
66
|
697
611
|
67
|
698
612
|
68
|
699
|
-
69
|
700
|
-
70</pre>
|
613
|
+
69</pre>
|
701
614
|
</td>
|
702
615
|
<td>
|
703
|
-
<pre class="code"><span class="info file"># File 'lib/slather/plugin.rb', line
|
616
|
+
<pre class="code"><span class="info file"># File 'lib/slather/plugin.rb', line 58</span>
|
704
617
|
|
705
618
|
<span class='kw'>def</span> <span class='id identifier rubyid_notify_if_coverage_is_less_than'>notify_if_coverage_is_less_than</span><span class='lparen'>(</span><span class='id identifier rubyid_options'>options</span><span class='rparen'>)</span>
|
706
619
|
<span class='id identifier rubyid_minimum_coverage'>minimum_coverage</span> <span class='op'>=</span> <span class='id identifier rubyid_options'>options</span><span class='lbracket'>[</span><span class='symbol'>:minimum_coverage</span><span class='rbracket'>]</span>
|
@@ -813,6 +726,7 @@ to the project and the scheme used with code coverage enabled</p>
|
|
813
726
|
<pre class="lines">
|
814
727
|
|
815
728
|
|
729
|
+
76
|
816
730
|
77
|
817
731
|
78
|
818
732
|
79
|
@@ -832,11 +746,10 @@ to the project and the scheme used with code coverage enabled</p>
|
|
832
746
|
93
|
833
747
|
94
|
834
748
|
95
|
835
|
-
96
|
836
|
-
97</pre>
|
749
|
+
96</pre>
|
837
750
|
</td>
|
838
751
|
<td>
|
839
|
-
<pre class="code"><span class="info file"># File 'lib/slather/plugin.rb', line
|
752
|
+
<pre class="code"><span class="info file"># File 'lib/slather/plugin.rb', line 76</span>
|
840
753
|
|
841
754
|
<span class='kw'>def</span> <span class='id identifier rubyid_notify_if_modified_file_is_less_than'>notify_if_modified_file_is_less_than</span><span class='lparen'>(</span><span class='id identifier rubyid_options'>options</span><span class='rparen'>)</span>
|
842
755
|
<span class='id identifier rubyid_minimum_coverage'>minimum_coverage</span> <span class='op'>=</span> <span class='id identifier rubyid_options'>options</span><span class='lbracket'>[</span><span class='symbol'>:minimum_coverage</span><span class='rbracket'>]</span>
|
@@ -903,23 +816,23 @@ to the project and the scheme used with code coverage enabled</p>
|
|
903
816
|
<pre class="lines">
|
904
817
|
|
905
818
|
|
906
|
-
135
|
907
|
-
136
|
908
|
-
137
|
909
|
-
138
|
910
|
-
139
|
911
|
-
140
|
912
|
-
141
|
913
819
|
142
|
914
|
-
143
|
820
|
+
143
|
821
|
+
144
|
822
|
+
145
|
823
|
+
146
|
824
|
+
147
|
825
|
+
148
|
826
|
+
149
|
827
|
+
150</pre>
|
915
828
|
</td>
|
916
829
|
<td>
|
917
|
-
<pre class="code"><span class="info file"># File 'lib/slather/plugin.rb', line
|
830
|
+
<pre class="code"><span class="info file"># File 'lib/slather/plugin.rb', line 142</span>
|
918
831
|
|
919
832
|
<span class='kw'>def</span> <span class='id identifier rubyid_show_coverage'>show_coverage</span>
|
920
833
|
<span class='kw'>unless</span> <span class='ivar'>@project</span><span class='period'>.</span><span class='id identifier rubyid_nil?'>nil?</span>
|
921
834
|
<span class='id identifier rubyid_line'>line</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>## Code coverage\n</span><span class='tstring_end'>"</span></span>
|
922
|
-
<span class='id identifier rubyid_line'>line</span> <span class='op'><<</span> <span class='
|
835
|
+
<span class='id identifier rubyid_line'>line</span> <span class='op'><<</span> <span class='id identifier rubyid_total_coverage_markdown'>total_coverage_markdown</span>
|
923
836
|
<span class='id identifier rubyid_line'>line</span> <span class='op'><<</span> <span class='id identifier rubyid_modified_files_coverage_table'>modified_files_coverage_table</span>
|
924
837
|
<span class='id identifier rubyid_line'>line</span> <span class='op'><<</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>> Powered by [Slather](https://github.com/SlatherOrg/slather)</span><span class='tstring_end'>'</span></span>
|
925
838
|
<span class='id identifier rubyid_markdown'>markdown</span> <span class='id identifier rubyid_line'>line</span>
|
@@ -969,14 +882,14 @@ to the project and the scheme used with code coverage enabled</p>
|
|
969
882
|
<pre class="lines">
|
970
883
|
|
971
884
|
|
972
|
-
|
973
|
-
|
974
|
-
|
975
|
-
|
976
|
-
|
885
|
+
134
|
886
|
+
135
|
887
|
+
136
|
888
|
+
137
|
889
|
+
138</pre>
|
977
890
|
</td>
|
978
891
|
<td>
|
979
|
-
<pre class="code"><span class="info file"># File 'lib/slather/plugin.rb', line
|
892
|
+
<pre class="code"><span class="info file"># File 'lib/slather/plugin.rb', line 134</span>
|
980
893
|
|
981
894
|
<span class='kw'>def</span> <span class='id identifier rubyid_show_modified_files_coverage'>show_modified_files_coverage</span>
|
982
895
|
<span class='kw'>unless</span> <span class='ivar'>@project</span><span class='period'>.</span><span class='id identifier rubyid_nil?'>nil?</span>
|
@@ -1027,18 +940,18 @@ to the project and the scheme used with code coverage enabled</p>
|
|
1027
940
|
<pre class="lines">
|
1028
941
|
|
1029
942
|
|
1030
|
-
|
1031
|
-
|
1032
|
-
|
1033
|
-
|
1034
|
-
|
943
|
+
108
|
944
|
+
109
|
945
|
+
110
|
946
|
+
111
|
947
|
+
112</pre>
|
1035
948
|
</td>
|
1036
949
|
<td>
|
1037
|
-
<pre class="code"><span class="info file"># File 'lib/slather/plugin.rb', line
|
950
|
+
<pre class="code"><span class="info file"># File 'lib/slather/plugin.rb', line 108</span>
|
1038
951
|
|
1039
952
|
<span class='kw'>def</span> <span class='id identifier rubyid_show_total_coverage'>show_total_coverage</span>
|
1040
953
|
<span class='kw'>unless</span> <span class='ivar'>@project</span><span class='period'>.</span><span class='id identifier rubyid_nil?'>nil?</span>
|
1041
|
-
<span class='id identifier rubyid_markdown'>markdown</span> <span class='
|
954
|
+
<span class='id identifier rubyid_markdown'>markdown</span> <span class='id identifier rubyid_total_coverage_markdown'>total_coverage_markdown</span>
|
1042
955
|
<span class='kw'>end</span>
|
1043
956
|
<span class='kw'>end</span></pre>
|
1044
957
|
</td>
|
@@ -1085,22 +998,22 @@ to the project and the scheme used with code coverage enabled</p>
|
|
1085
998
|
<pre class="lines">
|
1086
999
|
|
1087
1000
|
|
1088
|
-
|
1089
|
-
|
1090
|
-
|
1091
|
-
|
1092
|
-
|
1093
|
-
|
1094
|
-
|
1095
|
-
|
1096
|
-
|
1097
|
-
|
1098
|
-
|
1099
|
-
|
1100
|
-
|
1001
|
+
39
|
1002
|
+
40
|
1003
|
+
41
|
1004
|
+
42
|
1005
|
+
43
|
1006
|
+
44
|
1007
|
+
45
|
1008
|
+
46
|
1009
|
+
47
|
1010
|
+
48
|
1011
|
+
49
|
1012
|
+
50
|
1013
|
+
51</pre>
|
1101
1014
|
</td>
|
1102
1015
|
<td>
|
1103
|
-
<pre class="code"><span class="info file"># File 'lib/slather/plugin.rb', line
|
1016
|
+
<pre class="code"><span class="info file"># File 'lib/slather/plugin.rb', line 39</span>
|
1104
1017
|
|
1105
1018
|
<span class='kw'>def</span> <span class='id identifier rubyid_total_coverage'>total_coverage</span>
|
1106
1019
|
<span class='kw'>unless</span> <span class='ivar'>@project</span><span class='period'>.</span><span class='id identifier rubyid_nil?'>nil?</span>
|
@@ -1125,7 +1038,7 @@ to the project and the scheme used with code coverage enabled</p>
|
|
1125
1038
|
</div>
|
1126
1039
|
|
1127
1040
|
<div id="footer">
|
1128
|
-
Generated on Sun Nov 27 19:
|
1041
|
+
Generated on Sun Nov 27 19:51:45 2016 by
|
1129
1042
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
1130
1043
|
0.9.5 (ruby-2.3.1).
|
1131
1044
|
</div>
|
data/doc/Slather.html
CHANGED
@@ -92,7 +92,7 @@
|
|
92
92
|
<dt id="VERSION-constant" class="">VERSION =
|
93
93
|
|
94
94
|
</dt>
|
95
|
-
<dd><pre class="code"><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>0.0.
|
95
|
+
<dd><pre class="code"><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>0.0.3</span><span class='tstring_end'>'</span></span><span class='period'>.</span><span class='id identifier rubyid_freeze'>freeze</span></pre></dd>
|
96
96
|
|
97
97
|
</dl>
|
98
98
|
|
@@ -107,7 +107,7 @@
|
|
107
107
|
</div>
|
108
108
|
|
109
109
|
<div id="footer">
|
110
|
-
Generated on Sun Nov 27 19:
|
110
|
+
Generated on Sun Nov 27 19:51:45 2016 by
|
111
111
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
112
112
|
0.9.5 (ruby-2.3.1).
|
113
113
|
</div>
|
data/doc/_index.html
CHANGED
@@ -119,7 +119,7 @@
|
|
119
119
|
</div>
|
120
120
|
|
121
121
|
<div id="footer">
|
122
|
-
Generated on Sun Nov 27 19:
|
122
|
+
Generated on Sun Nov 27 19:51:45 2016 by
|
123
123
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
124
124
|
0.9.5 (ruby-2.3.1).
|
125
125
|
</div>
|
data/doc/file.README.html
CHANGED
@@ -165,7 +165,7 @@ ViewController5.swift | 60.00
|
|
165
165
|
</div></div>
|
166
166
|
|
167
167
|
<div id="footer">
|
168
|
-
Generated on Sun Nov 27 19:
|
168
|
+
Generated on Sun Nov 27 19:51:45 2016 by
|
169
169
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
170
170
|
0.9.5 (ruby-2.3.1).
|
171
171
|
</div>
|
data/doc/index.html
CHANGED
@@ -165,7 +165,7 @@ ViewController5.swift | 60.00
|
|
165
165
|
</div></div>
|
166
166
|
|
167
167
|
<div id="footer">
|
168
|
-
Generated on Sun Nov 27 19:
|
168
|
+
Generated on Sun Nov 27 19:51:45 2016 by
|
169
169
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
170
170
|
0.9.5 (ruby-2.3.1).
|
171
171
|
</div>
|
data/doc/method_list.html
CHANGED
@@ -53,14 +53,6 @@
|
|
53
53
|
|
54
54
|
|
55
55
|
<li class="even ">
|
56
|
-
<div class="item">
|
57
|
-
<span class='object_link'><a href="Danger/DangerSlather.html#modified_files_coverage-instance_method" title="Danger::DangerSlather#modified_files_coverage (method)">#modified_files_coverage</a></span>
|
58
|
-
<small>Danger::DangerSlather</small>
|
59
|
-
</div>
|
60
|
-
</li>
|
61
|
-
|
62
|
-
|
63
|
-
<li class="odd ">
|
64
56
|
<div class="item">
|
65
57
|
<span class='object_link'><a href="Danger/DangerSlather.html#modified_files_coverage_table-instance_method" title="Danger::DangerSlather#modified_files_coverage_table (method)">#modified_files_coverage_table</a></span>
|
66
58
|
<small>Danger::DangerSlather</small>
|
@@ -68,7 +60,7 @@
|
|
68
60
|
</li>
|
69
61
|
|
70
62
|
|
71
|
-
<li class="
|
63
|
+
<li class="odd ">
|
72
64
|
<div class="item">
|
73
65
|
<span class='object_link'><a href="Danger/DangerSlather.html#notify_if_coverage_is_less_than-instance_method" title="Danger::DangerSlather#notify_if_coverage_is_less_than (method)">#notify_if_coverage_is_less_than</a></span>
|
74
66
|
<small>Danger::DangerSlather</small>
|
@@ -76,7 +68,7 @@
|
|
76
68
|
</li>
|
77
69
|
|
78
70
|
|
79
|
-
<li class="
|
71
|
+
<li class="even ">
|
80
72
|
<div class="item">
|
81
73
|
<span class='object_link'><a href="Danger/DangerSlather.html#notify_if_modified_file_is_less_than-instance_method" title="Danger::DangerSlather#notify_if_modified_file_is_less_than (method)">#notify_if_modified_file_is_less_than</a></span>
|
82
74
|
<small>Danger::DangerSlather</small>
|
@@ -84,7 +76,7 @@
|
|
84
76
|
</li>
|
85
77
|
|
86
78
|
|
87
|
-
<li class="
|
79
|
+
<li class="odd ">
|
88
80
|
<div class="item">
|
89
81
|
<span class='object_link'><a href="Danger/DangerSlather.html#show_coverage-instance_method" title="Danger::DangerSlather#show_coverage (method)">#show_coverage</a></span>
|
90
82
|
<small>Danger::DangerSlather</small>
|
@@ -92,7 +84,7 @@
|
|
92
84
|
</li>
|
93
85
|
|
94
86
|
|
95
|
-
<li class="
|
87
|
+
<li class="even ">
|
96
88
|
<div class="item">
|
97
89
|
<span class='object_link'><a href="Danger/DangerSlather.html#show_modified_files_coverage-instance_method" title="Danger::DangerSlather#show_modified_files_coverage (method)">#show_modified_files_coverage</a></span>
|
98
90
|
<small>Danger::DangerSlather</small>
|
@@ -100,7 +92,7 @@
|
|
100
92
|
</li>
|
101
93
|
|
102
94
|
|
103
|
-
<li class="
|
95
|
+
<li class="odd ">
|
104
96
|
<div class="item">
|
105
97
|
<span class='object_link'><a href="Danger/DangerSlather.html#show_total_coverage-instance_method" title="Danger::DangerSlather#show_total_coverage (method)">#show_total_coverage</a></span>
|
106
98
|
<small>Danger::DangerSlather</small>
|
@@ -108,7 +100,7 @@
|
|
108
100
|
</li>
|
109
101
|
|
110
102
|
|
111
|
-
<li class="
|
103
|
+
<li class="even ">
|
112
104
|
<div class="item">
|
113
105
|
<span class='object_link'><a href="Danger/DangerSlather.html#total_coverage-instance_method" title="Danger::DangerSlather#total_coverage (method)">#total_coverage</a></span>
|
114
106
|
<small>Danger::DangerSlather</small>
|
@@ -102,7 +102,7 @@
|
|
102
102
|
</div>
|
103
103
|
|
104
104
|
<div id="footer">
|
105
|
-
Generated on Sun Nov 27 19:
|
105
|
+
Generated on Sun Nov 27 19:51:45 2016 by
|
106
106
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
107
107
|
0.9.5 (ruby-2.3.1).
|
108
108
|
</div>
|
data/lib/slather/gem_version.rb
CHANGED
data/lib/slather/plugin.rb
CHANGED
@@ -5,31 +5,14 @@ module Danger
|
|
5
5
|
# before using it.
|
6
6
|
#
|
7
7
|
# @example Require a minimum file coverage of 30%, a project coverage of 60% and show all modified files coverage
|
8
|
-
#
|
9
8
|
# slather.configure("Path/to/my/project.xcodeproj", "MyScheme")
|
10
9
|
# slather.notify_if_coverage_is_less_than(minimum_coverage: 60)
|
11
10
|
# slather.notify_if_modified_file_is_less_than(minimum_coverage: 30)
|
12
11
|
# slather.show_coverage
|
13
12
|
#
|
14
|
-
# @see
|
15
|
-
# @tags slather, code coverage
|
13
|
+
# @see BrunoMazzo/danger-slather
|
14
|
+
# @tags slather, code coverage, xcode, iOS
|
16
15
|
class DangerSlather < Plugin
|
17
|
-
# Total coverage of the project
|
18
|
-
# @return [Float]
|
19
|
-
def total_coverage
|
20
|
-
unless @project.nil?
|
21
|
-
@total_coverage ||= begin
|
22
|
-
total_project_lines = 0
|
23
|
-
total_project_lines_tested = 0
|
24
|
-
@project.coverage_files.each do |coverage_file|
|
25
|
-
total_project_lines_tested += coverage_file.num_lines_tested
|
26
|
-
total_project_lines += coverage_file.num_lines_testable
|
27
|
-
end
|
28
|
-
@total_coverage = (total_project_lines_tested / total_project_lines.to_f) * 100.0
|
29
|
-
end
|
30
|
-
end
|
31
|
-
end
|
32
|
-
|
33
16
|
# Required method to configure slather. It's required at least the path
|
34
17
|
# to the project and the scheme used with code coverage enabled
|
35
18
|
# @return [void]
|
@@ -51,6 +34,22 @@ module Danger
|
|
51
34
|
@project.post if options[:post]
|
52
35
|
end
|
53
36
|
|
37
|
+
# Total coverage of the project
|
38
|
+
# @return [Float]
|
39
|
+
def total_coverage
|
40
|
+
unless @project.nil?
|
41
|
+
@total_coverage ||= begin
|
42
|
+
total_project_lines = 0
|
43
|
+
total_project_lines_tested = 0
|
44
|
+
@project.coverage_files.each do |coverage_file|
|
45
|
+
total_project_lines_tested += coverage_file.num_lines_tested
|
46
|
+
total_project_lines += coverage_file.num_lines_testable
|
47
|
+
end
|
48
|
+
@total_coverage = (total_project_lines_tested / total_project_lines.to_f) * 100.0
|
49
|
+
end
|
50
|
+
end
|
51
|
+
end
|
52
|
+
|
54
53
|
# Method to check if the coverage of the project is at least a minumum
|
55
54
|
# @param options [Hash] a hash with the options
|
56
55
|
# @option options [Float] :minimum_coverage the minimum code coverage required
|
@@ -96,11 +95,19 @@ module Danger
|
|
96
95
|
end
|
97
96
|
end
|
98
97
|
|
98
|
+
# String header with the total coverage of the project
|
99
|
+
# @return [String]
|
100
|
+
def total_coverage_markdown
|
101
|
+
unless @project.nil?
|
102
|
+
"### Total coverage: **`#{@project.decimal_f([total_coverage])}%`**\n"
|
103
|
+
end
|
104
|
+
end
|
105
|
+
|
99
106
|
# Show a header with the total coverage of the project
|
100
107
|
# @return [Array<String>]
|
101
108
|
def show_total_coverage
|
102
109
|
unless @project.nil?
|
103
|
-
markdown
|
110
|
+
markdown total_coverage_markdown
|
104
111
|
end
|
105
112
|
end
|
106
113
|
|
@@ -115,7 +122,7 @@ module Danger
|
|
115
122
|
modified_files_coverage.each do |coverage_file|
|
116
123
|
file_name = coverage_file.source_file_pathname_relative_to_repo_root.to_s
|
117
124
|
percentage = @project.decimal_f([coverage_file.percentage_lines_tested])
|
118
|
-
line << "#{file_name} |
|
125
|
+
line << "#{file_name} | **`#{percentage}%`**\n"
|
119
126
|
end
|
120
127
|
end
|
121
128
|
return line
|
@@ -135,7 +142,7 @@ module Danger
|
|
135
142
|
def show_coverage
|
136
143
|
unless @project.nil?
|
137
144
|
line = "## Code coverage\n"
|
138
|
-
line <<
|
145
|
+
line << total_coverage_markdown
|
139
146
|
line << modified_files_coverage_table
|
140
147
|
line << '> Powered by [Slather](https://github.com/SlatherOrg/slather)'
|
141
148
|
markdown line
|
@@ -151,5 +158,7 @@ module Danger
|
|
151
158
|
end
|
152
159
|
end
|
153
160
|
end
|
161
|
+
|
162
|
+
private :modified_files_coverage, :total_coverage_markdown
|
154
163
|
end
|
155
164
|
end
|
data/spec/slather_spec.rb
CHANGED
@@ -176,15 +176,14 @@ module Danger
|
|
176
176
|
|
177
177
|
expect(@dangerfile.status_report[:markdowns][0].message).to eq(
|
178
178
|
"## Code coverage
|
179
|
-
Total coverage: 35.
|
180
|
-
|
179
|
+
### Total coverage: **`35.00%`**
|
181
180
|
File | Coverage
|
182
181
|
-----|-----
|
183
|
-
AppDelegate.swift | 10.00
|
184
|
-
ViewController.swift | 20.00
|
185
|
-
ViewController2.swift | 30.00
|
186
|
-
ViewController3.swift | 40.00
|
187
|
-
ViewController4.swift | 50.00
|
182
|
+
AppDelegate.swift | **`10.00%`**
|
183
|
+
ViewController.swift | **`20.00%`**
|
184
|
+
ViewController2.swift | **`30.00%`**
|
185
|
+
ViewController3.swift | **`40.00%`**
|
186
|
+
ViewController4.swift | **`50.00%`**
|
188
187
|
> Powered by [Slather](https://github.com/SlatherOrg/slather)"
|
189
188
|
)
|
190
189
|
end
|