danger-slather 0.0.2 → 0.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/README.md +25 -3
- data/doc/Danger.html +117 -0
- data/doc/Danger/DangerSlather.html +1135 -0
- data/doc/Slather.html +117 -0
- data/doc/_index.html +129 -0
- data/doc/class_list.html +51 -0
- data/doc/css/common.css +1 -0
- data/doc/css/full_list.css +58 -0
- data/doc/css/style.css +481 -0
- data/doc/file.README.html +175 -0
- data/doc/file_list.html +56 -0
- data/doc/frames.html +17 -0
- data/doc/index.html +175 -0
- data/doc/js/app.js +243 -0
- data/doc/js/full_list.js +216 -0
- data/doc/js/jquery.js +4 -0
- data/doc/method_list.html +123 -0
- data/doc/top-level-namespace.html +112 -0
- data/lib/slather/gem_version.rb +1 -1
- data/lib/slather/plugin.rb +10 -9
- metadata +18 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7266fba0d14906a9a312974bdeccad30f42d3d32
|
4
|
+
data.tar.gz: e79832016c081d137c2a6d745f540ce781e6ba98
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0b32657ec2b5ce32f2eda7e6a67bea4592534cdb500296ec4560f2151ed4d21e05bf29299e6b514f8641e2c57b381c644a11a9bfe7d5c132c2d72ae88cbacfe8
|
7
|
+
data.tar.gz: 9e5c111a47c61b8acaa80db1fbe3ed93ba26cb1e1a3f4275bb8a8f4b03d3c0d8001395942d7ecd0895ebed1a7348d85ef1963f38677021c262f81354214dea01
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -59,11 +59,33 @@ ViewController5.swift | 60.00
|
|
59
59
|
|
60
60
|
## Usage
|
61
61
|
|
62
|
-
|
62
|
+
First configure the slather object:
|
63
63
|
|
64
64
|
slather.configure("Path/to/my/project.xcodeproj", "MyScheme")
|
65
|
-
|
66
|
-
|
65
|
+
|
66
|
+
For a more complex case:
|
67
|
+
|
68
|
+
slather.configure("Path/to/my/project.xcodeproj", "MyScheme", options: {
|
69
|
+
workspace: 'Path/to/my/workspace.xcworkspace',
|
70
|
+
build_directory: = 'Path/to/my/build_directory',
|
71
|
+
ignore_list: = 'ignore file list',
|
72
|
+
ci_service: = :travis,
|
73
|
+
coverage_access_token: = 'acc123123123123',
|
74
|
+
coverage_service: = :terminal,
|
75
|
+
source_directory: = 'Path/to/my/source_directory',
|
76
|
+
output_directory: = 'Path/to/my/output_directory',
|
77
|
+
input_format: = 'profdata',
|
78
|
+
binary_file: = 'Path/to/my/output_directory',
|
79
|
+
decimals: = 2
|
80
|
+
post = false
|
81
|
+
})
|
82
|
+
|
83
|
+
For a more complete documentation of all support configuration see [Slather](https://github.com/SlatherOrg/slather)
|
84
|
+
|
85
|
+
Than just add this line to your `Dangerfile`:
|
86
|
+
|
87
|
+
slather.notify_if_coverage_is_less_than(minimum_coverage: 80)
|
88
|
+
slather.notify_if_modified_file_is_less_than(minimum_coverage: 60)
|
67
89
|
slather.show_coverage
|
68
90
|
|
69
91
|
## Development
|
data/doc/Danger.html
ADDED
@@ -0,0 +1,117 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<meta charset="utf-8">
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
6
|
+
<title>
|
7
|
+
Module: Danger
|
8
|
+
|
9
|
+
— Documentation by YARD 0.9.5
|
10
|
+
|
11
|
+
</title>
|
12
|
+
|
13
|
+
<link rel="stylesheet" href="css/style.css" type="text/css" charset="utf-8" />
|
14
|
+
|
15
|
+
<link rel="stylesheet" href="css/common.css" type="text/css" charset="utf-8" />
|
16
|
+
|
17
|
+
<script type="text/javascript" charset="utf-8">
|
18
|
+
pathId = "Danger";
|
19
|
+
relpath = '';
|
20
|
+
</script>
|
21
|
+
|
22
|
+
|
23
|
+
<script type="text/javascript" charset="utf-8" src="js/jquery.js"></script>
|
24
|
+
|
25
|
+
<script type="text/javascript" charset="utf-8" src="js/app.js"></script>
|
26
|
+
|
27
|
+
|
28
|
+
</head>
|
29
|
+
<body>
|
30
|
+
<div class="nav_wrap">
|
31
|
+
<iframe id="nav" src="class_list.html"></iframe>
|
32
|
+
<div id="resizer"></div>
|
33
|
+
</div>
|
34
|
+
|
35
|
+
<div id="main" tabindex="-1">
|
36
|
+
<div id="header">
|
37
|
+
<div id="menu">
|
38
|
+
|
39
|
+
<a href="_index.html">Index (D)</a> »
|
40
|
+
|
41
|
+
|
42
|
+
<span class="title">Danger</span>
|
43
|
+
|
44
|
+
</div>
|
45
|
+
|
46
|
+
<div id="search">
|
47
|
+
|
48
|
+
<a class="full_list_link" id="class_list_link"
|
49
|
+
href="class_list.html">
|
50
|
+
|
51
|
+
<svg width="24" height="24">
|
52
|
+
<rect x="0" y="4" width="24" height="4" rx="1" ry="1"></rect>
|
53
|
+
<rect x="0" y="12" width="24" height="4" rx="1" ry="1"></rect>
|
54
|
+
<rect x="0" y="20" width="24" height="4" rx="1" ry="1"></rect>
|
55
|
+
</svg>
|
56
|
+
</a>
|
57
|
+
|
58
|
+
</div>
|
59
|
+
<div class="clear"></div>
|
60
|
+
</div>
|
61
|
+
|
62
|
+
<iframe id="search_frame" src="class_list.html"></iframe>
|
63
|
+
|
64
|
+
<div id="content"><h1>Module: Danger
|
65
|
+
|
66
|
+
|
67
|
+
|
68
|
+
</h1>
|
69
|
+
<div class="box_info">
|
70
|
+
|
71
|
+
|
72
|
+
|
73
|
+
|
74
|
+
|
75
|
+
|
76
|
+
|
77
|
+
|
78
|
+
|
79
|
+
|
80
|
+
|
81
|
+
<dl>
|
82
|
+
<dt>Defined in:</dt>
|
83
|
+
<dd>lib/slather/plugin.rb</dd>
|
84
|
+
</dl>
|
85
|
+
|
86
|
+
</div>
|
87
|
+
|
88
|
+
<h2>Defined Under Namespace</h2>
|
89
|
+
<p class="children">
|
90
|
+
|
91
|
+
|
92
|
+
|
93
|
+
|
94
|
+
<strong class="classes">Classes:</strong> <span class='object_link'><a href="Danger/DangerSlather.html" title="Danger::DangerSlather (class)">DangerSlather</a></span>
|
95
|
+
|
96
|
+
|
97
|
+
</p>
|
98
|
+
|
99
|
+
|
100
|
+
|
101
|
+
|
102
|
+
|
103
|
+
|
104
|
+
|
105
|
+
|
106
|
+
|
107
|
+
</div>
|
108
|
+
|
109
|
+
<div id="footer">
|
110
|
+
Generated on Sun Nov 27 19:08:31 2016 by
|
111
|
+
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
112
|
+
0.9.5 (ruby-2.3.1).
|
113
|
+
</div>
|
114
|
+
|
115
|
+
</div>
|
116
|
+
</body>
|
117
|
+
</html>
|
@@ -0,0 +1,1135 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<meta charset="utf-8">
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
6
|
+
<title>
|
7
|
+
Class: Danger::DangerSlather
|
8
|
+
|
9
|
+
— Documentation by YARD 0.9.5
|
10
|
+
|
11
|
+
</title>
|
12
|
+
|
13
|
+
<link rel="stylesheet" href="../css/style.css" type="text/css" charset="utf-8" />
|
14
|
+
|
15
|
+
<link rel="stylesheet" href="../css/common.css" type="text/css" charset="utf-8" />
|
16
|
+
|
17
|
+
<script type="text/javascript" charset="utf-8">
|
18
|
+
pathId = "Danger::DangerSlather";
|
19
|
+
relpath = '../';
|
20
|
+
</script>
|
21
|
+
|
22
|
+
|
23
|
+
<script type="text/javascript" charset="utf-8" src="../js/jquery.js"></script>
|
24
|
+
|
25
|
+
<script type="text/javascript" charset="utf-8" src="../js/app.js"></script>
|
26
|
+
|
27
|
+
|
28
|
+
</head>
|
29
|
+
<body>
|
30
|
+
<div class="nav_wrap">
|
31
|
+
<iframe id="nav" src="../class_list.html"></iframe>
|
32
|
+
<div id="resizer"></div>
|
33
|
+
</div>
|
34
|
+
|
35
|
+
<div id="main" tabindex="-1">
|
36
|
+
<div id="header">
|
37
|
+
<div id="menu">
|
38
|
+
|
39
|
+
<a href="../_index.html">Index (D)</a> »
|
40
|
+
<span class='title'><span class='object_link'><a href="../Danger.html" title="Danger (module)">Danger</a></span></span>
|
41
|
+
»
|
42
|
+
<span class="title">DangerSlather</span>
|
43
|
+
|
44
|
+
</div>
|
45
|
+
|
46
|
+
<div id="search">
|
47
|
+
|
48
|
+
<a class="full_list_link" id="class_list_link"
|
49
|
+
href="../class_list.html">
|
50
|
+
|
51
|
+
<svg width="24" height="24">
|
52
|
+
<rect x="0" y="4" width="24" height="4" rx="1" ry="1"></rect>
|
53
|
+
<rect x="0" y="12" width="24" height="4" rx="1" ry="1"></rect>
|
54
|
+
<rect x="0" y="20" width="24" height="4" rx="1" ry="1"></rect>
|
55
|
+
</svg>
|
56
|
+
</a>
|
57
|
+
|
58
|
+
</div>
|
59
|
+
<div class="clear"></div>
|
60
|
+
</div>
|
61
|
+
|
62
|
+
<iframe id="search_frame" src="../class_list.html"></iframe>
|
63
|
+
|
64
|
+
<div id="content"><h1>Class: Danger::DangerSlather
|
65
|
+
|
66
|
+
|
67
|
+
|
68
|
+
</h1>
|
69
|
+
<div class="box_info">
|
70
|
+
|
71
|
+
<dl>
|
72
|
+
<dt>Inherits:</dt>
|
73
|
+
<dd>
|
74
|
+
<span class="inheritName">Plugin</span>
|
75
|
+
|
76
|
+
<ul class="fullTree">
|
77
|
+
<li>Object</li>
|
78
|
+
|
79
|
+
<li class="next">Plugin</li>
|
80
|
+
|
81
|
+
<li class="next">Danger::DangerSlather</li>
|
82
|
+
|
83
|
+
</ul>
|
84
|
+
<a href="#" class="inheritanceTree">show all</a>
|
85
|
+
|
86
|
+
</dd>
|
87
|
+
</dl>
|
88
|
+
|
89
|
+
|
90
|
+
|
91
|
+
|
92
|
+
|
93
|
+
|
94
|
+
|
95
|
+
|
96
|
+
|
97
|
+
|
98
|
+
|
99
|
+
<dl>
|
100
|
+
<dt>Defined in:</dt>
|
101
|
+
<dd>lib/slather/plugin.rb</dd>
|
102
|
+
</dl>
|
103
|
+
|
104
|
+
</div>
|
105
|
+
|
106
|
+
<h2>Overview</h2><div class="docstring">
|
107
|
+
<div class="discussion">
|
108
|
+
|
109
|
+
<p>Show code coverage of the project and by file. Add warnings or fail the
|
110
|
+
Build if a minimum coverage are not achieved. It uses Slather Framework for
|
111
|
+
calculate coverage, so it's required to configurate the slather object
|
112
|
+
before using it.</p>
|
113
|
+
|
114
|
+
|
115
|
+
</div>
|
116
|
+
</div>
|
117
|
+
<div class="tags">
|
118
|
+
|
119
|
+
<div class="examples">
|
120
|
+
<p class="tag_title">Examples:</p>
|
121
|
+
|
122
|
+
|
123
|
+
<p class="example_title"><div class='inline'>
|
124
|
+
<p>Require a minimum file coverage of 30%, a project coverage of 60% and show
|
125
|
+
all modified files coverage</p>
|
126
|
+
</div></p>
|
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>
|
130
|
+
<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
|
+
<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
|
+
<span class='id identifier rubyid_slather'>slather</span><span class='period'>.</span><span class='id identifier rubyid_show_coverage'>show_coverage</span></code></pre>
|
133
|
+
|
134
|
+
</div>
|
135
|
+
|
136
|
+
|
137
|
+
<p class="tag_title">See Also:</p>
|
138
|
+
<ul class="see">
|
139
|
+
|
140
|
+
<li>Mazzo/danger-slather</li>
|
141
|
+
|
142
|
+
</ul>
|
143
|
+
|
144
|
+
</div>
|
145
|
+
|
146
|
+
|
147
|
+
|
148
|
+
|
149
|
+
|
150
|
+
|
151
|
+
|
152
|
+
<h2>
|
153
|
+
Instance Method Summary
|
154
|
+
<small><a href="#" class="summary_toggle">collapse</a></small>
|
155
|
+
</h2>
|
156
|
+
|
157
|
+
<ul class="summary">
|
158
|
+
|
159
|
+
<li class="public ">
|
160
|
+
<span class="summary_signature">
|
161
|
+
|
162
|
+
<a href="#configure-instance_method" title="#configure (instance method)">#<strong>configure</strong>(xcodeproj_path, scheme, options: {}) ⇒ void </a>
|
163
|
+
|
164
|
+
|
165
|
+
|
166
|
+
</span>
|
167
|
+
|
168
|
+
|
169
|
+
|
170
|
+
|
171
|
+
|
172
|
+
|
173
|
+
|
174
|
+
|
175
|
+
|
176
|
+
<span class="summary_desc"><div class='inline'>
|
177
|
+
<p>Required method to configure slather.</p>
|
178
|
+
</div></span>
|
179
|
+
|
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
|
+
</li>
|
205
|
+
|
206
|
+
|
207
|
+
<li class="public ">
|
208
|
+
<span class="summary_signature">
|
209
|
+
|
210
|
+
<a href="#modified_files_coverage_table-instance_method" title="#modified_files_coverage_table (instance method)">#<strong>modified_files_coverage_table</strong> ⇒ String </a>
|
211
|
+
|
212
|
+
|
213
|
+
|
214
|
+
</span>
|
215
|
+
|
216
|
+
|
217
|
+
|
218
|
+
|
219
|
+
|
220
|
+
|
221
|
+
|
222
|
+
|
223
|
+
|
224
|
+
<span class="summary_desc"><div class='inline'>
|
225
|
+
<p>Build a coverage markdown table of the modified files coverage.</p>
|
226
|
+
</div></span>
|
227
|
+
|
228
|
+
</li>
|
229
|
+
|
230
|
+
|
231
|
+
<li class="public ">
|
232
|
+
<span class="summary_signature">
|
233
|
+
|
234
|
+
<a href="#notify_if_coverage_is_less_than-instance_method" title="#notify_if_coverage_is_less_than (instance method)">#<strong>notify_if_coverage_is_less_than</strong>(options) ⇒ Array<String> </a>
|
235
|
+
|
236
|
+
|
237
|
+
|
238
|
+
</span>
|
239
|
+
|
240
|
+
|
241
|
+
|
242
|
+
|
243
|
+
|
244
|
+
|
245
|
+
|
246
|
+
|
247
|
+
|
248
|
+
<span class="summary_desc"><div class='inline'>
|
249
|
+
<p>Method to check if the coverage of the project is at least a minumum.</p>
|
250
|
+
</div></span>
|
251
|
+
|
252
|
+
</li>
|
253
|
+
|
254
|
+
|
255
|
+
<li class="public ">
|
256
|
+
<span class="summary_signature">
|
257
|
+
|
258
|
+
<a href="#notify_if_modified_file_is_less_than-instance_method" title="#notify_if_modified_file_is_less_than (instance method)">#<strong>notify_if_modified_file_is_less_than</strong>(options) ⇒ Array<String> </a>
|
259
|
+
|
260
|
+
|
261
|
+
|
262
|
+
</span>
|
263
|
+
|
264
|
+
|
265
|
+
|
266
|
+
|
267
|
+
|
268
|
+
|
269
|
+
|
270
|
+
|
271
|
+
|
272
|
+
<span class="summary_desc"><div class='inline'>
|
273
|
+
<p>Method to check if the coverage of modified files is at least a minumum.</p>
|
274
|
+
</div></span>
|
275
|
+
|
276
|
+
</li>
|
277
|
+
|
278
|
+
|
279
|
+
<li class="public ">
|
280
|
+
<span class="summary_signature">
|
281
|
+
|
282
|
+
<a href="#show_coverage-instance_method" title="#show_coverage (instance method)">#<strong>show_coverage</strong> ⇒ Array<String> </a>
|
283
|
+
|
284
|
+
|
285
|
+
|
286
|
+
</span>
|
287
|
+
|
288
|
+
|
289
|
+
|
290
|
+
|
291
|
+
|
292
|
+
|
293
|
+
|
294
|
+
|
295
|
+
|
296
|
+
<span class="summary_desc"><div class='inline'>
|
297
|
+
<p>Show a header with the total coverage and coverage table.</p>
|
298
|
+
</div></span>
|
299
|
+
|
300
|
+
</li>
|
301
|
+
|
302
|
+
|
303
|
+
<li class="public ">
|
304
|
+
<span class="summary_signature">
|
305
|
+
|
306
|
+
<a href="#show_modified_files_coverage-instance_method" title="#show_modified_files_coverage (instance method)">#<strong>show_modified_files_coverage</strong> ⇒ Array<String> </a>
|
307
|
+
|
308
|
+
|
309
|
+
|
310
|
+
</span>
|
311
|
+
|
312
|
+
|
313
|
+
|
314
|
+
|
315
|
+
|
316
|
+
|
317
|
+
|
318
|
+
|
319
|
+
|
320
|
+
<span class="summary_desc"><div class='inline'>
|
321
|
+
<p>Show the table build by modified_files_coverage_table.</p>
|
322
|
+
</div></span>
|
323
|
+
|
324
|
+
</li>
|
325
|
+
|
326
|
+
|
327
|
+
<li class="public ">
|
328
|
+
<span class="summary_signature">
|
329
|
+
|
330
|
+
<a href="#show_total_coverage-instance_method" title="#show_total_coverage (instance method)">#<strong>show_total_coverage</strong> ⇒ Array<String> </a>
|
331
|
+
|
332
|
+
|
333
|
+
|
334
|
+
</span>
|
335
|
+
|
336
|
+
|
337
|
+
|
338
|
+
|
339
|
+
|
340
|
+
|
341
|
+
|
342
|
+
|
343
|
+
|
344
|
+
<span class="summary_desc"><div class='inline'>
|
345
|
+
<p>Show a header with the total coverage of the project.</p>
|
346
|
+
</div></span>
|
347
|
+
|
348
|
+
</li>
|
349
|
+
|
350
|
+
|
351
|
+
<li class="public ">
|
352
|
+
<span class="summary_signature">
|
353
|
+
|
354
|
+
<a href="#total_coverage-instance_method" title="#total_coverage (instance method)">#<strong>total_coverage</strong> ⇒ Float </a>
|
355
|
+
|
356
|
+
|
357
|
+
|
358
|
+
</span>
|
359
|
+
|
360
|
+
|
361
|
+
|
362
|
+
|
363
|
+
|
364
|
+
|
365
|
+
|
366
|
+
|
367
|
+
|
368
|
+
<span class="summary_desc"><div class='inline'>
|
369
|
+
<p>Total coverage of the project.</p>
|
370
|
+
</div></span>
|
371
|
+
|
372
|
+
</li>
|
373
|
+
|
374
|
+
|
375
|
+
</ul>
|
376
|
+
|
377
|
+
|
378
|
+
|
379
|
+
|
380
|
+
|
381
|
+
<div id="instance_method_details" class="method_details_list">
|
382
|
+
<h2>Instance Method Details</h2>
|
383
|
+
|
384
|
+
|
385
|
+
<div class="method_details first">
|
386
|
+
<h3 class="signature first" id="configure-instance_method">
|
387
|
+
|
388
|
+
#<strong>configure</strong>(xcodeproj_path, scheme, options: {}) ⇒ <tt>void</tt>
|
389
|
+
|
390
|
+
|
391
|
+
|
392
|
+
|
393
|
+
|
394
|
+
</h3><div class="docstring">
|
395
|
+
<div class="discussion">
|
396
|
+
<p class="note returns_void">This method returns an undefined value.</p>
|
397
|
+
<p>Required method to configure slather. It's required at least the path
|
398
|
+
to the project and the scheme used with code coverage enabled</p>
|
399
|
+
|
400
|
+
|
401
|
+
</div>
|
402
|
+
</div>
|
403
|
+
<div class="tags">
|
404
|
+
|
405
|
+
|
406
|
+
</div><table class="source_code">
|
407
|
+
<tr>
|
408
|
+
<td>
|
409
|
+
<pre class="lines">
|
410
|
+
|
411
|
+
|
412
|
+
36
|
413
|
+
37
|
414
|
+
38
|
415
|
+
39
|
416
|
+
40
|
417
|
+
41
|
418
|
+
42
|
419
|
+
43
|
420
|
+
44
|
421
|
+
45
|
422
|
+
46
|
423
|
+
47
|
424
|
+
48
|
425
|
+
49
|
426
|
+
50
|
427
|
+
51
|
428
|
+
52</pre>
|
429
|
+
</td>
|
430
|
+
<td>
|
431
|
+
<pre class="code"><span class="info file"># File 'lib/slather/plugin.rb', line 36</span>
|
432
|
+
|
433
|
+
<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
|
+
<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>
|
435
|
+
<span class='ivar'>@project</span><span class='period'>.</span><span class='id identifier rubyid_scheme'>scheme</span> <span class='op'>=</span> <span class='id identifier rubyid_scheme'>scheme</span>
|
436
|
+
<span class='ivar'>@project</span><span class='period'>.</span><span class='id identifier rubyid_workspace'>workspace</span> <span class='op'>=</span> <span class='id identifier rubyid_options'>options</span><span class='lbracket'>[</span><span class='symbol'>:workspace</span><span class='rbracket'>]</span>
|
437
|
+
<span class='ivar'>@project</span><span class='period'>.</span><span class='id identifier rubyid_build_directory'>build_directory</span> <span class='op'>=</span> <span class='id identifier rubyid_options'>options</span><span class='lbracket'>[</span><span class='symbol'>:build_directory</span><span class='rbracket'>]</span>
|
438
|
+
<span class='ivar'>@project</span><span class='period'>.</span><span class='id identifier rubyid_ignore_list'>ignore_list</span> <span class='op'>=</span> <span class='id identifier rubyid_options'>options</span><span class='lbracket'>[</span><span class='symbol'>:ignore_list</span><span class='rbracket'>]</span>
|
439
|
+
<span class='ivar'>@project</span><span class='period'>.</span><span class='id identifier rubyid_ci_service'>ci_service</span> <span class='op'>=</span> <span class='id identifier rubyid_options'>options</span><span class='lbracket'>[</span><span class='symbol'>:ci_service</span><span class='rbracket'>]</span>
|
440
|
+
<span class='ivar'>@project</span><span class='period'>.</span><span class='id identifier rubyid_coverage_access_token'>coverage_access_token</span> <span class='op'>=</span> <span class='id identifier rubyid_options'>options</span><span class='lbracket'>[</span><span class='symbol'>:coverage_access_token</span><span class='rbracket'>]</span>
|
441
|
+
<span class='ivar'>@project</span><span class='period'>.</span><span class='id identifier rubyid_coverage_service'>coverage_service</span> <span class='op'>=</span> <span class='id identifier rubyid_options'>options</span><span class='lbracket'>[</span><span class='symbol'>:coverage_service</span><span class='rbracket'>]</span> <span class='op'>||</span> <span class='symbol'>:terminal</span>
|
442
|
+
<span class='ivar'>@project</span><span class='period'>.</span><span class='id identifier rubyid_source_directory'>source_directory</span> <span class='op'>=</span> <span class='id identifier rubyid_options'>options</span><span class='lbracket'>[</span><span class='symbol'>:source_directory</span><span class='rbracket'>]</span>
|
443
|
+
<span class='ivar'>@project</span><span class='period'>.</span><span class='id identifier rubyid_output_directory'>output_directory</span> <span class='op'>=</span> <span class='id identifier rubyid_options'>options</span><span class='lbracket'>[</span><span class='symbol'>:output_directory</span><span class='rbracket'>]</span>
|
444
|
+
<span class='ivar'>@project</span><span class='period'>.</span><span class='id identifier rubyid_input_format'>input_format</span> <span class='op'>=</span> <span class='id identifier rubyid_options'>options</span><span class='lbracket'>[</span><span class='symbol'>:input_format</span><span class='rbracket'>]</span>
|
445
|
+
<span class='ivar'>@project</span><span class='period'>.</span><span class='id identifier rubyid_binary_file'>binary_file</span> <span class='op'>=</span> <span class='id identifier rubyid_options'>options</span><span class='lbracket'>[</span><span class='symbol'>:binary_file</span><span class='rbracket'>]</span>
|
446
|
+
<span class='ivar'>@project</span><span class='period'>.</span><span class='id identifier rubyid_decimals'>decimals</span> <span class='op'>=</span> <span class='id identifier rubyid_options'>options</span><span class='lbracket'>[</span><span class='symbol'>:decimals</span><span class='rbracket'>]</span>
|
447
|
+
<span class='ivar'>@project</span><span class='period'>.</span><span class='id identifier rubyid_configure'>configure</span>
|
448
|
+
<span class='ivar'>@project</span><span class='period'>.</span><span class='id identifier rubyid_post'>post</span> <span class='kw'>if</span> <span class='id identifier rubyid_options'>options</span><span class='lbracket'>[</span><span class='symbol'>:post</span><span class='rbracket'>]</span>
|
449
|
+
<span class='kw'>end</span></pre>
|
450
|
+
</td>
|
451
|
+
</tr>
|
452
|
+
</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
|
+
</div>
|
516
|
+
|
517
|
+
<div class="method_details ">
|
518
|
+
<h3 class="signature " id="modified_files_coverage_table-instance_method">
|
519
|
+
|
520
|
+
#<strong>modified_files_coverage_table</strong> ⇒ <tt>String</tt>
|
521
|
+
|
522
|
+
|
523
|
+
|
524
|
+
|
525
|
+
|
526
|
+
</h3><div class="docstring">
|
527
|
+
<div class="discussion">
|
528
|
+
|
529
|
+
<p>Build a coverage markdown table of the modified files coverage</p>
|
530
|
+
|
531
|
+
|
532
|
+
</div>
|
533
|
+
</div>
|
534
|
+
<div class="tags">
|
535
|
+
|
536
|
+
<p class="tag_title">Returns:</p>
|
537
|
+
<ul class="return">
|
538
|
+
|
539
|
+
<li>
|
540
|
+
|
541
|
+
|
542
|
+
<span class='type'>(<tt>String</tt>)</span>
|
543
|
+
|
544
|
+
|
545
|
+
|
546
|
+
</li>
|
547
|
+
|
548
|
+
</ul>
|
549
|
+
|
550
|
+
</div><table class="source_code">
|
551
|
+
<tr>
|
552
|
+
<td>
|
553
|
+
<pre class="lines">
|
554
|
+
|
555
|
+
|
556
|
+
109
|
557
|
+
110
|
558
|
+
111
|
559
|
+
112
|
560
|
+
113
|
561
|
+
114
|
562
|
+
115
|
563
|
+
116
|
564
|
+
117
|
565
|
+
118
|
566
|
+
119
|
567
|
+
120
|
568
|
+
121
|
569
|
+
122
|
570
|
+
123</pre>
|
571
|
+
</td>
|
572
|
+
<td>
|
573
|
+
<pre class="code"><span class="info file"># File 'lib/slather/plugin.rb', line 109</span>
|
574
|
+
|
575
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_modified_files_coverage_table'>modified_files_coverage_table</span>
|
576
|
+
<span class='kw'>unless</span> <span class='ivar'>@project</span><span class='period'>.</span><span class='id identifier rubyid_nil?'>nil?</span>
|
577
|
+
<span class='id identifier rubyid_line'>line</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_end'>'</span></span>
|
578
|
+
<span class='kw'>if</span> <span class='id identifier rubyid_modified_files_coverage'>modified_files_coverage</span><span class='period'>.</span><span class='id identifier rubyid_count'>count</span> <span class='op'>></span> <span class='int'>0</span>
|
579
|
+
<span class='id identifier rubyid_line'>line</span> <span class='op'><<</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>File | Coverage\n</span><span class='tstring_end'>"</span></span>
|
580
|
+
<span class='id identifier rubyid_line'>line</span> <span class='op'><<</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>-----|-----\n</span><span class='tstring_end'>"</span></span>
|
581
|
+
<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
|
+
<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
|
+
<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'> | </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
|
+
<span class='kw'>end</span>
|
586
|
+
<span class='kw'>end</span>
|
587
|
+
<span class='kw'>return</span> <span class='id identifier rubyid_line'>line</span>
|
588
|
+
<span class='kw'>end</span>
|
589
|
+
<span class='kw'>end</span></pre>
|
590
|
+
</td>
|
591
|
+
</tr>
|
592
|
+
</table>
|
593
|
+
</div>
|
594
|
+
|
595
|
+
<div class="method_details ">
|
596
|
+
<h3 class="signature " id="notify_if_coverage_is_less_than-instance_method">
|
597
|
+
|
598
|
+
#<strong>notify_if_coverage_is_less_than</strong>(options) ⇒ <tt>Array<String></tt>
|
599
|
+
|
600
|
+
|
601
|
+
|
602
|
+
|
603
|
+
|
604
|
+
</h3><div class="docstring">
|
605
|
+
<div class="discussion">
|
606
|
+
|
607
|
+
<p>Method to check if the coverage of the project is at least a minumum</p>
|
608
|
+
|
609
|
+
|
610
|
+
</div>
|
611
|
+
</div>
|
612
|
+
<div class="tags">
|
613
|
+
<p class="tag_title">Parameters:</p>
|
614
|
+
<ul class="param">
|
615
|
+
|
616
|
+
<li>
|
617
|
+
|
618
|
+
<span class='name'>options</span>
|
619
|
+
|
620
|
+
|
621
|
+
<span class='type'>(<tt>Hash</tt>)</span>
|
622
|
+
|
623
|
+
|
624
|
+
|
625
|
+
—
|
626
|
+
<div class='inline'>
|
627
|
+
<p>a hash with the options</p>
|
628
|
+
</div>
|
629
|
+
|
630
|
+
</li>
|
631
|
+
|
632
|
+
</ul>
|
633
|
+
|
634
|
+
|
635
|
+
|
636
|
+
|
637
|
+
<p class="tag_title">Options Hash (<tt>options</tt>):</p>
|
638
|
+
<ul class="option">
|
639
|
+
|
640
|
+
<li>
|
641
|
+
<span class="name">:minimum_coverage</span>
|
642
|
+
<span class="type">(<tt>Float</tt>)</span>
|
643
|
+
<span class="default">
|
644
|
+
|
645
|
+
</span>
|
646
|
+
|
647
|
+
— <div class='inline'>
|
648
|
+
<p>the minimum code coverage required</p>
|
649
|
+
</div>
|
650
|
+
|
651
|
+
</li>
|
652
|
+
|
653
|
+
<li>
|
654
|
+
<span class="name">:notify_level</span>
|
655
|
+
<span class="type">(<tt>Symbol</tt>)</span>
|
656
|
+
<span class="default">
|
657
|
+
|
658
|
+
</span>
|
659
|
+
|
660
|
+
— <div class='inline'>
|
661
|
+
<p>the level of notification</p>
|
662
|
+
</div>
|
663
|
+
|
664
|
+
</li>
|
665
|
+
|
666
|
+
</ul>
|
667
|
+
|
668
|
+
|
669
|
+
<p class="tag_title">Returns:</p>
|
670
|
+
<ul class="return">
|
671
|
+
|
672
|
+
<li>
|
673
|
+
|
674
|
+
|
675
|
+
<span class='type'>(<tt>Array<String></tt>)</span>
|
676
|
+
|
677
|
+
|
678
|
+
|
679
|
+
</li>
|
680
|
+
|
681
|
+
</ul>
|
682
|
+
|
683
|
+
</div><table class="source_code">
|
684
|
+
<tr>
|
685
|
+
<td>
|
686
|
+
<pre class="lines">
|
687
|
+
|
688
|
+
|
689
|
+
59
|
690
|
+
60
|
691
|
+
61
|
692
|
+
62
|
693
|
+
63
|
694
|
+
64
|
695
|
+
65
|
696
|
+
66
|
697
|
+
67
|
698
|
+
68
|
699
|
+
69
|
700
|
+
70</pre>
|
701
|
+
</td>
|
702
|
+
<td>
|
703
|
+
<pre class="code"><span class="info file"># File 'lib/slather/plugin.rb', line 59</span>
|
704
|
+
|
705
|
+
<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
|
+
<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>
|
707
|
+
<span class='id identifier rubyid_notify_level'>notify_level</span> <span class='op'>=</span> <span class='id identifier rubyid_options'>options</span><span class='lbracket'>[</span><span class='symbol'>:notify_level</span><span class='rbracket'>]</span> <span class='op'>||</span> <span class='symbol'>:fail</span>
|
708
|
+
<span class='kw'>if</span> <span class='id identifier rubyid_total_coverage'>total_coverage</span> <span class='op'><</span> <span class='id identifier rubyid_minimum_coverage'>minimum_coverage</span>
|
709
|
+
<span class='id identifier rubyid_notify_message'>notify_message</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Total coverage less than </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_minimum_coverage'>minimum_coverage</span><span class='embexpr_end'>}</span><span class='tstring_content'>%</span><span class='tstring_end'>"</span></span>
|
710
|
+
<span class='kw'>if</span> <span class='id identifier rubyid_notify_level'>notify_level</span> <span class='op'>==</span> <span class='symbol'>:fail</span>
|
711
|
+
<span class='id identifier rubyid_fail'>fail</span> <span class='id identifier rubyid_notify_message'>notify_message</span>
|
712
|
+
<span class='kw'>else</span>
|
713
|
+
<span class='id identifier rubyid_warn'>warn</span> <span class='id identifier rubyid_notify_message'>notify_message</span>
|
714
|
+
<span class='kw'>end</span>
|
715
|
+
<span class='kw'>end</span>
|
716
|
+
<span class='kw'>end</span></pre>
|
717
|
+
</td>
|
718
|
+
</tr>
|
719
|
+
</table>
|
720
|
+
</div>
|
721
|
+
|
722
|
+
<div class="method_details ">
|
723
|
+
<h3 class="signature " id="notify_if_modified_file_is_less_than-instance_method">
|
724
|
+
|
725
|
+
#<strong>notify_if_modified_file_is_less_than</strong>(options) ⇒ <tt>Array<String></tt>
|
726
|
+
|
727
|
+
|
728
|
+
|
729
|
+
|
730
|
+
|
731
|
+
</h3><div class="docstring">
|
732
|
+
<div class="discussion">
|
733
|
+
|
734
|
+
<p>Method to check if the coverage of modified files is at least a minumum</p>
|
735
|
+
|
736
|
+
|
737
|
+
</div>
|
738
|
+
</div>
|
739
|
+
<div class="tags">
|
740
|
+
<p class="tag_title">Parameters:</p>
|
741
|
+
<ul class="param">
|
742
|
+
|
743
|
+
<li>
|
744
|
+
|
745
|
+
<span class='name'>options</span>
|
746
|
+
|
747
|
+
|
748
|
+
<span class='type'>(<tt>Hash</tt>)</span>
|
749
|
+
|
750
|
+
|
751
|
+
|
752
|
+
—
|
753
|
+
<div class='inline'>
|
754
|
+
<p>a hash with the options</p>
|
755
|
+
</div>
|
756
|
+
|
757
|
+
</li>
|
758
|
+
|
759
|
+
</ul>
|
760
|
+
|
761
|
+
|
762
|
+
|
763
|
+
|
764
|
+
<p class="tag_title">Options Hash (<tt>options</tt>):</p>
|
765
|
+
<ul class="option">
|
766
|
+
|
767
|
+
<li>
|
768
|
+
<span class="name">:minimum_coverage</span>
|
769
|
+
<span class="type">(<tt>Float</tt>)</span>
|
770
|
+
<span class="default">
|
771
|
+
|
772
|
+
</span>
|
773
|
+
|
774
|
+
— <div class='inline'>
|
775
|
+
<p>the minimum code coverage required for a file</p>
|
776
|
+
</div>
|
777
|
+
|
778
|
+
</li>
|
779
|
+
|
780
|
+
<li>
|
781
|
+
<span class="name">:notify_level</span>
|
782
|
+
<span class="type">(<tt>Symbol</tt>)</span>
|
783
|
+
<span class="default">
|
784
|
+
|
785
|
+
</span>
|
786
|
+
|
787
|
+
— <div class='inline'>
|
788
|
+
<p>the level of notification</p>
|
789
|
+
</div>
|
790
|
+
|
791
|
+
</li>
|
792
|
+
|
793
|
+
</ul>
|
794
|
+
|
795
|
+
|
796
|
+
<p class="tag_title">Returns:</p>
|
797
|
+
<ul class="return">
|
798
|
+
|
799
|
+
<li>
|
800
|
+
|
801
|
+
|
802
|
+
<span class='type'>(<tt>Array<String></tt>)</span>
|
803
|
+
|
804
|
+
|
805
|
+
|
806
|
+
</li>
|
807
|
+
|
808
|
+
</ul>
|
809
|
+
|
810
|
+
</div><table class="source_code">
|
811
|
+
<tr>
|
812
|
+
<td>
|
813
|
+
<pre class="lines">
|
814
|
+
|
815
|
+
|
816
|
+
77
|
817
|
+
78
|
818
|
+
79
|
819
|
+
80
|
820
|
+
81
|
821
|
+
82
|
822
|
+
83
|
823
|
+
84
|
824
|
+
85
|
825
|
+
86
|
826
|
+
87
|
827
|
+
88
|
828
|
+
89
|
829
|
+
90
|
830
|
+
91
|
831
|
+
92
|
832
|
+
93
|
833
|
+
94
|
834
|
+
95
|
835
|
+
96
|
836
|
+
97</pre>
|
837
|
+
</td>
|
838
|
+
<td>
|
839
|
+
<pre class="code"><span class="info file"># File 'lib/slather/plugin.rb', line 77</span>
|
840
|
+
|
841
|
+
<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
|
+
<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>
|
843
|
+
<span class='id identifier rubyid_notify_level'>notify_level</span> <span class='op'>=</span> <span class='id identifier rubyid_options'>options</span><span class='lbracket'>[</span><span class='symbol'>:notify_level</span><span class='rbracket'>]</span> <span class='op'>||</span> <span class='symbol'>:fail</span>
|
844
|
+
|
845
|
+
<span class='kw'>if</span> <span class='id identifier rubyid_modified_files_coverage'>modified_files_coverage</span><span class='period'>.</span><span class='id identifier rubyid_count'>count</span> <span class='op'>></span> <span class='int'>0</span>
|
846
|
+
<span class='id identifier rubyid_files_to_notify'>files_to_notify</span> <span class='op'>=</span> <span class='id identifier rubyid_modified_files_coverage'>modified_files_coverage</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>
|
847
|
+
<span class='id identifier rubyid_file'>file</span><span class='period'>.</span><span class='id identifier rubyid_percentage_lines_tested'>percentage_lines_tested</span> <span class='op'><</span> <span class='id identifier rubyid_minimum_coverage'>minimum_coverage</span>
|
848
|
+
<span class='kw'>end</span>
|
849
|
+
<span class='id identifier rubyid_notify_messages'>notify_messages</span> <span class='op'>=</span> <span class='id identifier rubyid_files_to_notify'>files_to_notify</span><span class='period'>.</span><span class='id identifier rubyid_map'>map</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_file'>file</span><span class='op'>|</span>
|
850
|
+
<span class='tstring'><span class='tstring_beg'>"</span><span class='embexpr_beg'>#{</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='embexpr_end'>}</span><span class='tstring_content'> has less than </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_minimum_coverage'>minimum_coverage</span><span class='embexpr_end'>}</span><span class='tstring_content'>% code coverage</span><span class='tstring_end'>"</span></span>
|
851
|
+
<span class='kw'>end</span>
|
852
|
+
|
853
|
+
<span class='id identifier rubyid_notify_messages'>notify_messages</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_message'>message</span><span class='op'>|</span>
|
854
|
+
<span class='kw'>if</span> <span class='id identifier rubyid_notify_level'>notify_level</span> <span class='op'>==</span> <span class='symbol'>:fail</span>
|
855
|
+
<span class='id identifier rubyid_fail'>fail</span> <span class='id identifier rubyid_message'>message</span>
|
856
|
+
<span class='kw'>else</span>
|
857
|
+
<span class='id identifier rubyid_warn'>warn</span> <span class='id identifier rubyid_message'>message</span>
|
858
|
+
<span class='kw'>end</span>
|
859
|
+
<span class='kw'>end</span>
|
860
|
+
<span class='kw'>end</span>
|
861
|
+
<span class='kw'>end</span></pre>
|
862
|
+
</td>
|
863
|
+
</tr>
|
864
|
+
</table>
|
865
|
+
</div>
|
866
|
+
|
867
|
+
<div class="method_details ">
|
868
|
+
<h3 class="signature " id="show_coverage-instance_method">
|
869
|
+
|
870
|
+
#<strong>show_coverage</strong> ⇒ <tt>Array<String></tt>
|
871
|
+
|
872
|
+
|
873
|
+
|
874
|
+
|
875
|
+
|
876
|
+
</h3><div class="docstring">
|
877
|
+
<div class="discussion">
|
878
|
+
|
879
|
+
<p>Show a header with the total coverage and coverage table</p>
|
880
|
+
|
881
|
+
|
882
|
+
</div>
|
883
|
+
</div>
|
884
|
+
<div class="tags">
|
885
|
+
|
886
|
+
<p class="tag_title">Returns:</p>
|
887
|
+
<ul class="return">
|
888
|
+
|
889
|
+
<li>
|
890
|
+
|
891
|
+
|
892
|
+
<span class='type'>(<tt>Array<String></tt>)</span>
|
893
|
+
|
894
|
+
|
895
|
+
|
896
|
+
</li>
|
897
|
+
|
898
|
+
</ul>
|
899
|
+
|
900
|
+
</div><table class="source_code">
|
901
|
+
<tr>
|
902
|
+
<td>
|
903
|
+
<pre class="lines">
|
904
|
+
|
905
|
+
|
906
|
+
135
|
907
|
+
136
|
908
|
+
137
|
909
|
+
138
|
910
|
+
139
|
911
|
+
140
|
912
|
+
141
|
913
|
+
142
|
914
|
+
143</pre>
|
915
|
+
</td>
|
916
|
+
<td>
|
917
|
+
<pre class="code"><span class="info file"># File 'lib/slather/plugin.rb', line 135</span>
|
918
|
+
|
919
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_show_coverage'>show_coverage</span>
|
920
|
+
<span class='kw'>unless</span> <span class='ivar'>@project</span><span class='period'>.</span><span class='id identifier rubyid_nil?'>nil?</span>
|
921
|
+
<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='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Total coverage: </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_total_coverage'>total_coverage</span><span class='embexpr_end'>}</span><span class='tstring_content'>\n\n</span><span class='tstring_end'>"</span></span>
|
923
|
+
<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
|
+
<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
|
+
<span class='id identifier rubyid_markdown'>markdown</span> <span class='id identifier rubyid_line'>line</span>
|
926
|
+
<span class='kw'>end</span>
|
927
|
+
<span class='kw'>end</span></pre>
|
928
|
+
</td>
|
929
|
+
</tr>
|
930
|
+
</table>
|
931
|
+
</div>
|
932
|
+
|
933
|
+
<div class="method_details ">
|
934
|
+
<h3 class="signature " id="show_modified_files_coverage-instance_method">
|
935
|
+
|
936
|
+
#<strong>show_modified_files_coverage</strong> ⇒ <tt>Array<String></tt>
|
937
|
+
|
938
|
+
|
939
|
+
|
940
|
+
|
941
|
+
|
942
|
+
</h3><div class="docstring">
|
943
|
+
<div class="discussion">
|
944
|
+
|
945
|
+
<p>Show the table build by modified_files_coverage_table</p>
|
946
|
+
|
947
|
+
|
948
|
+
</div>
|
949
|
+
</div>
|
950
|
+
<div class="tags">
|
951
|
+
|
952
|
+
<p class="tag_title">Returns:</p>
|
953
|
+
<ul class="return">
|
954
|
+
|
955
|
+
<li>
|
956
|
+
|
957
|
+
|
958
|
+
<span class='type'>(<tt>Array<String></tt>)</span>
|
959
|
+
|
960
|
+
|
961
|
+
|
962
|
+
</li>
|
963
|
+
|
964
|
+
</ul>
|
965
|
+
|
966
|
+
</div><table class="source_code">
|
967
|
+
<tr>
|
968
|
+
<td>
|
969
|
+
<pre class="lines">
|
970
|
+
|
971
|
+
|
972
|
+
127
|
973
|
+
128
|
974
|
+
129
|
975
|
+
130
|
976
|
+
131</pre>
|
977
|
+
</td>
|
978
|
+
<td>
|
979
|
+
<pre class="code"><span class="info file"># File 'lib/slather/plugin.rb', line 127</span>
|
980
|
+
|
981
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_show_modified_files_coverage'>show_modified_files_coverage</span>
|
982
|
+
<span class='kw'>unless</span> <span class='ivar'>@project</span><span class='period'>.</span><span class='id identifier rubyid_nil?'>nil?</span>
|
983
|
+
<span class='id identifier rubyid_markdown'>markdown</span> <span class='id identifier rubyid_modified_files_coverage_table'>modified_files_coverage_table</span>
|
984
|
+
<span class='kw'>end</span>
|
985
|
+
<span class='kw'>end</span></pre>
|
986
|
+
</td>
|
987
|
+
</tr>
|
988
|
+
</table>
|
989
|
+
</div>
|
990
|
+
|
991
|
+
<div class="method_details ">
|
992
|
+
<h3 class="signature " id="show_total_coverage-instance_method">
|
993
|
+
|
994
|
+
#<strong>show_total_coverage</strong> ⇒ <tt>Array<String></tt>
|
995
|
+
|
996
|
+
|
997
|
+
|
998
|
+
|
999
|
+
|
1000
|
+
</h3><div class="docstring">
|
1001
|
+
<div class="discussion">
|
1002
|
+
|
1003
|
+
<p>Show a header with the total coverage of the project</p>
|
1004
|
+
|
1005
|
+
|
1006
|
+
</div>
|
1007
|
+
</div>
|
1008
|
+
<div class="tags">
|
1009
|
+
|
1010
|
+
<p class="tag_title">Returns:</p>
|
1011
|
+
<ul class="return">
|
1012
|
+
|
1013
|
+
<li>
|
1014
|
+
|
1015
|
+
|
1016
|
+
<span class='type'>(<tt>Array<String></tt>)</span>
|
1017
|
+
|
1018
|
+
|
1019
|
+
|
1020
|
+
</li>
|
1021
|
+
|
1022
|
+
</ul>
|
1023
|
+
|
1024
|
+
</div><table class="source_code">
|
1025
|
+
<tr>
|
1026
|
+
<td>
|
1027
|
+
<pre class="lines">
|
1028
|
+
|
1029
|
+
|
1030
|
+
101
|
1031
|
+
102
|
1032
|
+
103
|
1033
|
+
104
|
1034
|
+
105</pre>
|
1035
|
+
</td>
|
1036
|
+
<td>
|
1037
|
+
<pre class="code"><span class="info file"># File 'lib/slather/plugin.rb', line 101</span>
|
1038
|
+
|
1039
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_show_total_coverage'>show_total_coverage</span>
|
1040
|
+
<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='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'># Coverage </span><span class='embexpr_beg'>#{</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_total_coverage'>total_coverage</span><span class='rbracket'>]</span><span class='rparen'>)</span><span class='embexpr_end'>}</span><span class='tstring_content'>%</span><span class='tstring_end'>"</span></span>
|
1042
|
+
<span class='kw'>end</span>
|
1043
|
+
<span class='kw'>end</span></pre>
|
1044
|
+
</td>
|
1045
|
+
</tr>
|
1046
|
+
</table>
|
1047
|
+
</div>
|
1048
|
+
|
1049
|
+
<div class="method_details ">
|
1050
|
+
<h3 class="signature " id="total_coverage-instance_method">
|
1051
|
+
|
1052
|
+
#<strong>total_coverage</strong> ⇒ <tt>Float</tt>
|
1053
|
+
|
1054
|
+
|
1055
|
+
|
1056
|
+
|
1057
|
+
|
1058
|
+
</h3><div class="docstring">
|
1059
|
+
<div class="discussion">
|
1060
|
+
|
1061
|
+
<p>Total coverage of the project</p>
|
1062
|
+
|
1063
|
+
|
1064
|
+
</div>
|
1065
|
+
</div>
|
1066
|
+
<div class="tags">
|
1067
|
+
|
1068
|
+
<p class="tag_title">Returns:</p>
|
1069
|
+
<ul class="return">
|
1070
|
+
|
1071
|
+
<li>
|
1072
|
+
|
1073
|
+
|
1074
|
+
<span class='type'>(<tt>Float</tt>)</span>
|
1075
|
+
|
1076
|
+
|
1077
|
+
|
1078
|
+
</li>
|
1079
|
+
|
1080
|
+
</ul>
|
1081
|
+
|
1082
|
+
</div><table class="source_code">
|
1083
|
+
<tr>
|
1084
|
+
<td>
|
1085
|
+
<pre class="lines">
|
1086
|
+
|
1087
|
+
|
1088
|
+
19
|
1089
|
+
20
|
1090
|
+
21
|
1091
|
+
22
|
1092
|
+
23
|
1093
|
+
24
|
1094
|
+
25
|
1095
|
+
26
|
1096
|
+
27
|
1097
|
+
28
|
1098
|
+
29
|
1099
|
+
30
|
1100
|
+
31</pre>
|
1101
|
+
</td>
|
1102
|
+
<td>
|
1103
|
+
<pre class="code"><span class="info file"># File 'lib/slather/plugin.rb', line 19</span>
|
1104
|
+
|
1105
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_total_coverage'>total_coverage</span>
|
1106
|
+
<span class='kw'>unless</span> <span class='ivar'>@project</span><span class='period'>.</span><span class='id identifier rubyid_nil?'>nil?</span>
|
1107
|
+
<span class='ivar'>@total_coverage</span> <span class='op'>||=</span> <span class='kw'>begin</span>
|
1108
|
+
<span class='id identifier rubyid_total_project_lines'>total_project_lines</span> <span class='op'>=</span> <span class='int'>0</span>
|
1109
|
+
<span class='id identifier rubyid_total_project_lines_tested'>total_project_lines_tested</span> <span class='op'>=</span> <span class='int'>0</span>
|
1110
|
+
<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_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>
|
1111
|
+
<span class='id identifier rubyid_total_project_lines_tested'>total_project_lines_tested</span> <span class='op'>+=</span> <span class='id identifier rubyid_coverage_file'>coverage_file</span><span class='period'>.</span><span class='id identifier rubyid_num_lines_tested'>num_lines_tested</span>
|
1112
|
+
<span class='id identifier rubyid_total_project_lines'>total_project_lines</span> <span class='op'>+=</span> <span class='id identifier rubyid_coverage_file'>coverage_file</span><span class='period'>.</span><span class='id identifier rubyid_num_lines_testable'>num_lines_testable</span>
|
1113
|
+
<span class='kw'>end</span>
|
1114
|
+
<span class='ivar'>@total_coverage</span> <span class='op'>=</span> <span class='lparen'>(</span><span class='id identifier rubyid_total_project_lines_tested'>total_project_lines_tested</span> <span class='op'>/</span> <span class='id identifier rubyid_total_project_lines'>total_project_lines</span><span class='period'>.</span><span class='id identifier rubyid_to_f'>to_f</span><span class='rparen'>)</span> <span class='op'>*</span> <span class='float'>100.0</span>
|
1115
|
+
<span class='kw'>end</span>
|
1116
|
+
<span class='kw'>end</span>
|
1117
|
+
<span class='kw'>end</span></pre>
|
1118
|
+
</td>
|
1119
|
+
</tr>
|
1120
|
+
</table>
|
1121
|
+
</div>
|
1122
|
+
|
1123
|
+
</div>
|
1124
|
+
|
1125
|
+
</div>
|
1126
|
+
|
1127
|
+
<div id="footer">
|
1128
|
+
Generated on Sun Nov 27 19:08:32 2016 by
|
1129
|
+
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
1130
|
+
0.9.5 (ruby-2.3.1).
|
1131
|
+
</div>
|
1132
|
+
|
1133
|
+
</div>
|
1134
|
+
</body>
|
1135
|
+
</html>
|