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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 106c637350232c212145a1a648680688634f9b44f488fbe660f2003666faba23
4
- data.tar.gz: eaff88cb6edbc88d3d5616df41d1344c38380b38aca26b642987420f73805a93
3
+ metadata.gz: 1a879b4cc5dd8f07f65060329407a6d7fd5892f79eb3bcdf79e5e5c6efd9af84
4
+ data.tar.gz: '058b53022f131002e0ea77729765496da7d852fc7ef117b6b93530a73ad209da'
5
5
  SHA512:
6
- metadata.gz: 73f87f462a82919c5d435237276952a5b94be9397a053b68c17ad636e50e0b5c71dbe54b6d3118a19600e6eaf9bbd5d113e350ebf5c1330e635f5b38fd49e3b3
7
- data.tar.gz: fd592b9422b5f48802723027eabcc93ba5a7a23d9f2eedf17d0cd184acf014a7668c1464e3821750a650da4771c81b9b936cdaf02a2fa9c3e43b7ab0ccc988dd
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: 'https://github.com/' }
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
- data[u][d[:title]] = { total: d[:total], href: d[:href] }
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
@@ -23,5 +23,5 @@
23
23
  # Copyright:: Copyright (c) 2022 Yegor Bugayenko
24
24
  # License:: MIT
25
25
  module Cobench
26
- VERSION = '0.0.11'.freeze
26
+ VERSION = '0.0.12'.freeze
27
27
  end
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.11
4
+ version: 0.0.12
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yegor Bugayenko