cobench 0.0.4 → 0.0.7

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: 03f64d2bab112d3e2663ce29f626720973a29b8441004e786e2f8f99c641d7ce
4
- data.tar.gz: 5174681a991740e8502d65b5c5ae25b1f8371390e0ce0eb381968f6424a8616e
3
+ metadata.gz: f373391e22ba904b48c65b3bbfcf7ca8ba7c8449809f3f61b94d21bc2d03ef56
4
+ data.tar.gz: 49fab0a0e00dfc5c1638bc2a4e1c34e3fdcf44bfe266e5bc2cd83d81f1806957
5
5
  SHA512:
6
- metadata.gz: 1e685a2a0d1a9a58a06976ebb2df9bbf0a29a5e93a06c1b057f64b4b067c7a4a2d73b9fa9d8cdef6246ee829efbcc70fafc7febc5177e6e12cd04a5b5ea89d0b
7
- data.tar.gz: 51b84eb3a9436a79836a580c1579cb49cebc01062ab305fabe30c261ff0ca28324f26b84df3c39fc33859e3fb7f2f2eac8e20693fcfac379facd27d669adbbe4
6
+ metadata.gz: 17b292e42c40fcd80af4106dda44718916a639a692cf9aa178b9025a639aeebd5fae6ac91778c7860f430e42785575e7fe7e462cd118df867779f069eea0d089
7
+ data.tar.gz: ee3e364fd9fb37bac07085e2d26f3b0f5291cb9666ed07a08167e3000df841f9269605ef704affa1243fb9f310efefd3694c812501b882436f6a5d20fd6f9162
data/assets/index.xsl CHANGED
@@ -23,7 +23,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
23
23
  SOFTWARE.
24
24
  -->
25
25
  <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0">
26
- <xsl:output encoding="UTF-8" method="xml"/>
26
+ <xsl:output encoding="UTF-8" method="html"/>
27
27
  <xsl:key name="metrics" match="/cobench/coders/coder/metrics/m" use="@id"/>
28
28
  <xsl:template match="/">
29
29
  <html>
@@ -35,15 +35,16 @@ SOFTWARE.
35
35
  <link rel="icon" href="https://raw.githubusercontent.com/yegor256/cobench/master/logo.svg" type="image/svg"/>
36
36
  <link href="https://cdn.jsdelivr.net/gh/yegor256/tacit@gh-pages/tacit-css.min.css" rel="stylesheet"/>
37
37
  <link href="https://cdn.jsdelivr.net/gh/yegor256/drops@gh-pages/drops.min.css" rel="stylesheet"/>
38
- <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.6.0/jquery.min.js"></script>
39
- <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/jquery.tablesorter/2.31.3/js/jquery.tablesorter.min.js"></script>
38
+ <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.6.0/jquery.min.js"/>
39
+ <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/jquery.tablesorter/2.31.3/js/jquery.tablesorter.min.js"/>
40
40
  <script type="text/javascript">
41
41
  $(function() {
42
42
  $("#metrics").tablesorter();
43
43
  });
44
44
  </script>
45
45
  <style>
46
- td, th { text-align: right; font-family: monospace; font-size: 18px; }
46
+ td, th { font-family: monospace; font-size: 18px; }
47
+ .num { text-align: right; }
47
48
  .left { border-bottom: 0; }
48
49
  header { text-align: center; }
49
50
  footer { text-align: center; font-size: 0.8em; }
@@ -90,7 +91,7 @@ SOFTWARE.
90
91
  <tr>
91
92
  <th/>
92
93
  <xsl:for-each select="coder/metrics/m[generate-id() = generate-id(key('metrics', @id)[1])]">
93
- <th class="sorter">
94
+ <th class="sorter num">
94
95
  <xsl:value-of select="@id"/>
95
96
  </th>
96
97
  </xsl:for-each>
@@ -113,7 +114,7 @@ SOFTWARE.
113
114
  </tr>
114
115
  </xsl:template>
115
116
  <xsl:template match="m">
116
- <td>
117
+ <td class="num">
117
118
  <a href="{@href}">
118
119
  <xsl:value-of select="."/>
119
120
  </a>
data/bin/cobench CHANGED
@@ -27,6 +27,7 @@ require 'octokit'
27
27
  require 'nokogiri'
28
28
  require 'backtrace'
29
29
  require 'fileutils'
30
+ require 'obk'
30
31
  require_relative '../lib/cobench/version'
31
32
 
32
33
  loog = Loog::REGULAR
@@ -89,6 +90,7 @@ begin
89
90
  loog.warn("Connecting to GitHub without a token, this may lead to errors, use --token")
90
91
  end
91
92
  api.auto_paginate = true
93
+ api = Obk.new(api, pause: 2000)
92
94
  opts[:coder].each do |u|
93
95
  loog.info("Scanning #{u}...")
94
96
  data[u] = {}
@@ -99,7 +101,7 @@ begin
99
101
  require_relative f
100
102
  m = type.split('::').reduce(Module, :const_get).new(api, u, opts)
101
103
  if opts.dry?
102
- v, t = [42, 'https://github.com/']
104
+ v, t = [Random.new.rand(100), 'https://github.com/']
103
105
  else
104
106
  v, t = m.take(loog)
105
107
  end
data/cobench.gemspec CHANGED
@@ -44,6 +44,7 @@ Gem::Specification.new do |s|
44
44
  s.add_runtime_dependency 'iri', '~>0.5'
45
45
  s.add_runtime_dependency 'loog', '~>0.2'
46
46
  s.add_runtime_dependency 'nokogiri', '~>1.10'
47
+ s.add_runtime_dependency 'obk', '0.3.0'
47
48
  s.add_runtime_dependency 'octokit', '~>4.0'
48
49
  s.add_runtime_dependency 'rainbow', '~>3.0'
49
50
  s.add_runtime_dependency 'slop', '~>4.4'
@@ -23,5 +23,5 @@
23
23
  # Copyright:: Copyright (c) 2022 Yegor Bugayenko
24
24
  # License:: MIT
25
25
  module Cobench
26
- VERSION = '0.0.4'.freeze
26
+ VERSION = '0.0.7'.freeze
27
27
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cobench
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yegor Bugayenko
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-08-09 00:00:00.000000000 Z
11
+ date: 2022-08-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: backtrace
@@ -66,6 +66,20 @@ dependencies:
66
66
  - - "~>"
67
67
  - !ruby/object:Gem::Version
68
68
  version: '1.10'
69
+ - !ruby/object:Gem::Dependency
70
+ name: obk
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - '='
74
+ - !ruby/object:Gem::Version
75
+ version: 0.3.0
76
+ type: :runtime
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - '='
81
+ - !ruby/object:Gem::Version
82
+ version: 0.3.0
69
83
  - !ruby/object:Gem::Dependency
70
84
  name: octokit
71
85
  requirement: !ruby/object:Gem::Requirement