cobench 0.0.21 → 0.0.22

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: 6117bbba07444b2da4210d173981f6199005ac182482fca43aa36c04d919ef1b
4
- data.tar.gz: 38172dfd6d7cb9cb8604d051ca0cf82b53aebb89c604edf23ac1bcb12a6c5c86
3
+ metadata.gz: 2ce5d4cd4b43c34d71d56b620f57447c720e5dff7bc282876d73584e8716b458
4
+ data.tar.gz: 70fa1c91c2c998c04c4789e5ba8162779c10b80abe3f9518f3638e90822b6bbb
5
5
  SHA512:
6
- metadata.gz: f37e7867a1359bc99291f7607ec43f3c7ced2039fb46e2cefd8b50a2a3c1aeabaef18ac095a1579cc3a1e265a5132809a567504782211f593a1b79a72d8415e4
7
- data.tar.gz: 36115b07683f34eed5ea446a455ec4ab7b8b18bd70bf27e860c281d4711ebcdf5b9221d7730da3a3b80355328585c316c1599162619d585dd9652f19d1bd5bf4
6
+ metadata.gz: b849b0d6e71364f0aaeede0698382d4d4dd777013d2193d068cda6a2778a7457568c59c480e1e424ad8437c0106956a534d34bb196207513bb4f58b01706a3e4
7
+ data.tar.gz: 3b45652f5bb5104a0fbbbd4ba68e966184b0593f711febc21b394e1033fe4760c6793b0bfc14bcabc798908f7e97e3f22fa51d06e13da81a7ef7fabc94aaf247
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,13 +197,13 @@ 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>
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.21'.freeze
26
+ VERSION = '0.0.22'.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.21
4
+ version: 0.0.22
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-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: backtrace