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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 910095a8b18f90751a632e8734d6cc802f60c2c0
4
- data.tar.gz: b9a23264b5f2978a3b3228ebbf94fac855725daa
3
+ metadata.gz: 21e8012b1e14fde5ddb6a3ff3ddf754b373dee37
4
+ data.tar.gz: f5f36750814b09056215d8b8c3c06c9871f636ff
5
5
  SHA512:
6
- metadata.gz: e044093f4a481010f7fa6930bb644cabadf1f2d5e008b82ae751c5c62d407ec776f57e2c5222d6433a9245eb4a1955cd88ca2c4c5fed704a798358514ebcef83
7
- data.tar.gz: eb45e6960766b89ace3963e3eb41dfddcbf106b6d392dfa78069a289825a34070e1d95c9b935f27060865f99cf1a7881097f59fdbd44b5782c2630c28a22c4d0
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.
@@ -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
- report = process_report(Xcov::Report.map(report_json))
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
 
@@ -1,4 +1,4 @@
1
1
  module DangerXcov
2
- VERSION = "0.3.3"
2
+ VERSION = "0.4.0"
3
3
  DESCRIPTION = "Danger plugin to validate the code coverage of the files changed"
4
4
  end
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.3.3
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-07-19 00:00:00.000000000 Z
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.6.12
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