cobench 0.0.11 → 0.0.12
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/cobench +6 -2
- data/lib/cobench/metrics/commits.rb +10 -0
- data/lib/cobench/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1a879b4cc5dd8f07f65060329407a6d7fd5892f79eb3bcdf79e5e5c6efd9af84
|
4
|
+
data.tar.gz: '058b53022f131002e0ea77729765496da7d852fc7ef117b6b93530a73ad209da'
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fa959471fd51971a38acc61a25eb5007d622905be18eee168b4d71a56aa3c6246672f95d70d099860d09ab6fc4fb2e51e8d9c3639f20bffc33da44b9752dcc66
|
7
|
+
data.tar.gz: ea804c169413c276554397f4a79742b1c718b42c385d7911aa7561195100f1e8a3a15fa4f7de1ac172ca4801067690ae3cbda612dcf7b6fa709f189cc4c95c3e
|
data/bin/cobench
CHANGED
@@ -110,13 +110,17 @@ begin
|
|
110
110
|
if opts.dry?
|
111
111
|
measures = [
|
112
112
|
{ title: 'Issues', total: Random.new.rand(100), href: 'https://github.com/' },
|
113
|
-
{ title: 'Pulls', total: Random.new.rand(100), href: '
|
113
|
+
{ title: 'Pulls', total: Random.new.rand(100), href: '' },
|
114
|
+
{ title: 'HoC', total: Random.new.rand(100), href: '' },
|
115
|
+
{ title: 'HoC', total: Random.new.rand(100), href: '' }
|
114
116
|
]
|
115
117
|
else
|
116
118
|
measures = m.take(loog)
|
117
119
|
end
|
118
120
|
measures.each do |d|
|
119
|
-
|
121
|
+
before = 0
|
122
|
+
before += data[u][d[:title]][:total] if data[u][d[:title]] != nil
|
123
|
+
data[u][d[:title]] = { total: d[:total] + before, href: d[:href] }
|
120
124
|
titles[d[:title]] = d[:title]
|
121
125
|
loog.info("The value of #{u}/#{d[:title]} is #{d[:total]}")
|
122
126
|
end
|
@@ -37,17 +37,27 @@ class Cobench::Commits
|
|
37
37
|
q = "author:#{@user} author-date:>#{from}"
|
38
38
|
json = @api.search_commits(q)
|
39
39
|
loog.debug("Found #{json.total_count} commits")
|
40
|
+
hoc = 0
|
40
41
|
total = json.items.count do |c|
|
41
42
|
sha = c.sha
|
42
43
|
repo = c.repository.full_name
|
43
44
|
next unless Cobench::Match.new(@opts, loog).matches?(repo)
|
44
45
|
loog.debug("Including #{sha} in #{repo}")
|
46
|
+
json = @api.commit(repo, sha)
|
47
|
+
hocs = json.stats.total
|
48
|
+
loog.debug("Found #{hocs} HoC in #{sha}")
|
49
|
+
hoc += hocs
|
45
50
|
end
|
46
51
|
[
|
47
52
|
{
|
48
53
|
title: 'Commits',
|
49
54
|
total: total,
|
50
55
|
href: Iri.new('https://github.com/search').add(q: q)
|
56
|
+
},
|
57
|
+
{
|
58
|
+
title: 'HoC',
|
59
|
+
total: hoc,
|
60
|
+
href: ''
|
51
61
|
}
|
52
62
|
]
|
53
63
|
end
|
data/lib/cobench/version.rb
CHANGED