codestats-metrics-reporter 0.1.7 → 0.1.8

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
  SHA1:
3
- metadata.gz: 25358de0e33079ab4d41de8b2c78308a5ca2af04
4
- data.tar.gz: 869c4c46322692e47cbb3dbd6560b8b343333b3f
3
+ metadata.gz: d58e014bfb74c1f6aea52b9e8929ee159aecfaa3
4
+ data.tar.gz: a78bd9267bdd6c695629a358001f5acbf9fc45ee
5
5
  SHA512:
6
- metadata.gz: 2deca6141e10c4aca94f445546d94a7e991f94019335d69ec5ff78e44d0021ac4d810a5d607ef7a21129e665fbbe2292efc7f384822a224393b9221e9a01bbb4
7
- data.tar.gz: 1923e107dbde40766ac4cdd1b0e4104bbd323069e50ffbc4cb73d74809444fa64af25646c53fa403ab722dfd0ac81644c049baf7970bbae7de52d73ecd3a9b7a
6
+ metadata.gz: 7e18c7995be176432433aa036386e951d498a547a6ab02f96e07d36e73fba7c9b8a8d78e77a8107579218c6ed2521551003b3d5a4fa76c59842edfc2397ef061
7
+ data.tar.gz: 8b0049cf444cc7717bb9e0fb0670e57d016586ba1748eefeb9f4e21ad6e43acc483ef87ea4356c6f8f211173a9a3ecd4f510bea8ab076d7e32c2c357b6e71f25
@@ -28,7 +28,7 @@ module CodeStats
28
28
  base_dir = Pathname.new(@metric.data['report_dir'])
29
29
  build_uploader.upload(File.realpath(base_dir).to_s, bucket) if upload_report?
30
30
  output = File.read(base_dir.join('overview.html'))
31
- /Score:\s[0-9]*\.?[0-9]+/.match(output).to_s.scan(/[0-9]*\.?[0-9]+/).first
31
+ /var\sscore\s=\s[0-9]*\.?[0-9]+/.match(output).to_s.scan(/[0-9]*\.?[0-9]+/).first
32
32
  end
33
33
 
34
34
  def upload_report?
@@ -6,6 +6,7 @@ module CodeStats
6
6
  class Simplecov
7
7
  class << self
8
8
  def generate_data(metric, _config_store)
9
+ return empty_value unless File.directory?('coverage')
9
10
  json = JSON.parse(File.read('coverage/.last_run.json'))
10
11
  code_coverage = json['result']['covered_percent']
11
12
  {
@@ -14,6 +15,14 @@ module CodeStats
14
15
  minimum: metric.data['minimum']
15
16
  }
16
17
  end
18
+
19
+ def empty_value
20
+ {
21
+ metric_name: metric.data['name'],
22
+ value: 0,
23
+ minimum: metric.data['minimum']
24
+ }
25
+ end
17
26
  end
18
27
  end
19
28
  end
@@ -1,7 +1,7 @@
1
1
  module CodeStats
2
2
  module Metrics
3
3
  module Reporter
4
- VERSION = '0.1.7'.freeze
4
+ VERSION = '0.1.8'.freeze
5
5
  end
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: codestats-metrics-reporter
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.7
4
+ version: 0.1.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Esteban Pintos
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-10-07 00:00:00.000000000 Z
11
+ date: 2016-11-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler