cobench 0.0.20 → 0.0.23

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: 944037515588754a9074051087759954ea921346dbf852b234a9507836e4ad4d
4
- data.tar.gz: e718f120d970ae6f60cd83c748d4f33b6570fc4befa9ec7801316700951b56bb
3
+ metadata.gz: 604bc440cc611d58157046222985596f38e6e8d0c3fbb688d5da5674e9a9316e
4
+ data.tar.gz: 34760c74e9ccc9a64015938ba9c45c169a7550c756868bff677a9fe316fe9bfe
5
5
  SHA512:
6
- metadata.gz: 9bed4c1f78e45b2d7185e0c2bb67b928bb4b642cc70ac49851ed81de577817ce54da6fdd2f85f836fb26c30d27814b68c4d6e6164907e69157be0cd209227751
7
- data.tar.gz: 9768224ff1925aef1a9cfa7656c930ae3782e6f5488aa7aa502f5a8032974925da8f64916147609cc0a2f801afd466d1b6b707ba1a6343a9a063fdf49ff9aed8
6
+ metadata.gz: a25a38c04d6533792ea15d943f2c0aaf71a750a8dfc6281eefe6241810b98ecfc2999f77ce37fc38c70083dd5b84976298365d361db597df0f5fb4e05322619f
7
+ data.tar.gz: 0babefa866f31ca680a86c31dbeae144d18d61cb389447a04dccfa998a2cc661a14e3a8e118c86a5835b785ed1f05885199f8167a94f952ca5aea017fce079f4
data/assets/index.xsl CHANGED
@@ -140,6 +140,12 @@ SOFTWARE.
140
140
  <xsl:text> days</xsl:text>
141
141
  </b>
142
142
  <xsl:text>.</xsl:text>
143
+ <br/>
144
+ <xsl:text>The XML with the data </xsl:text>
145
+ <a href="index.xml">
146
+ <xsl:text>is here</xsl:text>
147
+ </a>
148
+ <xsl:text>.</xsl:text>
143
149
  </p>
144
150
  </footer>
145
151
  </section>
@@ -175,10 +181,12 @@ SOFTWARE.
175
181
  <xsl:text>@</xsl:text>
176
182
  <xsl:value-of select="@id"/>
177
183
  </a>
178
- <br/>
179
- <span class="subtitle">
180
- <xsl:value-of select="@details"/>
181
- </span>
184
+ <xsl:if test="@details">
185
+ <br/>
186
+ <span class="subtitle">
187
+ <xsl:value-of select="@details"/>
188
+ </span>
189
+ </xsl:if>
182
190
  </td>
183
191
  <xsl:for-each select="metrics/m">
184
192
  <xsl:sort select="@id"/>
@@ -189,28 +197,28 @@ SOFTWARE.
189
197
  <xsl:template match="m">
190
198
  <xsl:variable name="body">
191
199
  <xsl:choose>
192
- <xsl:when test="@href = ''">
193
- <xsl:value-of select="."/>
194
- </xsl:when>
195
- <xsl:otherwise>
200
+ <xsl:when test="@href">
196
201
  <a href="{@href}">
197
202
  <xsl:value-of select="."/>
198
203
  </a>
204
+ </xsl:when>
205
+ <xsl:otherwise>
206
+ <xsl:value-of select="."/>
199
207
  </xsl:otherwise>
200
208
  </xsl:choose>
201
209
  </xsl:variable>
202
210
  <td class="num">
211
+ <xsl:choose>
212
+ <xsl:when test="@actual">
213
+ <span class="firebrick">
214
+ <xsl:copy-of select="$body"/>
215
+ </span>
216
+ </xsl:when>
217
+ <xsl:otherwise>
218
+ <xsl:copy-of select="$body"/>
219
+ </xsl:otherwise>
220
+ </xsl:choose>
203
221
  <xsl:if test="@actual">
204
- <xsl:choose>
205
- <xsl:when test="@actual">
206
- <span class="firebrick">
207
- <xsl:value-of select="$body"/>
208
- </span>
209
- </xsl:when>
210
- <xsl:otherwise>
211
- <xsl:value-of select="$body"/>
212
- </xsl:otherwise>
213
- </xsl:choose>
214
222
  <br/>
215
223
  <span class="subtitle" title="The actual value of the metric was capped">
216
224
  <xsl:value-of select="@actual"/>
data/bin/cobench CHANGED
@@ -136,22 +136,22 @@ def build_xml(opts, loog)
136
136
  end
137
137
  weights = {
138
138
  'HoC' => 1,
139
- 'Pulls' => 200,
139
+ 'Pulls' => 250,
140
140
  'Issues' => 50,
141
141
  'Commits' => 5,
142
- 'Reviews' => 75
142
+ 'Reviews' => 150
143
143
  }
144
144
  data.each do |u, ms|
145
145
  score = ms.map do |t, h|
146
146
  raise "Unknown title '#{t}'" unless weights.key?(t)
147
147
  h[:total] * weights[t]
148
148
  end.inject(0, :+)
149
- data[u]['Score'] = { total: score, href: '' }
149
+ data[u]['Score'] = { total: score }
150
150
  end
151
151
  builder = Nokogiri::XML::Builder.new(:encoding => 'UTF-8') do |xml|
152
152
  xml.cobench(time: Time.now, days: opts[:days]) do
153
153
  xml.titles do
154
- data.map { |_, ms| ms.keys }.flatten.each do |t|
154
+ data.map { |_, ms| ms.keys }.flatten.uniq.each do |t|
155
155
  xml.title t
156
156
  end
157
157
  end
@@ -165,10 +165,10 @@ def build_xml(opts, loog)
165
165
  xml.coders do
166
166
  data.each do |u, ms|
167
167
  xml.coder(id: u) do
168
- xml.parent.set_attribute('details', api.user(u).name)
168
+ xml.parent.set_attribute('details', api.user(u).name) unless opts[:dry]
169
169
  xml.metrics do
170
170
  ms.each do |k, v|
171
- xml.m(id: k, href: v[:href]) do
171
+ xml.m(id: k) do
172
172
  xml.parent.set_attribute('actual', v[:actual]) unless v[:actual].nil?
173
173
  xml.parent.set_attribute('href', v[:href]) unless v[:href].nil?
174
174
  xml.text v[:total]
@@ -57,8 +57,7 @@ class Cobench::Commits
57
57
  },
58
58
  {
59
59
  title: 'HoC',
60
- total: hoc,
61
- href: ''
60
+ total: hoc
62
61
  }
63
62
  ]
64
63
  end
@@ -23,5 +23,5 @@
23
23
  # Copyright:: Copyright (c) 2022 Yegor Bugayenko
24
24
  # License:: MIT
25
25
  module Cobench
26
- VERSION = '0.0.20'.freeze
26
+ VERSION = '0.0.23'.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.20
4
+ version: 0.0.23
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-08-29 00:00:00.000000000 Z
11
+ date: 2022-08-31 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: backtrace