githubstats 3.1.0 → 3.2.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: 63d1760b40fbefddd2aa5c8fba01de7eb8b9d4924ba16c3e6e32030265d1a4a7
4
- data.tar.gz: b7c45953695c48422332f089338443e9d622d4c25991676a32e6ed28b9e7402d
3
+ metadata.gz: aa26d02c85e58b01ee8553a90a628aed98fa010b89142b056187d28467eb710a
4
+ data.tar.gz: b6671f2fa390ad49016cee0bc816a28d7063f7d2fc48a8b60aff5a6c4ebccdc0
5
5
  SHA512:
6
- metadata.gz: ed67ab09a4247ed69c8a12d597010ca7dd1e7f76add17553834d54fa350a3bd93fc402575fdf202ee05bf486ca2c1c386d8f8800daff3b1c8bf17b3704fc6ab5
7
- data.tar.gz: 0154bdd9747143f0974313aff0a53b03d8252fab6e104af13ebade18d20057cbd8a62c0057032ccef9e9a60d3a441f66d1521a9cac1bd9efe700b87b3fe014f3
6
+ metadata.gz: 4de055321d31ac225c4b519866a6a475268e20117daa8ba5f93164bfb00531d79722efadfe9bb655d81dc1cda91bb20d809f3d8c61657e1290b94e53f7c33f06
7
+ data.tar.gz: 7dd16f5fcb857c6f312123969f469080247886463d708fb270770bd169b35e1f192ae26e1dbc5b879d91a4c843bccabd7be72521b1f08b27f727e5c45647683f
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ # 3.2.0 / 2021-02-06
2
+
3
+ * [BUGFIX] Update to handle GitHub changes to contribution data CSS
4
+
1
5
  # 3.1.0 / 2020-10-06
2
6
 
3
7
  * [FEATURE] Remove curb dependency, which allows githubstats to work on Windows systems. Thanks @ajmeese7!
data/githubstats.gemspec CHANGED
@@ -6,9 +6,10 @@ Gem::Specification.new do |s|
6
6
  s.name = 'githubstats'
7
7
  s.version = GithubStats::VERSION
8
8
  s.date = Time.now.strftime('%Y-%m-%d')
9
+ s.required_ruby_version = '>= 2.5.0'
9
10
 
10
11
  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 Metrics/LineLength
12
+ s.description = 'Pulls the statistics from Github\'s user contribution chart and provides an interface for analyzing that data' # rubocop:disable Layout/LineLength
12
13
  s.authors = ['Les Aker']
13
14
  s.email = 'me@lesaker.org'
14
15
  s.homepage = 'https://github.com/akerl/githubstats'
@@ -23,9 +24,8 @@ Gem::Specification.new do |s|
23
24
 
24
25
  s.add_development_dependency 'codecov', '~> 0.1.1'
25
26
  s.add_development_dependency 'fuubar', '~> 2.5.0'
26
- s.add_development_dependency 'goodcop', '~> 0.8.0'
27
+ s.add_development_dependency 'goodcop', '~> 0.9.3'
27
28
  s.add_development_dependency 'rake', '~> 13.0.0'
28
29
  s.add_development_dependency 'rspec', '~> 3.9.0'
29
- s.add_development_dependency 'rubocop', '~> 0.76.0'
30
30
  s.add_development_dependency 'timecop', '~> 0.9.0'
31
31
  end
data/lib/githubstats.rb CHANGED
@@ -143,7 +143,8 @@ module GithubStats
143
143
  def download(to_date = nil)
144
144
  resp = request(to_date)
145
145
  html = Nokogiri::HTML(resp)
146
- html.css('.day').map do |x|
146
+ svg = html.at_css('svg.js-calendar-graph-svg')
147
+ svg.css('.ContributionCalendar-day').map do |x|
147
148
  x.attributes.values_at('data-date', 'data-count').map(&:value)
148
149
  end
149
150
  end
@@ -120,7 +120,7 @@ module GithubStats
120
120
  # The mean score
121
121
 
122
122
  def mean
123
- scores.reduce(:+) / @raw.size.to_f
123
+ scores.sum / @raw.size.to_f
124
124
  end
125
125
 
126
126
  ##
@@ -197,9 +197,7 @@ module GithubStats
197
197
  def _pad(data, index, fill_value, goal)
198
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
@@ -3,5 +3,5 @@
3
3
  ##
4
4
  # Define the version
5
5
  module GithubStats
6
- VERSION = '3.1.0'
6
+ VERSION = '3.2.0'
7
7
  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.1.0
4
+ version: 3.2.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: 2020-10-06 00:00:00.000000000 Z
11
+ date: 2021-02-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: basiccache
@@ -72,14 +72,14 @@ dependencies:
72
72
  requirements:
73
73
  - - "~>"
74
74
  - !ruby/object:Gem::Version
75
- version: 0.8.0
75
+ version: 0.9.3
76
76
  type: :development
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
80
  - - "~>"
81
81
  - !ruby/object:Gem::Version
82
- version: 0.8.0
82
+ version: 0.9.3
83
83
  - !ruby/object:Gem::Dependency
84
84
  name: rake
85
85
  requirement: !ruby/object:Gem::Requirement
@@ -108,20 +108,6 @@ dependencies:
108
108
  - - "~>"
109
109
  - !ruby/object:Gem::Version
110
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
125
111
  - !ruby/object:Gem::Dependency
126
112
  name: timecop
127
113
  requirement: !ruby/object:Gem::Requirement
@@ -183,7 +169,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
183
169
  requirements:
184
170
  - - ">="
185
171
  - !ruby/object:Gem::Version
186
- version: '0'
172
+ version: 2.5.0
187
173
  required_rubygems_version: !ruby/object:Gem::Requirement
188
174
  requirements:
189
175
  - - ">="