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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f916b6d266bd3d1b619294f386a48854bc949481199c16368bf528e6b4e84887
4
- data.tar.gz: 5b5db4f3cede61d0f236ed7919e5811f6cb3748c0ef128e3aa0d95a9503224c2
3
+ metadata.gz: 39a80fbfd70eb439076199998142ec5ac4e8a60494d3a160bcfc67058d200935
4
+ data.tar.gz: 4108161a4d71634fb48ba98bdb5fb85284224b72cb006874278df8d1e0d120fc
5
5
  SHA512:
6
- metadata.gz: 1f570ebc5fb4044ded6e41650cf86c25b0151e1ca99baed85d6b36e9eea268be457226b73980822f898c8629e425089b0ce65ff076c0b22a3ebbebf431251b44
7
- data.tar.gz: d6c65f73a2416454da45619311da7459a36965a8d2d00f237867dd61dd839526bec97828b32fc320123c4790d9d09b4c7e1b73b8e460fe03e534e25999d85af7
6
+ metadata.gz: a65c9fed6432216d8c48391e7124558a1dc87c67e343e684300a1d56e351809440261d366ecf6996618eaccec8f116bdfe52ca15eebbafe86c2fdbbb09def2d9
7
+ data.tar.gz: 012bd1c3a898970100667837e9ee1287314d5bb2ce9166e399776d41533e7d287906b13fa9b2b73f16f73ab8e96ead2e2899ebbd9dc0fde2abaf3350ffaae386
@@ -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
@@ -1,3 +1,11 @@
1
+ # 4.0.0 / 2023-07-18
2
+
3
+ * [BUGFIX] Update GithubStats dep to use new Github.com format for table
4
+
5
+ # 3.4.0 / 2023-01-08
6
+
7
+ * [ENHANCEMENT] Update GithubStats dep
8
+
1
9
  # 3.3.1 / 2021-02-06
2
10
 
3
11
  * [BUGFIX] Actually bump githubstats dep
data/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  The MIT License (MIT)
2
2
 
3
- Copyright (c) 2014 Les Aker
3
+ Copyright (c) 2023 Les Aker
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
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
- [![Build Status](https://img.shields.io/travis/com/akerl/githubchart.svg)](https://travis-ci.com/akerl/githubchart)
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
@@ -11,4 +11,4 @@ RuboCop::RakeTask.new(:rubocop) do |task|
11
11
  task.fail_on_error = true
12
12
  end
13
13
 
14
- task default: [:spec, :rubocop, :build, :install]
14
+ task default: %i[spec rubocop build install]
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 = "Uses GithubStats to grab Github contributions scores and converts that into an SVG"
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', '~> 3.2.0'
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.3'
24
- s.add_development_dependency 'rake', '~> 13.0.0'
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
-
@@ -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
@@ -1,5 +1,5 @@
1
1
  ##
2
2
  # Define the version
3
3
  module GithubChart
4
- VERSION = '3.3.1'.freeze
4
+ VERSION = '4.0.0'.freeze
5
5
  end
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 backdd
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
@@ -1,11 +1,2 @@
1
- if ENV['CI'] == 'true'
2
- require 'simplecov'
3
- require 'codecov'
4
- SimpleCov.formatter = SimpleCov::Formatter::Codecov
5
- SimpleCov.start do
6
- add_filter '/spec/'
7
- end
8
- end
9
-
10
1
  require 'rspec'
11
2
  require 'githubchart'
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: 3.3.1
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: 2021-02-06 00:00:00.000000000 Z
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: 3.2.0
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: 3.2.0
26
+ version: 4.0.1
27
27
  - !ruby/object:Gem::Dependency
28
- name: svgplot
28
+ name: matrix
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: 1.0.0
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: 1.0.0
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: rake
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: 3.9.0
90
- type: :development
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: 3.9.0
54
+ version: 1.0.0
97
55
  - !ruby/object:Gem::Dependency
98
- name: fuubar
56
+ name: goodcop
99
57
  requirement: !ruby/object:Gem::Requirement
100
58
  requirements:
101
59
  - - "~>"
102
60
  - !ruby/object:Gem::Version
103
- version: 2.5.0
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: 2.5.0
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
- - ".circle-ruby"
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
- post_install_message:
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.1.2
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
@@ -1,4 +0,0 @@
1
- 2.6.1
2
- 2.5.3
3
- 2.4.5
4
- 2.3.8
data/.prospectus DELETED
@@ -1,11 +0,0 @@
1
- my_slug = 'akerl/githubchart'
2
-
3
- Prospectus.extra_dep('file', 'prospectus_travis')
4
- Prospectus.extra_dep('file', 'prospectus_gems')
5
-
6
- item do
7
- noop
8
-
9
- extend ProspectusGems::Gemspec.new
10
- extend ProspectusTravis::Build.new(my_slug)
11
- end
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=