danger-xcov 0.3.3 → 0.4.0
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/README.md +18 -0
- data/lib/danger_plugin.rb +14 -1
- data/lib/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 21e8012b1e14fde5ddb6a3ff3ddf754b373dee37
|
4
|
+
data.tar.gz: f5f36750814b09056215d8b8c3c06c9871f636ff
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3d64cd178a70ac496c9ab69a107cc1c31f9f6440971c44d7f165c7fa346c192fc5be6532db49398721fb151f7ee7410ce7ced3720202fbceef3b60784823016a
|
7
|
+
data.tar.gz: a1d30c25481ad9855e897f488dbc38faa46feaff0c9b527dc0e815e8ab96416c10bfeba82259bd11fb0be506ce6952fccbf78dd5e65f9b6301b81a77f400c9cf
|
data/README.md
CHANGED
@@ -40,5 +40,23 @@ The result is as cool as follows:
|
|
40
40
|
<img src="/assets_readme/xcov_danger.png" />
|
41
41
|
</h3>
|
42
42
|
|
43
|
+
You can also process the output generated by **xcov** before posting the markdown
|
44
|
+
report as follows:
|
45
|
+
|
46
|
+
```ruby
|
47
|
+
# Generate report
|
48
|
+
report = xcov.produce_report(
|
49
|
+
scheme: 'EasyPeasy',
|
50
|
+
workspace: 'Example/EasyPeasy.xcworkspace',
|
51
|
+
exclude_targets: 'Demo.app',
|
52
|
+
minimum_coverage_percentage: 90
|
53
|
+
)
|
54
|
+
|
55
|
+
# Do some custom filtering with the report here
|
56
|
+
|
57
|
+
# Post markdown report
|
58
|
+
xcov.output_report(report)
|
59
|
+
```
|
60
|
+
|
43
61
|
## License
|
44
62
|
This project is licensed under the terms of the MIT license. See the LICENSE file.
|
data/lib/danger_plugin.rb
CHANGED
@@ -32,6 +32,16 @@ module Danger
|
|
32
32
|
# @return [void]
|
33
33
|
#
|
34
34
|
def report(*args)
|
35
|
+
# Run xcov to produce a processed report
|
36
|
+
report = produce_report(*args)
|
37
|
+
# Output the processed report
|
38
|
+
output_report(report)
|
39
|
+
end
|
40
|
+
|
41
|
+
# Produces and processes a report for use in the report method
|
42
|
+
# It takes the same arguments as report, and returns the same
|
43
|
+
# object as process_report
|
44
|
+
def produce_report(*args)
|
35
45
|
# Check xcov availability, install it if needed
|
36
46
|
`gem install xcov` unless xcov_available?
|
37
47
|
unless xcov_available?
|
@@ -54,8 +64,11 @@ module Danger
|
|
54
64
|
report_json = manager.parse_xccoverage
|
55
65
|
|
56
66
|
# Map and process report
|
57
|
-
|
67
|
+
process_report(Xcov::Report.map(report_json))
|
68
|
+
end
|
58
69
|
|
70
|
+
# Outputs a processed report with Danger
|
71
|
+
def output_report(report)
|
59
72
|
# Create markdown
|
60
73
|
report_markdown = report.markdown_value
|
61
74
|
|
data/lib/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: danger-xcov
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Carlos Vidal
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-12-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: danger
|
@@ -103,7 +103,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
103
103
|
version: '0'
|
104
104
|
requirements: []
|
105
105
|
rubyforge_project:
|
106
|
-
rubygems_version: 2.
|
106
|
+
rubygems_version: 2.4.8
|
107
107
|
signing_key:
|
108
108
|
specification_version: 4
|
109
109
|
summary: Danger plugin to validate the code coverage of the files changed
|