danger-rcov 0.0.4 → 0.0.5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a1f292ff13f27b987c01784c87234eb7183a7cb11eec0565e328cd5bda6abf58
4
- data.tar.gz: 55933912c655422873054e9c505b0606726f6eb70a10672a48dc52c4b11a598e
3
+ metadata.gz: dad4e0e4d7f72d9ab2b1101baf29b8caeb5c1f7bc2c7385ce96c1f3e521ca82b
4
+ data.tar.gz: 4eb8c77f703e1ecf302519187cafd61fc38f0b40a955e5239fa4e910f44834f0
5
5
  SHA512:
6
- metadata.gz: 64aefe5439ab1d15ddc2b2b8556d74166227ee66fd20b4753c8a617296c1ae93d73720f148296cef6d626b1a05f0a4993b4526a8104f99599aa702bc7bc840d4
7
- data.tar.gz: 92d9d20383714cadfced85334ef46fd3dbdfd819f3f6816bb16ea0ae3c1de576f4e02e5c82a48688fb834f6743220946e98910f23335490bbd79c989ce138ac9
6
+ metadata.gz: 920081b083ceed32785b1eef71e0cdd3c251fbeced749b78bacac765a6499e38591fc52c69b1c7fbce526484aa67b580bee40bc89b9d89fe945d0d8576ca0c72
7
+ data.tar.gz: bb333d40155b44f8cc83943e70cdc344da99a9b4ce8dd9d1d0d29b202d5da5df52d53662530dbc8fa079776e3d557de3d2e508e9575a1620294cd109441f768b
@@ -1,3 +1,3 @@
1
1
  module Rcov
2
- VERSION = "0.0.4".freeze
2
+ VERSION = "0.0.5".freeze
3
3
  end
@@ -3,11 +3,16 @@ require 'net/http'
3
3
 
4
4
  module Danger
5
5
  class DangerRcov < Plugin
6
- def report(current_url:, master_url:)
6
+ def report(current_url:, master_url:, show_warning: true)
7
7
  # Get code coverage report as json from url
8
8
  current_report = get_report(url: current_url)
9
9
 
10
10
  master_report = get_report(url: master_url)
11
+
12
+ if show_warning && master_report && master_report['metrics']['covered_percent'].round(2) > current_report['metrics']['covered_percent'].round(2)
13
+ warn("Code coverage decreased from #{master_report['metrics']['covered_percent'].round(2).to_s}% to #{current_report['metrics']['covered_percent'].round(2)}%")
14
+ end
15
+
11
16
  # Output the processed report
12
17
  output_report(current_report, master_report)
13
18
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: danger-rcov
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Guilherme Pereira