lib/cobench/metrics/pulls.rb in cobench-0.0.30 vs lib/cobench/metrics/pulls.rb in cobench-0.0.31

- old
+ new

@@ -36,19 +36,26 @@ from = (Time.now - (60 * 60 * 24 * @opts[:days])).strftime('%Y-%m-%d') q = "in:comments type:pr author:#{@user} is:merged merged:>#{from}" json = @api.search_issues(q) loog.debug("Found #{json.total_count} pull requests") hoc = 0 + orgs = [] total = json.items.count do |p| pr = p.pull_request.url.split('/')[-1] repo = p.repository_url.split('/')[-2..-1].join('/') next unless Cobench::Match.new(@opts, loog).matches?(repo) + orgs += p.repository_url.split('/')[-2] pr_json = @api.pull_request(repo, pr) hocs = pr_json.additions + pr_json.deletions hoc += hocs loog.debug("Including #{repo}##{pr} with #{hocs}") end [ + { + meta: true, + title: 'Orgs', + list: orgs + }, { title: 'Pulls', total: total, href: Iri.new('https://github.com/search').add(q: q) },