cobench 0.0.15 → 0.0.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/assets/index.xsl +2 -0
- data/bin/cobench +2 -0
- data/lib/cobench/metrics/pulls.rb +1 -1
- data/lib/cobench/metrics/reviews.rb +54 -0
- data/lib/cobench/version.rb +1 -1
- metadata +2 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 48f017fb5f4994354ad835b809870f6c804bf3350cd22b443e29f2dfda0f1276
|
4
|
+
data.tar.gz: a57ba22b48e7760415921e4c80fb52c407e95ad84c1c3d5da4e1b2de76538f5e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 845946fc2dfb68de3ef780a35b2063311e38104f337a235067f88d2ab00bf3b309e30025e1bb3dd2091ca2d43af80e18a8332258f6085dedf96f9f3de39889ef
|
7
|
+
data.tar.gz: 9133dcf17b4d1ca286e70c46b122dfd458c6bce44f1f247bae74a4b5b7604db34c90a74493eb5ac49a05fa74626c5ab5ee14f09751d23ec5143052122173b5e6
|
data/assets/index.xsl
CHANGED
@@ -97,9 +97,11 @@ SOFTWARE.
|
|
97
97
|
<xsl:text>pull requests</xsl:text>
|
98
98
|
</a>
|
99
99
|
<xsl:text> created by the user and merged. </xsl:text>
|
100
|
+
<xsl:text>"Reviews" is the total number of merged pull requests reviewed by the user. </xsl:text>
|
100
101
|
<xsl:text>"Score" is an arithmetic summary of all other numbers with multipliers: </xsl:text>
|
101
102
|
<xsl:text>one Pull costs 100 points, </xsl:text>
|
102
103
|
<xsl:text>one Issue 50 points, </xsl:text>
|
104
|
+
<xsl:text>one Review 40 points, </xsl:text>
|
103
105
|
<xsl:text>one Commit 5 points, </xsl:text>
|
104
106
|
<xsl:text>one HoC 1 point.</xsl:text>
|
105
107
|
</p>
|
data/bin/cobench
CHANGED
@@ -34,7 +34,7 @@ class Cobench::Pulls
|
|
34
34
|
|
35
35
|
def take(loog)
|
36
36
|
from = (Time.now - (60 * 60 * 24 * @opts[:days])).strftime('%Y-%m-%d')
|
37
|
-
q = "in:comments type:pr author:#{@user} is:merged
|
37
|
+
q = "in:comments type:pr author:#{@user} is:merged merged:>#{from}"
|
38
38
|
json = @api.search_issues(q)
|
39
39
|
loog.debug("Found #{json.total_count} pull requests")
|
40
40
|
hoc = 0
|
@@ -0,0 +1,54 @@
|
|
1
|
+
# Copyright (c) 2022 Yegor Bugayenko
|
2
|
+
#
|
3
|
+
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
4
|
+
# of this software and associated documentation files (the 'Software'), to deal
|
5
|
+
# in the Software without restriction, including without limitation the rights
|
6
|
+
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
7
|
+
# copies of the Software, and to permit persons to whom the Software is
|
8
|
+
# furnished to do so, subject to the following conditions:
|
9
|
+
#
|
10
|
+
# The above copyright notice and this permission notice shall be included in all
|
11
|
+
# copies or substantial portions of the Software.
|
12
|
+
#
|
13
|
+
# THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
14
|
+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
15
|
+
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFINGEMENT. IN NO EVENT SHALL THE
|
16
|
+
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
17
|
+
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
18
|
+
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
19
|
+
# SOFTWARE.
|
20
|
+
|
21
|
+
require 'iri'
|
22
|
+
require_relative '../match'
|
23
|
+
|
24
|
+
# Reviews in GitHub API.
|
25
|
+
# Author:: Yegor Bugayenko (yegor256@gmail.com)
|
26
|
+
# Copyright:: Copyright (c) 2022 Yegor Bugayenko
|
27
|
+
# License:: MIT
|
28
|
+
class Cobench::Reviews
|
29
|
+
def initialize(api, user, opts)
|
30
|
+
@api = api
|
31
|
+
@user = user
|
32
|
+
@opts = opts
|
33
|
+
end
|
34
|
+
|
35
|
+
def take(loog)
|
36
|
+
from = (Time.now - (60 * 60 * 24 * @opts[:days])).strftime('%Y-%m-%d')
|
37
|
+
q = "reviewed-by:#{@user} merged:>#{from}"
|
38
|
+
json = @api.search_issues(q)
|
39
|
+
loog.debug("Found #{json.total_count} reviews")
|
40
|
+
total = json.items.count do |p|
|
41
|
+
pr = p.pull_request.url.split('/')[-1]
|
42
|
+
repo = p.repository_url.split('/')[-2..-1].join('/')
|
43
|
+
next unless Cobench::Match.new(@opts, loog).matches?(repo)
|
44
|
+
loog.debug("Including #{repo}##{pr} reviewed by #{@user}")
|
45
|
+
end
|
46
|
+
[
|
47
|
+
{
|
48
|
+
title: 'Reviews',
|
49
|
+
total: total,
|
50
|
+
href: Iri.new('https://github.com/search').add(q: q)
|
51
|
+
}
|
52
|
+
]
|
53
|
+
end
|
54
|
+
end
|
data/lib/cobench/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cobench
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.16
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Yegor Bugayenko
|
@@ -255,6 +255,7 @@ files:
|
|
255
255
|
- lib/cobench/metrics/commits.rb
|
256
256
|
- lib/cobench/metrics/issues.rb
|
257
257
|
- lib/cobench/metrics/pulls.rb
|
258
|
+
- lib/cobench/metrics/reviews.rb
|
258
259
|
- lib/cobench/version.rb
|
259
260
|
- logo.svg
|
260
261
|
- test/test__helper.rb
|