githubchart 3.3.1 → 4.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/exporter.sh +16 -0
- data/.github/workflows/build.yml +37 -0
- data/CHANGELOG.md +8 -0
- data/LICENSE +1 -1
- data/README.md +1 -2
- data/Rakefile +1 -1
- data/githubchart.gemspec +5 -10
- data/lib/githubchart/svg.rb +6 -6
- data/lib/githubchart/version.rb +1 -1
- data/lib/githubchart.rb +1 -1
- data/spec/spec_helper.rb +0 -9
- metadata +23 -69
- data/.circle-ruby +0 -4
- 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: 39a80fbfd70eb439076199998142ec5ac4e8a60494d3a160bcfc67058d200935
|
4
|
+
data.tar.gz: 4108161a4d71634fb48ba98bdb5fb85284224b72cb006874278df8d1e0d120fc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a65c9fed6432216d8c48391e7124558a1dc87c67e343e684300a1d56e351809440261d366ecf6996618eaccec8f116bdfe52ca15eebbafe86c2fdbbb09def2d9
|
7
|
+
data.tar.gz: 012bd1c3a898970100667837e9ee1287314d5bb2ce9166e399776d41533e7d287906b13fa9b2b73f16f73ab8e96ead2e2899ebbd9dc0fde2abaf3350ffaae386
|
data/.github/exporter.sh
ADDED
@@ -0,0 +1,16 @@
|
|
1
|
+
#!/usr/bin/env bash
|
2
|
+
|
3
|
+
set -euo pipefail
|
4
|
+
|
5
|
+
URL="https://exporter.akerl.app/metric"
|
6
|
+
AUTH="Authorization: Bearer $EXPORTER_TOKEN"
|
7
|
+
if [[ "$JOB_STATUS" == "success" ]] ; then
|
8
|
+
VALUE=1
|
9
|
+
else
|
10
|
+
VALUE=0
|
11
|
+
fi
|
12
|
+
BODY="{\"name\":\"gh/${GITHUB_REPOSITORY}\",\"metrics\":[{\"name\":\"ghactions\",\"type\":\"gauge\",\"tags\":{\"repo\":\"${GITHUB_REPOSITORY}\"},\"value\":\"${VALUE}\"}]}"
|
13
|
+
|
14
|
+
echo "$BODY"
|
15
|
+
|
16
|
+
curl -i -XPOST -d "$BODY" -H"$AUTH" "$URL"
|
@@ -0,0 +1,37 @@
|
|
1
|
+
---
|
2
|
+
name: Build
|
3
|
+
'on':
|
4
|
+
push:
|
5
|
+
branches:
|
6
|
+
- main
|
7
|
+
tags:
|
8
|
+
- "**"
|
9
|
+
pull_request_target:
|
10
|
+
jobs:
|
11
|
+
build:
|
12
|
+
name: Build
|
13
|
+
runs-on: ubuntu-22.04
|
14
|
+
permissions:
|
15
|
+
contents: write
|
16
|
+
steps:
|
17
|
+
- name: Checkout
|
18
|
+
uses: actions/checkout@v3
|
19
|
+
with:
|
20
|
+
submodules: recursive
|
21
|
+
- uses: ruby/setup-ruby@v1
|
22
|
+
with:
|
23
|
+
ruby-version: '3.1'
|
24
|
+
bundler-cache: true
|
25
|
+
- name: Build
|
26
|
+
run: bundle exec rake
|
27
|
+
- name: Release
|
28
|
+
if: github.ref_type == 'tag'
|
29
|
+
run: bundle exec rake release
|
30
|
+
env:
|
31
|
+
GEM_HOST_API_KEY: "${{ secrets.GEM_HOST_API_KEY }}"
|
32
|
+
- name: Post to hook-exporter
|
33
|
+
run: "./.github/exporter.sh"
|
34
|
+
env:
|
35
|
+
EXPORTER_TOKEN: "${{ secrets.EXPORTER_TOKEN }}"
|
36
|
+
JOB_STATUS: "${{ job.status }}"
|
37
|
+
if: always() && github.ref == 'refs/heads/main'
|
data/CHANGELOG.md
CHANGED
data/LICENSE
CHANGED
data/README.md
CHANGED
@@ -2,8 +2,7 @@ GithubChart
|
|
2
2
|
============
|
3
3
|
|
4
4
|
[![Gem Version](https://img.shields.io/gem/v/githubchart.svg)](https://rubygems.org/gems/githubchart)
|
5
|
-
[![
|
6
|
-
[![Coverage Status](https://img.shields.io/codecov/c/github/akerl/githubchart.svg)](https://codecov.io/github/akerl/githubchart)
|
5
|
+
[![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/akerl/githubchart/build.yml?branch=main)](https://github.com/akerl/githubchart/actions)
|
7
6
|
[![MIT Licensed](https://img.shields.io/badge/license-MIT-green.svg)](https://tldrlegal.com/license/mit-license)
|
8
7
|
|
9
8
|
Generates an SVG of your Github contributions:
|
data/Rakefile
CHANGED
data/githubchart.gemspec
CHANGED
@@ -5,25 +5,20 @@ require 'githubchart/version'
|
|
5
5
|
Gem::Specification.new do |s|
|
6
6
|
s.name = 'githubchart'
|
7
7
|
s.version = GithubChart::VERSION
|
8
|
-
s.date = Time.now.strftime("%Y-%m-%d")
|
9
8
|
s.summary = 'Generate an SVG of Github contributions data'
|
10
|
-
s.description =
|
9
|
+
s.description = 'Uses GithubStats to grab Github contributions scores and converts that into an SVG'
|
11
10
|
s.authors = ['Les Aker']
|
12
11
|
s.email = 'me@lesaker.org'
|
13
12
|
s.homepage = 'https://github.com/akerl/githubchart'
|
14
13
|
s.license = 'MIT'
|
15
14
|
|
16
15
|
s.files = `git ls-files`.split
|
17
|
-
s.test_files = `git ls-files spec/*`.split
|
18
16
|
s.executables = ['githubchart']
|
19
17
|
|
20
|
-
s.add_runtime_dependency 'githubstats', '~>
|
18
|
+
s.add_runtime_dependency 'githubstats', '~> 4.0.1'
|
19
|
+
s.add_runtime_dependency 'matrix', '~> 0.4.2'
|
21
20
|
s.add_runtime_dependency 'svgplot', '~> 1.0.0'
|
22
21
|
|
23
|
-
s.add_development_dependency 'goodcop', '~> 0.9.
|
24
|
-
s.
|
25
|
-
s.add_development_dependency 'codecov', '~> 0.1.1'
|
26
|
-
s.add_development_dependency 'rspec', '~> 3.9.0'
|
27
|
-
s.add_development_dependency 'fuubar', '~> 2.5.0'
|
22
|
+
s.add_development_dependency 'goodcop', '~> 0.9.7'
|
23
|
+
s.metadata['rubygems_mfa_required'] = 'true'
|
28
24
|
end
|
29
|
-
|
data/lib/githubchart/svg.rb
CHANGED
@@ -20,8 +20,8 @@ module GithubChart
|
|
20
20
|
|
21
21
|
def render_svg
|
22
22
|
grid = matrix
|
23
|
-
chart = SVGPlot.new(width: CUBE_SIZE * grid.column_size + X_PAD,
|
24
|
-
height: CUBE_SIZE * grid.row_size + Y_PAD)
|
23
|
+
chart = SVGPlot.new(width: (CUBE_SIZE * grid.column_size) + X_PAD,
|
24
|
+
height: (CUBE_SIZE * grid.row_size) + Y_PAD)
|
25
25
|
svg_add_points grid, chart
|
26
26
|
svg_add_weekdays chart
|
27
27
|
svg_add_months chart
|
@@ -30,8 +30,8 @@ module GithubChart
|
|
30
30
|
|
31
31
|
def render_svg_square
|
32
32
|
grid = matrix.minor(0, 7, -7, 7)
|
33
|
-
chart = SVGPlot.new(width: CUBE_SIZE * grid.column_size - 2,
|
34
|
-
height: CUBE_SIZE * grid.row_size - 2)
|
33
|
+
chart = SVGPlot.new(width: (CUBE_SIZE * grid.column_size) - 2,
|
34
|
+
height: (CUBE_SIZE * grid.row_size) - 2)
|
35
35
|
svg_add_points grid, chart, 0, 0
|
36
36
|
chart.to_s
|
37
37
|
end
|
@@ -81,7 +81,7 @@ module GithubChart
|
|
81
81
|
style = SVG_WEEKDAY_STYLE.dup
|
82
82
|
style[:display] = 'none' unless [1, 3, 5].include? index
|
83
83
|
shift = index > 3 ? 29 : 28
|
84
|
-
chart.text(0, CUBE_SIZE * index + shift, style: style) { raw letter }
|
84
|
+
chart.text(0, (CUBE_SIZE * index) + shift, style: style) { raw letter }
|
85
85
|
end
|
86
86
|
|
87
87
|
def svg_add_weekdays(chart)
|
@@ -104,7 +104,7 @@ module GithubChart
|
|
104
104
|
offsets.shift if [1, 2].include? offsets[1].last
|
105
105
|
offsets.each do |month, offset|
|
106
106
|
next if offset > 50
|
107
|
-
x = CUBE_SIZE * offset + X_PAD
|
107
|
+
x = (CUBE_SIZE * offset) + X_PAD
|
108
108
|
chart.text(x, 10, style: SVG_MONTH_STYLE) { raw month }
|
109
109
|
end
|
110
110
|
end
|
data/lib/githubchart/version.rb
CHANGED
data/lib/githubchart.rb
CHANGED
@@ -83,7 +83,7 @@ module GithubChart
|
|
83
83
|
|
84
84
|
##
|
85
85
|
# Convert the data into a matrix of weeks
|
86
|
-
# The fill value is used to pad the front and
|
86
|
+
# The fill value is used to pad the front and back
|
87
87
|
|
88
88
|
def matrix(fill_value = -1)
|
89
89
|
Matrix[*@stats.pad(fill_value).each_slice(7).to_a.transpose]
|
data/spec/spec_helper.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: githubchart
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 4.0.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-07-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: githubstats
|
@@ -16,98 +16,56 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version:
|
19
|
+
version: 4.0.1
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version:
|
26
|
+
version: 4.0.1
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
|
-
name:
|
28
|
+
name: matrix
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
31
|
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version:
|
33
|
+
version: 0.4.2
|
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:
|
41
|
-
- !ruby/object:Gem::Dependency
|
42
|
-
name: goodcop
|
43
|
-
requirement: !ruby/object:Gem::Requirement
|
44
|
-
requirements:
|
45
|
-
- - "~>"
|
46
|
-
- !ruby/object:Gem::Version
|
47
|
-
version: 0.9.3
|
48
|
-
type: :development
|
49
|
-
prerelease: false
|
50
|
-
version_requirements: !ruby/object:Gem::Requirement
|
51
|
-
requirements:
|
52
|
-
- - "~>"
|
53
|
-
- !ruby/object:Gem::Version
|
54
|
-
version: 0.9.3
|
40
|
+
version: 0.4.2
|
55
41
|
- !ruby/object:Gem::Dependency
|
56
|
-
name:
|
57
|
-
requirement: !ruby/object:Gem::Requirement
|
58
|
-
requirements:
|
59
|
-
- - "~>"
|
60
|
-
- !ruby/object:Gem::Version
|
61
|
-
version: 13.0.0
|
62
|
-
type: :development
|
63
|
-
prerelease: false
|
64
|
-
version_requirements: !ruby/object:Gem::Requirement
|
65
|
-
requirements:
|
66
|
-
- - "~>"
|
67
|
-
- !ruby/object:Gem::Version
|
68
|
-
version: 13.0.0
|
69
|
-
- !ruby/object:Gem::Dependency
|
70
|
-
name: codecov
|
71
|
-
requirement: !ruby/object:Gem::Requirement
|
72
|
-
requirements:
|
73
|
-
- - "~>"
|
74
|
-
- !ruby/object:Gem::Version
|
75
|
-
version: 0.1.1
|
76
|
-
type: :development
|
77
|
-
prerelease: false
|
78
|
-
version_requirements: !ruby/object:Gem::Requirement
|
79
|
-
requirements:
|
80
|
-
- - "~>"
|
81
|
-
- !ruby/object:Gem::Version
|
82
|
-
version: 0.1.1
|
83
|
-
- !ruby/object:Gem::Dependency
|
84
|
-
name: rspec
|
42
|
+
name: svgplot
|
85
43
|
requirement: !ruby/object:Gem::Requirement
|
86
44
|
requirements:
|
87
45
|
- - "~>"
|
88
46
|
- !ruby/object:Gem::Version
|
89
|
-
version:
|
90
|
-
type: :
|
47
|
+
version: 1.0.0
|
48
|
+
type: :runtime
|
91
49
|
prerelease: false
|
92
50
|
version_requirements: !ruby/object:Gem::Requirement
|
93
51
|
requirements:
|
94
52
|
- - "~>"
|
95
53
|
- !ruby/object:Gem::Version
|
96
|
-
version:
|
54
|
+
version: 1.0.0
|
97
55
|
- !ruby/object:Gem::Dependency
|
98
|
-
name:
|
56
|
+
name: goodcop
|
99
57
|
requirement: !ruby/object:Gem::Requirement
|
100
58
|
requirements:
|
101
59
|
- - "~>"
|
102
60
|
- !ruby/object:Gem::Version
|
103
|
-
version:
|
61
|
+
version: 0.9.7
|
104
62
|
type: :development
|
105
63
|
prerelease: false
|
106
64
|
version_requirements: !ruby/object:Gem::Requirement
|
107
65
|
requirements:
|
108
66
|
- - "~>"
|
109
67
|
- !ruby/object:Gem::Version
|
110
|
-
version:
|
68
|
+
version: 0.9.7
|
111
69
|
description: Uses GithubStats to grab Github contributions scores and converts that
|
112
70
|
into an SVG
|
113
71
|
email: me@lesaker.org
|
@@ -116,12 +74,11 @@ executables:
|
|
116
74
|
extensions: []
|
117
75
|
extra_rdoc_files: []
|
118
76
|
files:
|
119
|
-
- ".
|
77
|
+
- ".github/exporter.sh"
|
78
|
+
- ".github/workflows/build.yml"
|
120
79
|
- ".gitignore"
|
121
|
-
- ".prospectus"
|
122
80
|
- ".rspec"
|
123
81
|
- ".rubocop.yml"
|
124
|
-
- ".travis.yml"
|
125
82
|
- CHANGELOG.md
|
126
83
|
- Gemfile
|
127
84
|
- LICENSE
|
@@ -141,8 +98,9 @@ files:
|
|
141
98
|
homepage: https://github.com/akerl/githubchart
|
142
99
|
licenses:
|
143
100
|
- MIT
|
144
|
-
metadata:
|
145
|
-
|
101
|
+
metadata:
|
102
|
+
rubygems_mfa_required: 'true'
|
103
|
+
post_install_message:
|
146
104
|
rdoc_options: []
|
147
105
|
require_paths:
|
148
106
|
- lib
|
@@ -157,12 +115,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
157
115
|
- !ruby/object:Gem::Version
|
158
116
|
version: '0'
|
159
117
|
requirements: []
|
160
|
-
rubygems_version: 3.
|
161
|
-
signing_key:
|
118
|
+
rubygems_version: 3.3.26
|
119
|
+
signing_key:
|
162
120
|
specification_version: 4
|
163
121
|
summary: Generate an SVG of Github contributions data
|
164
|
-
test_files:
|
165
|
-
- spec/examples/input.json
|
166
|
-
- spec/githubchart/svg_spec.rb
|
167
|
-
- spec/githubchart_spec.rb
|
168
|
-
- spec/spec_helper.rb
|
122
|
+
test_files: []
|
data/.circle-ruby
DELETED
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: XOIlpE54Yq450PGd3VI7atmVplX+WRmz+karIxlC+PEWgEbE3G9lCuIKez8OvJ+bS357KEsyF9k2ZhmaxJvQXKtMgQn6I7zBmjBRPm9xAb/ynFujquGsjW+OMAiP/3elq8DS6yvVYUDWBDgRv6SxHF/rLKliuSh4S8NrnuTyfokoWx4i/dIBQyujU6kmRW+2DIfkSY1wTyyb7Qo9HFH3ekOeJrYg+bK2Sm5HSLK+ATKpJ8nWvLirK8KIsQbCSj+Hkt61yBC+3pst51EUI5CwlHF1qxLy9T/eezY+bnUD/0WwcJX10co6K62+qykvN/4pKqYubfSsnYVmU3sZgk0FfRfBNOaYwai6mbZxxcFn4kIUOYoGTML/NTe7bu9dbtbHAM751x/V/tFM1V4m6xap451WQoommuMIcOuGS/OgzeOkc12VQ0X5nXM0DA20MOZKlMUJR+XlYu6derwIvOEOPlazZq8Ta4LQNrMaqax5IzJVyNsSqXMsEkpXDVSpvkwdXeBMy6X02ozNQOrcefoGGLhAtrnewyJnchDxhIy/aG2TUYx6qMGi/zxGr+yKyev2Op3Qwg8FAhJ2Nk3Noa+Tm9ZErcfKhVykowGFYdBurD0M+9eouz4LRQP+JOfvUjmdduEZ9H+uzTou3OCr3pCj+6PLltQRT7C7hNz1YCzocUc=
|