bin/cobench in cobench-0.0.21 vs bin/cobench in cobench-0.0.22
- old
+ new
@@ -134,26 +134,26 @@
end
data[u] = ms
end
weights = {
'HoC' => 1,
- 'Pulls' => 200,
+ 'Pulls' => 250,
'Issues' => 50,
'Commits' => 5,
- 'Reviews' => 75
+ 'Reviews' => 150
}
data.each do |u, ms|
score = ms.map do |t, h|
raise "Unknown title '#{t}'" unless weights.key?(t)
h[:total] * weights[t]
end.inject(0, :+)
- data[u]['Score'] = { total: score, href: '' }
+ data[u]['Score'] = { total: score }
end
builder = Nokogiri::XML::Builder.new(:encoding => 'UTF-8') do |xml|
xml.cobench(time: Time.now, days: opts[:days]) do
xml.titles do
- data.map { |_, ms| ms.keys }.flatten.each do |t|
+ data.map { |_, ms| ms.keys }.flatten.uniq.each do |t|
xml.title t
end
end
xml.weights do
weights.each do |t, w|
@@ -163,13 +163,13 @@
end
end
xml.coders do
data.each do |u, ms|
xml.coder(id: u) do
- xml.parent.set_attribute('details', api.user(u).name)
+ xml.parent.set_attribute('details', api.user(u).name) unless opts[:dry]
xml.metrics do
ms.each do |k, v|
- xml.m(id: k, href: v[:href]) do
+ xml.m(id: k) do
xml.parent.set_attribute('actual', v[:actual]) unless v[:actual].nil?
xml.parent.set_attribute('href', v[:href]) unless v[:href].nil?
xml.text v[:total]
end
end