githubstats 3.3.0 → 4.0.0

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 92f3eb1f61af9163e2b683c942b25f08def1fda5abe252e6c62b87fc54678e88
4
- data.tar.gz: 42b058fbc533b8da30ee503ef749379a9ea2d99beff3c8ea02334c1bc89f06d1
3
+ metadata.gz: 85efd3ef7382a78839410709a66d068aa9d13de94b3da28994c8afd42dfb03c1
4
+ data.tar.gz: a7bbcb3ded14ef503a048724a452917b119150146c07fb5885798d69f2212a61
5
5
  SHA512:
6
- metadata.gz: 88ffca14f54e80e5293385b4215876ea3daf6cb0675b3c7de35377cf0b766bbb7f0a248021c569a6aaa9b1ffe5b3a12aa06521886fe7882d919b5ccb3deda464
7
- data.tar.gz: 67b31d0fd88a57f8874621fb5edc50faa600a996a5985c9348586b7ecc6b9f83fab42621044a581a5a40e884586fbd3e1625f273273f48a34d9ef9654dbe1a59
6
+ metadata.gz: 10e07635dbe3eeccc3773de65c0400fc907fd28f9bf5c802bbb07b67c2cef5316009705711409f051c760286d40b08691bf3f9431f15922735606037a599ea12
7
+ data.tar.gz: 2b57b802d0ef16fecb194e4a25ad181cb98eed71b9f46b5a958a1c8f3014b496afd2a7d9cd16b9994763a663104b519443996aa6cc186630dc6d23108f768f6c
@@ -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"
@@ -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 a Slack channel
28
- if: ${{ failure() }}
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
- 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
- }
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,7 @@
1
+ # 4.0.0 / 2023-07-18
2
+
3
+ * [FEATURE] Support updated table element now in use on github.com. Thanks @shih91!
4
+
1
5
  # 3.3.0 / 2023-01-08
2
6
 
3
7
  * [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.13.10'
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'
@@ -3,5 +3,5 @@
3
3
  ##
4
4
  # Define the version
5
5
  module GithubStats
6
- VERSION = '3.3.0'
6
+ VERSION = '4.0.0'
7
7
  end
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.at_css('svg.js-calendar-graph-svg')
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: 3.3.0
4
+ version: 4.0.0
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-01-08 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: basiccache
@@ -30,14 +30,14 @@ dependencies:
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: 1.13.10
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.13.10
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"