cobench 0.0.25 → 0.0.26

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/bin/cobench +7 -2
  3. data/lib/cobench/version.rb +1 -1
  4. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 8d819cbcfb4db70f384f27e82168b629ff4d5b1da9846edcbde2f2ebea965f86
4
- data.tar.gz: 8fd71ec9c615bc21e6b33c6ee2b1b30d3e45f6e5c6ca3bcf64b04051861253d2
3
+ metadata.gz: 6fbe7145f065a7c65776e187ebe08795e6bf43d96461b47da21bfc33cf241f23
4
+ data.tar.gz: 4ded5cf401303b0107f08ad06e839fdf17303c4de7aa8c7a35607a8d361d2a4b
5
5
  SHA512:
6
- metadata.gz: ebd6470d05c7883710c2d0b8197e559a9d2fb9c250b290ce6b7ba474b5363d129e67ae8a147f743324f6252d4d3d302e1acf4240cce5f2dbaca6d4397fe78b0d
7
- data.tar.gz: c0675ef02071fb68f066e61c66184fcc4010685ce442b1345b7c9a16a40f9f187bc23428a689a4a41252dd2493df806d5eb782147c11c2c9fc1410537392f3af
6
+ metadata.gz: 230046c4cd9da1cd3efec5720bbc7c8da1829e6eef8c8cf3e54d031f124bec8ae8c9393bacfc52a5c86dccc1dfe9cb7061950eb61d392c96f4191cc512e04552
7
+ data.tar.gz: 338a370eaaecd73ae8ed886bec1ef9971924012be9e6d87c99881ec85e1954fdd6759bb6625684c38cdf5bb21b2558a4d344e526b3f1e11fdf9344f312ea64a9
data/bin/cobench CHANGED
@@ -79,6 +79,11 @@ def div(a, b)
79
79
  a / b
80
80
  end
81
81
 
82
+ def actual(ms)
83
+ return ms[:actual] if ms.key?(:actual)
84
+ ms[:total]
85
+ end
86
+
82
87
  def build_xml(opts, loog)
83
88
  if opts.token?
84
89
  api = Octokit::Client.new(:access_token => opts[:token])
@@ -155,11 +160,11 @@ def build_xml(opts, loog)
155
160
  end
156
161
  averages = {
157
162
  'HpP': {
158
- f: lambda { |ms| div(ms['HoC'][:total], ms['Pulls'][:total]) },
163
+ f: lambda { |ms| div(actual(ms['HoC']), actual(ms['Pulls'])) },
159
164
  title: 'HoC per Pull'
160
165
  },
161
166
  'HpC': {
162
- f: lambda { |ms| div(ms['HoC'][:total], ms['Commits'][:total]) },
167
+ f: lambda { |ms| div(actual(ms['HoC']), actual(ms['Commits'])) },
163
168
  title: 'HoC per Commit'
164
169
  }
165
170
  }
@@ -23,5 +23,5 @@
23
23
  # Copyright:: Copyright (c) 2022 Yegor Bugayenko
24
24
  # License:: MIT
25
25
  module Cobench
26
- VERSION = '0.0.25'.freeze
26
+ VERSION = '0.0.26'.freeze
27
27
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cobench
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.25
4
+ version: 0.0.26
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yegor Bugayenko
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-09-01 00:00:00.000000000 Z
11
+ date: 2022-09-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: backtrace