githubstats 3.3.0 → 4.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.github/exporter.sh +16 -0
- data/.github/workflows/build.yml +13 -22
- data/CHANGELOG.md +8 -0
- data/githubstats.gemspec +1 -1
- data/lib/githubstats/data.rb +1 -1
- data/lib/githubstats/version.rb +1 -1
- data/lib/githubstats.rb +1 -1
- metadata +5 -4
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: f9408402f2e39213c3163ba8c25eb7f8526cb1045b109c71a747da608da3ca8d
|
|
4
|
+
data.tar.gz: d1db1cc388f11eec686bed5927600f55630b6540cc894baf51786daf80a2d5b6
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 71c1d29dcdcad8bdd249b7b40086eaca9b9e53e49126485088a28125f0541f1de7ceebd1ccdda70b8a6502275c4a93cf97e4d284750fcbf89b3077f444f2606e
|
|
7
|
+
data.tar.gz: 628327cc991fc1c00bed03a4183fdd1f057188747a4e052649b8d9fd5ca21b7845099d4ed7860d08bdb83021b97cc1e4f1b5354117f0f18990cf49a5e8cc398a
|
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"
|
data/.github/workflows/build.yml
CHANGED
|
@@ -1,7 +1,12 @@
|
|
|
1
|
+
---
|
|
1
2
|
name: Build
|
|
2
|
-
on:
|
|
3
|
-
pull_request:
|
|
3
|
+
'on':
|
|
4
4
|
push:
|
|
5
|
+
branches:
|
|
6
|
+
- main
|
|
7
|
+
tags:
|
|
8
|
+
- "**"
|
|
9
|
+
pull_request_target:
|
|
5
10
|
jobs:
|
|
6
11
|
build:
|
|
7
12
|
name: Build
|
|
@@ -23,24 +28,10 @@ jobs:
|
|
|
23
28
|
if: github.ref_type == 'tag'
|
|
24
29
|
run: bundle exec rake release
|
|
25
30
|
env:
|
|
26
|
-
GEM_HOST_API_KEY: ${{ secrets.GEM_HOST_API_KEY }}
|
|
27
|
-
- name: Post to
|
|
28
|
-
|
|
29
|
-
uses: slackapi/slack-github-action@v1.23.0
|
|
31
|
+
GEM_HOST_API_KEY: "${{ secrets.GEM_HOST_API_KEY }}"
|
|
32
|
+
- name: Post to hook-exporter
|
|
33
|
+
run: "./.github/exporter.sh"
|
|
30
34
|
env:
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
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
|
-
}
|
|
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.1 / 2023-07-18
|
|
2
|
+
|
|
3
|
+
* [BUGFIX] Sort datapoints when creating Data object
|
|
4
|
+
|
|
5
|
+
# 4.0.0 / 2023-07-18
|
|
6
|
+
|
|
7
|
+
* [FEATURE] Support updated table element now in use on github.com. Thanks @shih91!
|
|
8
|
+
|
|
1
9
|
# 3.3.0 / 2023-01-08
|
|
2
10
|
|
|
3
11
|
* [BUGFIX] Update to handle changes to GitHub contribution chart SVG naming
|
data/githubstats.gemspec
CHANGED
|
@@ -18,7 +18,7 @@ Gem::Specification.new do |s|
|
|
|
18
18
|
s.executables = ['githubstats']
|
|
19
19
|
|
|
20
20
|
s.add_runtime_dependency 'basiccache', '~> 1.0.0'
|
|
21
|
-
s.add_runtime_dependency 'nokogiri', '~> 1.
|
|
21
|
+
s.add_runtime_dependency 'nokogiri', '~> 1.15.3'
|
|
22
22
|
|
|
23
23
|
s.add_development_dependency 'goodcop', '~> 0.9.7'
|
|
24
24
|
s.add_development_dependency 'timecop', '~> 0.9.6'
|
data/lib/githubstats/data.rb
CHANGED
|
@@ -33,7 +33,7 @@ module GithubStats
|
|
|
33
33
|
# Create a data object and turn on caching
|
|
34
34
|
|
|
35
35
|
def initialize(data)
|
|
36
|
-
@raw = data.map { |d, s| Datapoint.new(Date.parse(d), s.to_i) }
|
|
36
|
+
@raw = data.map { |d, s| Datapoint.new(Date.parse(d), s.to_i) }.sort_by(&:date)
|
|
37
37
|
enable_caching %i[to_h today streaks longest_streak streak max mean
|
|
38
38
|
std_var quartile_boundaries quartiles start_date
|
|
39
39
|
end_date]
|
data/lib/githubstats/version.rb
CHANGED
data/lib/githubstats.rb
CHANGED
|
@@ -143,7 +143,7 @@ module GithubStats
|
|
|
143
143
|
def download(to_date = nil)
|
|
144
144
|
resp = request(to_date)
|
|
145
145
|
html = Nokogiri::HTML(resp)
|
|
146
|
-
svg = html.
|
|
146
|
+
svg = html.css('table.ContributionCalendar-grid td[data-date]')
|
|
147
147
|
svg.css('.ContributionCalendar-day').map do |x|
|
|
148
148
|
x.attributes.values_at('data-date', 'data-level').map(&:value)
|
|
149
149
|
end
|
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:
|
|
4
|
+
version: 4.0.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Les Aker
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2023-
|
|
11
|
+
date: 2023-07-18 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: basiccache
|
|
@@ -30,14 +30,14 @@ dependencies:
|
|
|
30
30
|
requirements:
|
|
31
31
|
- - "~>"
|
|
32
32
|
- !ruby/object:Gem::Version
|
|
33
|
-
version: 1.
|
|
33
|
+
version: 1.15.3
|
|
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.
|
|
40
|
+
version: 1.15.3
|
|
41
41
|
- !ruby/object:Gem::Dependency
|
|
42
42
|
name: goodcop
|
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -75,6 +75,7 @@ extensions: []
|
|
|
75
75
|
extra_rdoc_files: []
|
|
76
76
|
files:
|
|
77
77
|
- ".circle-ruby"
|
|
78
|
+
- ".github/exporter.sh"
|
|
78
79
|
- ".github/workflows/build.yml"
|
|
79
80
|
- ".gitignore"
|
|
80
81
|
- ".rspec"
|