codestats-metrics-reporter 0.1.1 → 0.1.2

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: 9a7ba1a750731604acff9ed2e49ca1e0a69acebc
4
- data.tar.gz: c4be220ae214999004a17a45f4a17e1599071287
3
+ metadata.gz: 371971584d3415a307aa3ffe3ebabbf43084a036
4
+ data.tar.gz: 7e1ae4a0112bef86a35aa850f6f161e4e6b490af
5
5
  SHA512:
6
- metadata.gz: b61e2a5e01770c8c4760cbe2a883af6fce3c2382979a1797dddca5f0294b2d71942332d107640e7828c35c37cc9c4f2414d7eabeb62d38944faf688f3d3a5dfb
7
- data.tar.gz: dbc5f021f96525184f02db1a09b7787da74761fce0e8496771be667c7470bca8c199a6b19f5d44d16170bdce3dabf65ffbfe31503485ae104a9232c51ac86b11
6
+ metadata.gz: db33ce19b9b7050791a2bd50841f6149bcf42e64d6ad416c299ac06579e73c223a69f2bbbf8d3525c6271432b8ee8db350afea5235162af2eb5e84d55788ae3a
7
+ data.tar.gz: 7e75e78b1050456c1792dde0a8f1defe30419dea750b2d8ff559d413c3f273259fc275313c7ed134f0932a57d1f1d73b23331a2b927a2eadbec1da967a20515d
data/README.md CHANGED
@@ -1,6 +1,8 @@
1
1
  Code Stats Metrics Reporter
2
2
  ===========================
3
3
 
4
+ [![Gem Version](https://badge.fury.io/rb/codestats-metrics-reporter.svg)](https://badge.fury.io/rb/codestats-metrics-reporter)
5
+
4
6
  Ruby tasks gem to report metrics to [Code Stats](https://github.com/Wolox/codestats) from a Continous Integration service.
5
7
 
6
8
  This gem is still alpha stage and it is not pushed to [Ruby Gems](https://rubygems.org/). It include those metrics that suit [Wolox](http://wolox.co) technologies. The idea es to leave this gem as a generic interface to [Code Stats](https://github.com/Wolox/codestats) that parses metrics from a folder. So you can generate a separate gem per metric that will leave metrics in that folder. The invocation would be something like this:
@@ -9,6 +9,7 @@ metrics:
9
9
  minimum: 70
10
10
  upload_report: true
11
11
  report_dir: 'tmp/rubycritic'
12
+ score_dir: 'tmp/rubycritic_score.out'
12
13
  uploader_key: <%= ENV['CODE_STATS_S3_KEY'] %>
13
14
  uploader_secret: <%= ENV['CODE_STATS_S3_SECRET_KEY'] %>
14
15
  uploader_region: <%= ENV['CODE_STATS_S3_REGION'] %>
@@ -27,7 +27,8 @@ module CodeStats
27
27
  def generate_score_file
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
- JSON.parse(File.read(base_dir.join('report.json')))
30
+ output = File.read(@metric.data['score_dir'])
31
+ /Score:\s[0-9]*\.?[0-9]+/.match(output).to_s.scan(/[0-9]*\.?[0-9]+/).first
31
32
  end
32
33
 
33
34
  def upload_report?
@@ -1,7 +1,7 @@
1
1
  module CodeStats
2
2
  module Metrics
3
3
  module Reporter
4
- VERSION = '0.1.1'.freeze
4
+ VERSION = '0.1.2'.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.1
4
+ version: 0.1.2
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-07-27 00:00:00.000000000 Z
11
+ date: 2016-09-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler