githubstats 3.1.0 → 3.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/build.yml +46 -0
- data/.rubocop.yml +0 -3
- data/CHANGELOG.md +8 -0
- data/LICENSE +1 -1
- data/README.md +1 -2
- data/githubstats.gemspec +6 -11
- data/lib/githubstats/data.rb +6 -8
- data/lib/githubstats/version.rb +1 -1
- data/lib/githubstats.rb +4 -3
- data/spec/spec_helper.rb +0 -9
- metadata +17 -98
- data/.prospectus +0 -11
- data/.travis.yml +0 -10
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 92f3eb1f61af9163e2b683c942b25f08def1fda5abe252e6c62b87fc54678e88
|
4
|
+
data.tar.gz: 42b058fbc533b8da30ee503ef749379a9ea2d99beff3c8ea02334c1bc89f06d1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 88ffca14f54e80e5293385b4215876ea3daf6cb0675b3c7de35377cf0b766bbb7f0a248021c569a6aaa9b1ffe5b3a12aa06521886fe7882d919b5ccb3deda464
|
7
|
+
data.tar.gz: 67b31d0fd88a57f8874621fb5edc50faa600a996a5985c9348586b7ecc6b9f83fab42621044a581a5a40e884586fbd3e1625f273273f48a34d9ef9654dbe1a59
|
@@ -0,0 +1,46 @@
|
|
1
|
+
name: Build
|
2
|
+
on:
|
3
|
+
pull_request:
|
4
|
+
push:
|
5
|
+
jobs:
|
6
|
+
build:
|
7
|
+
name: Build
|
8
|
+
runs-on: ubuntu-22.04
|
9
|
+
permissions:
|
10
|
+
contents: write
|
11
|
+
steps:
|
12
|
+
- name: Checkout
|
13
|
+
uses: actions/checkout@v3
|
14
|
+
with:
|
15
|
+
submodules: recursive
|
16
|
+
- uses: ruby/setup-ruby@v1
|
17
|
+
with:
|
18
|
+
ruby-version: '3.1'
|
19
|
+
bundler-cache: true
|
20
|
+
- name: Build
|
21
|
+
run: bundle exec rake
|
22
|
+
- name: Release
|
23
|
+
if: github.ref_type == 'tag'
|
24
|
+
run: bundle exec rake release
|
25
|
+
env:
|
26
|
+
GEM_HOST_API_KEY: ${{ secrets.GEM_HOST_API_KEY }}
|
27
|
+
- name: Post to a Slack channel
|
28
|
+
if: ${{ failure() }}
|
29
|
+
uses: slackapi/slack-github-action@v1.23.0
|
30
|
+
env:
|
31
|
+
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
|
32
|
+
SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK
|
33
|
+
with:
|
34
|
+
payload: |
|
35
|
+
{
|
36
|
+
"text": "*${{ github.repository }}*\nBuild failed: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}",
|
37
|
+
"blocks": [
|
38
|
+
{
|
39
|
+
"type": "section",
|
40
|
+
"text": {
|
41
|
+
"type": "mrkdwn",
|
42
|
+
"text": "*${{ github.repository }}*\nBuild failed: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"
|
43
|
+
}
|
44
|
+
}
|
45
|
+
]
|
46
|
+
}
|
data/.rubocop.yml
CHANGED
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,11 @@
|
|
1
|
+
# 3.3.0 / 2023-01-08
|
2
|
+
|
3
|
+
* [BUGFIX] Update to handle changes to GitHub contribution chart SVG naming
|
4
|
+
|
5
|
+
# 3.2.0 / 2021-02-06
|
6
|
+
|
7
|
+
* [BUGFIX] Update to handle GitHub changes to contribution data CSS
|
8
|
+
|
1
9
|
# 3.1.0 / 2020-10-06
|
2
10
|
|
3
11
|
* [FEATURE] Remove curb dependency, which allows githubstats to work on Windows systems. Thanks @ajmeese7!
|
data/LICENSE
CHANGED
data/README.md
CHANGED
@@ -2,8 +2,7 @@ GithubStats
|
|
2
2
|
=========
|
3
3
|
|
4
4
|
[![Gem Version](https://img.shields.io/gem/v/githubstats.svg)](https://rubygems.org/gems/githubstats)
|
5
|
-
[![
|
6
|
-
[![Coverage Status](https://img.shields.io/codecov/c/github/akerl/githubstats.svg)](https://codecov.io/github/akerl/githubstats)
|
5
|
+
[![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/akerl/githubstats/build.yml?branch=main)](https://github.com/akerl/githubstats/actions)
|
7
6
|
[![MIT Licensed](https://img.shields.io/badge/license-MIT-green.svg)](https://tldrlegal.com/license/mit-license)
|
8
7
|
|
9
8
|
Grabs Github contribution statistics and presents it in an easily consumable format.
|
data/githubstats.gemspec
CHANGED
@@ -5,27 +5,22 @@ require 'githubstats/version'
|
|
5
5
|
Gem::Specification.new do |s|
|
6
6
|
s.name = 'githubstats'
|
7
7
|
s.version = GithubStats::VERSION
|
8
|
-
s.
|
8
|
+
s.required_ruby_version = '>= 2.6.0'
|
9
9
|
|
10
10
|
s.summary = 'Present Github contributions stats in a consumable format'
|
11
|
-
s.description = 'Pulls the statistics from Github\'s user contribution chart and provides an interface for analyzing that data' # rubocop:disable
|
11
|
+
s.description = 'Pulls the statistics from Github\'s user contribution chart and provides an interface for analyzing that data' # rubocop:disable Layout/LineLength
|
12
12
|
s.authors = ['Les Aker']
|
13
13
|
s.email = 'me@lesaker.org'
|
14
14
|
s.homepage = 'https://github.com/akerl/githubstats'
|
15
15
|
s.license = 'MIT'
|
16
16
|
|
17
17
|
s.files = `git ls-files`.split
|
18
|
-
s.test_files = `git ls-files spec/*`.split
|
19
18
|
s.executables = ['githubstats']
|
20
19
|
|
21
20
|
s.add_runtime_dependency 'basiccache', '~> 1.0.0'
|
22
|
-
s.add_runtime_dependency 'nokogiri', '~> 1.10
|
21
|
+
s.add_runtime_dependency 'nokogiri', '~> 1.13.10'
|
23
22
|
|
24
|
-
s.add_development_dependency '
|
25
|
-
s.add_development_dependency '
|
26
|
-
s.
|
27
|
-
s.add_development_dependency 'rake', '~> 13.0.0'
|
28
|
-
s.add_development_dependency 'rspec', '~> 3.9.0'
|
29
|
-
s.add_development_dependency 'rubocop', '~> 0.76.0'
|
30
|
-
s.add_development_dependency 'timecop', '~> 0.9.0'
|
23
|
+
s.add_development_dependency 'goodcop', '~> 0.9.7'
|
24
|
+
s.add_development_dependency 'timecop', '~> 0.9.6'
|
25
|
+
s.metadata['rubygems_mfa_required'] = 'true'
|
31
26
|
end
|
data/lib/githubstats/data.rb
CHANGED
@@ -120,7 +120,7 @@ module GithubStats
|
|
120
120
|
# The mean score
|
121
121
|
|
122
122
|
def mean
|
123
|
-
scores.
|
123
|
+
scores.sum / @raw.size.to_f
|
124
124
|
end
|
125
125
|
|
126
126
|
##
|
@@ -128,7 +128,7 @@ module GithubStats
|
|
128
128
|
|
129
129
|
def std_var
|
130
130
|
first_pass = @raw.reduce(0) do |acc, elem|
|
131
|
-
(elem.score.to_f - mean)**2 + acc
|
131
|
+
((elem.score.to_f - mean)**2) + acc
|
132
132
|
end
|
133
133
|
Math.sqrt(first_pass / (@raw.size - 1))
|
134
134
|
end
|
@@ -159,11 +159,11 @@ module GithubStats
|
|
159
159
|
range = (1..top).to_a
|
160
160
|
range = [0] * 3 if range.empty?
|
161
161
|
mids = (1..3).map do |q|
|
162
|
-
index = q * range.size / 4 - 1
|
162
|
+
index = (q * range.size / 4) - 1
|
163
163
|
range[index]
|
164
164
|
end
|
165
165
|
bounds = (mids + [max.score]).uniq.sort
|
166
|
-
[0] * (5 - bounds.size) + bounds
|
166
|
+
([0] * (5 - bounds.size)) + bounds
|
167
167
|
end
|
168
168
|
|
169
169
|
##
|
@@ -195,11 +195,9 @@ module GithubStats
|
|
195
195
|
private
|
196
196
|
|
197
197
|
def _pad(data, index, fill_value, goal)
|
198
|
-
mod = index * -2 - 1 # 0 index moves -1 in time, -1 move +1 in time
|
198
|
+
mod = (index * -2) - 1 # 0 index moves -1 in time, -1 move +1 in time
|
199
199
|
point = GithubStats::Datapoint
|
200
|
-
until data[index].date.wday == goal
|
201
|
-
data.insert index, point.new(data[index].date + mod, fill_value)
|
202
|
-
end
|
200
|
+
data.insert index, point.new(data[index].date + mod, fill_value) until data[index].date.wday == goal
|
203
201
|
data
|
204
202
|
end
|
205
203
|
end
|
data/lib/githubstats/version.rb
CHANGED
data/lib/githubstats.rb
CHANGED
@@ -108,7 +108,7 @@ module GithubStats
|
|
108
108
|
|
109
109
|
def guess_user(names = [])
|
110
110
|
names << Rugged::Config.global['github.user'] if USE_RUGGED
|
111
|
-
names << ENV
|
111
|
+
names << ENV.fetch('USER', nil)
|
112
112
|
names.find { |name| name } || (raise 'Failed to guess username')
|
113
113
|
end
|
114
114
|
|
@@ -143,8 +143,9 @@ module GithubStats
|
|
143
143
|
def download(to_date = nil)
|
144
144
|
resp = request(to_date)
|
145
145
|
html = Nokogiri::HTML(resp)
|
146
|
-
html.
|
147
|
-
|
146
|
+
svg = html.at_css('svg.js-calendar-graph-svg')
|
147
|
+
svg.css('.ContributionCalendar-day').map do |x|
|
148
|
+
x.attributes.values_at('data-date', 'data-level').map(&:value)
|
148
149
|
end
|
149
150
|
end
|
150
151
|
|
data/spec/spec_helper.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: githubstats
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.
|
4
|
+
version: 3.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Les Aker
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2023-01-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: basiccache
|
@@ -30,112 +30,42 @@ dependencies:
|
|
30
30
|
requirements:
|
31
31
|
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: 1.10
|
33
|
+
version: 1.13.10
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: 1.10
|
41
|
-
- !ruby/object:Gem::Dependency
|
42
|
-
name: codecov
|
43
|
-
requirement: !ruby/object:Gem::Requirement
|
44
|
-
requirements:
|
45
|
-
- - "~>"
|
46
|
-
- !ruby/object:Gem::Version
|
47
|
-
version: 0.1.1
|
48
|
-
type: :development
|
49
|
-
prerelease: false
|
50
|
-
version_requirements: !ruby/object:Gem::Requirement
|
51
|
-
requirements:
|
52
|
-
- - "~>"
|
53
|
-
- !ruby/object:Gem::Version
|
54
|
-
version: 0.1.1
|
55
|
-
- !ruby/object:Gem::Dependency
|
56
|
-
name: fuubar
|
57
|
-
requirement: !ruby/object:Gem::Requirement
|
58
|
-
requirements:
|
59
|
-
- - "~>"
|
60
|
-
- !ruby/object:Gem::Version
|
61
|
-
version: 2.5.0
|
62
|
-
type: :development
|
63
|
-
prerelease: false
|
64
|
-
version_requirements: !ruby/object:Gem::Requirement
|
65
|
-
requirements:
|
66
|
-
- - "~>"
|
67
|
-
- !ruby/object:Gem::Version
|
68
|
-
version: 2.5.0
|
40
|
+
version: 1.13.10
|
69
41
|
- !ruby/object:Gem::Dependency
|
70
42
|
name: goodcop
|
71
43
|
requirement: !ruby/object:Gem::Requirement
|
72
44
|
requirements:
|
73
45
|
- - "~>"
|
74
46
|
- !ruby/object:Gem::Version
|
75
|
-
version: 0.
|
47
|
+
version: 0.9.7
|
76
48
|
type: :development
|
77
49
|
prerelease: false
|
78
50
|
version_requirements: !ruby/object:Gem::Requirement
|
79
51
|
requirements:
|
80
52
|
- - "~>"
|
81
53
|
- !ruby/object:Gem::Version
|
82
|
-
version: 0.
|
83
|
-
- !ruby/object:Gem::Dependency
|
84
|
-
name: rake
|
85
|
-
requirement: !ruby/object:Gem::Requirement
|
86
|
-
requirements:
|
87
|
-
- - "~>"
|
88
|
-
- !ruby/object:Gem::Version
|
89
|
-
version: 13.0.0
|
90
|
-
type: :development
|
91
|
-
prerelease: false
|
92
|
-
version_requirements: !ruby/object:Gem::Requirement
|
93
|
-
requirements:
|
94
|
-
- - "~>"
|
95
|
-
- !ruby/object:Gem::Version
|
96
|
-
version: 13.0.0
|
97
|
-
- !ruby/object:Gem::Dependency
|
98
|
-
name: rspec
|
99
|
-
requirement: !ruby/object:Gem::Requirement
|
100
|
-
requirements:
|
101
|
-
- - "~>"
|
102
|
-
- !ruby/object:Gem::Version
|
103
|
-
version: 3.9.0
|
104
|
-
type: :development
|
105
|
-
prerelease: false
|
106
|
-
version_requirements: !ruby/object:Gem::Requirement
|
107
|
-
requirements:
|
108
|
-
- - "~>"
|
109
|
-
- !ruby/object:Gem::Version
|
110
|
-
version: 3.9.0
|
111
|
-
- !ruby/object:Gem::Dependency
|
112
|
-
name: rubocop
|
113
|
-
requirement: !ruby/object:Gem::Requirement
|
114
|
-
requirements:
|
115
|
-
- - "~>"
|
116
|
-
- !ruby/object:Gem::Version
|
117
|
-
version: 0.76.0
|
118
|
-
type: :development
|
119
|
-
prerelease: false
|
120
|
-
version_requirements: !ruby/object:Gem::Requirement
|
121
|
-
requirements:
|
122
|
-
- - "~>"
|
123
|
-
- !ruby/object:Gem::Version
|
124
|
-
version: 0.76.0
|
54
|
+
version: 0.9.7
|
125
55
|
- !ruby/object:Gem::Dependency
|
126
56
|
name: timecop
|
127
57
|
requirement: !ruby/object:Gem::Requirement
|
128
58
|
requirements:
|
129
59
|
- - "~>"
|
130
60
|
- !ruby/object:Gem::Version
|
131
|
-
version: 0.9.
|
61
|
+
version: 0.9.6
|
132
62
|
type: :development
|
133
63
|
prerelease: false
|
134
64
|
version_requirements: !ruby/object:Gem::Requirement
|
135
65
|
requirements:
|
136
66
|
- - "~>"
|
137
67
|
- !ruby/object:Gem::Version
|
138
|
-
version: 0.9.
|
68
|
+
version: 0.9.6
|
139
69
|
description: Pulls the statistics from Github's user contribution chart and provides
|
140
70
|
an interface for analyzing that data
|
141
71
|
email: me@lesaker.org
|
@@ -145,11 +75,10 @@ extensions: []
|
|
145
75
|
extra_rdoc_files: []
|
146
76
|
files:
|
147
77
|
- ".circle-ruby"
|
78
|
+
- ".github/workflows/build.yml"
|
148
79
|
- ".gitignore"
|
149
|
-
- ".prospectus"
|
150
80
|
- ".rspec"
|
151
81
|
- ".rubocop.yml"
|
152
|
-
- ".travis.yml"
|
153
82
|
- CHANGELOG.md
|
154
83
|
- Gemfile
|
155
84
|
- LICENSE
|
@@ -174,8 +103,9 @@ files:
|
|
174
103
|
homepage: https://github.com/akerl/githubstats
|
175
104
|
licenses:
|
176
105
|
- MIT
|
177
|
-
metadata:
|
178
|
-
|
106
|
+
metadata:
|
107
|
+
rubygems_mfa_required: 'true'
|
108
|
+
post_install_message:
|
179
109
|
rdoc_options: []
|
180
110
|
require_paths:
|
181
111
|
- lib
|
@@ -183,26 +113,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
183
113
|
requirements:
|
184
114
|
- - ">="
|
185
115
|
- !ruby/object:Gem::Version
|
186
|
-
version:
|
116
|
+
version: 2.6.0
|
187
117
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
188
118
|
requirements:
|
189
119
|
- - ">="
|
190
120
|
- !ruby/object:Gem::Version
|
191
121
|
version: '0'
|
192
122
|
requirements: []
|
193
|
-
rubygems_version: 3.
|
194
|
-
signing_key:
|
123
|
+
rubygems_version: 3.3.26
|
124
|
+
signing_key:
|
195
125
|
specification_version: 4
|
196
126
|
summary: Present Github contributions stats in a consumable format
|
197
|
-
test_files:
|
198
|
-
- spec/examples/akerl.user
|
199
|
-
- spec/examples/fly.user
|
200
|
-
- spec/examples/laker.user
|
201
|
-
- spec/examples/leematos.user
|
202
|
-
- spec/examples/lmatos.user
|
203
|
-
- spec/examples/mikegrb.user
|
204
|
-
- spec/examples/results
|
205
|
-
- spec/examples/torvalds.user
|
206
|
-
- spec/githubstats/data_spec.rb
|
207
|
-
- spec/githubstats_spec.rb
|
208
|
-
- spec/spec_helper.rb
|
127
|
+
test_files: []
|
data/.prospectus
DELETED
data/.travis.yml
DELETED
@@ -1,10 +0,0 @@
|
|
1
|
-
dist: xenial
|
2
|
-
install:
|
3
|
-
- for i in $(cat .circle-ruby) ; do rvm install $i || exit 1 ; done
|
4
|
-
- for i in $(cat .circle-ruby) ; do rvm-exec $i bundle install || exit 1 ; done
|
5
|
-
script:
|
6
|
-
- for i in $(cat .circle-ruby) ; do rvm-exec $i bundle exec rake || exit 1 ; done
|
7
|
-
notifications:
|
8
|
-
email: false
|
9
|
-
slack:
|
10
|
-
secure: PQOCIfuacnmF9MMGmZseYwGn8HfxmL1m7qqftoWhDkkp8oKLKVaSfoMPGAADWQsWLBl4JQC+z/lRH8I2gXChQjZhKZBz15bFH6mwFBI82DXidVNVxt27g/uR3RMT8GfGw8CkgW8DsSpNF+E4pBPOKONFLhj9Y0xdpAID7slrPwd6wDdpi4oDXvnfTO4ZfUZbB3OGT0nnzcH4gCiKXKijv4MRzHTVpvbwe+P3TOKkTY0V21B++YSBpX1tIYt6cLOHaDFQT4DScwFajtvynpwWf3PCRMCATganpyEqEpkiUp+dSg1h2WjYilAwVHkLnNaESUFKeTLQGIXpKMj4+3yHlIPPG6M2MawgwhSDuYy1IAE/81+Y06V9Sn9PPnICsjV1+W0LxnCms13t1JcVWrzVOtlzyCInKr8ENAX6Ku6SSQaouuqYghm1maG8ZtNhqyByqGctov7noLUH6T+lHS8ODr22cLg6f0lzVn5d13/aha9OvTZV7DN6uVCfwpbAL9S+u1TNtjrDhJQFohSe7X+jb+KxN7sLZR5Z5RKwM8sx6Tadf3rrvVRF5+jQxpb2IgjakV2QgxmVDrZDu3XXWbRUYMlGbmR4EEwDaKPJsjKh8KIu6GS6rhrQHiwvwDH6FQcXdeQsieLaVTBoKnE1slYvRMVTMZxFkAbI2dIt+H06c7c=
|