githubstats 1.4.0 → 2.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
  SHA1:
3
- metadata.gz: 3c307d3a81b095f9d6770eadfb18993ce55c93cf
4
- data.tar.gz: c8ed40abb6f5172280d4beb99b0dc51d1b45cb99
3
+ metadata.gz: c24647a4f63470021797a9309535a4438a830c1b
4
+ data.tar.gz: 7c42bba5c6566f54cab50f0e8873e0e1c3506a44
5
5
  SHA512:
6
- metadata.gz: 8c6efa12319ea49fe4b8f979325d76caa829949ed625e39e672440f23bf8112ba22848216c5c94a4557b01f6918c4b1064dfeaefd21f0fd6f26a37cf6759ff38
7
- data.tar.gz: 5c04f745c7b7e0f10e46831dcad1b1792863e6cf3c0c08b570dcaae718c38bfbdf96a6e78e67a7bdc15cb26ca7895ebb5857dd0ff3d843160bbca0ac2b4bb72c
6
+ metadata.gz: ca040015df256cea023906e5504f59b38ca5fe552e2b3f4e44956e8faf9793be060896afa655252699e1f7d84d84673b3ebce091b8a53aac5ab7466ba9a787bb
7
+ data.tar.gz: 5cff21515fdd91ebba43d39cdb9fb6a3c95122f95a9f5fb2e1d205e98f0dc7ad72b64628a52bfeacc86d6721ff5af82109f2d7e952b1291fb162477802ce7085
@@ -1,3 +1,3 @@
1
- 2.4.1
2
- 2.3.4
3
- 2.2.7
1
+ 2.4.2
2
+ 2.3.5
3
+ 2.2.8
@@ -1,4 +1,5 @@
1
- Encoding:
2
- Enabled: false
1
+ inherit_gem:
2
+ goodcop: .rubocop.yml
3
3
  Metrics/BlockLength:
4
- Enabled: false
4
+ Exclude:
5
+ - 'spec/**/*'
@@ -1,3 +1,7 @@
1
+ # 2.0.0 / 2017-09-29
2
+
3
+ * [BUGFIX] Fail cleanly if Github responds with a bad HTTP code
4
+
1
5
  # 1.4.0 / 2017-06-09
2
6
 
3
7
  * [ENHANCEMENT] Cache more data methods
data/Gemfile CHANGED
@@ -1,4 +1,3 @@
1
1
  source 'https://rubygems.org'
2
2
 
3
3
  gemspec
4
-
data/Rakefile CHANGED
@@ -7,8 +7,7 @@ RSpec::Core::RakeTask.new(:spec)
7
7
 
8
8
  desc 'Run Rubocop on the gem'
9
9
  RuboCop::RakeTask.new(:rubocop) do |task|
10
- task.patterns = ['lib/**/*.rb', 'spec/**/*.rb']
11
10
  task.fail_on_error = true
12
11
  end
13
12
 
14
- task default: [:spec, :rubocop, :build, :install]
13
+ task default: %i[spec rubocop build install]
@@ -1,13 +1,14 @@
1
- $:.unshift File.expand_path('../lib/', __FILE__)
1
+ require 'English'
2
+ $LOAD_PATH.unshift File.expand_path('../lib/', __FILE__)
2
3
  require 'githubstats/version'
3
4
 
4
5
  Gem::Specification.new do |s|
5
6
  s.name = 'githubstats'
6
7
  s.version = GithubStats::VERSION
7
- s.date = Time.now.strftime("%Y-%m-%d")
8
+ s.date = Time.now.strftime('%Y-%m-%d')
8
9
 
9
10
  s.summary = 'Present Github contributions stats in a consumable format'
10
- s.description = "Pulls the statistics from Github's user contribution chart and provides an interface for analyzing that data"
11
+ s.description = 'Pulls the statistics from Github\'s user contribution chart and provides an interface for analyzing that data' # rubocop:disable Metrics/LineLength
11
12
  s.authors = ['Les Aker']
12
13
  s.email = 'me@lesaker.org'
13
14
  s.homepage = 'https://github.com/akerl/githubstats'
@@ -21,9 +22,10 @@ Gem::Specification.new do |s|
21
22
  s.add_runtime_dependency 'basiccache', '~> 1.0.0'
22
23
  s.add_runtime_dependency 'nokogiri', '~> 1.8.0'
23
24
 
24
- s.add_development_dependency 'timecop', '~> 0.8.0'
25
- s.add_development_dependency 'rubocop', '~> 0.49.0'
26
- s.add_development_dependency 'rake', '~> 12.0.0'
25
+ s.add_development_dependency 'timecop', '~> 0.9.0'
26
+ s.add_development_dependency 'rubocop', '~> 0.50.0'
27
+ s.add_development_dependency 'goodcop', '~> 0.1.0'
28
+ s.add_development_dependency 'rake', '~> 12.1.0'
27
29
  s.add_development_dependency 'codecov', '~> 0.1.1'
28
30
  s.add_development_dependency 'rspec', '~> 3.6.0'
29
31
  s.add_development_dependency 'fuubar', '~> 2.2.0'
@@ -41,7 +41,7 @@ module GithubStats
41
41
  class User
42
42
  include MethodCacher
43
43
 
44
- attr_reader :name, :url, :data, :last_updated
44
+ attr_reader :name, :url, :last_updated
45
45
 
46
46
  ##
47
47
  # Creates a new user object
@@ -145,13 +145,13 @@ module GithubStats
145
145
 
146
146
  def download(from = nil)
147
147
  url = from ? @url + "?from=#{from}" : @url
148
- svg = Curl::Easy.perform(url).body_str
149
- html = Nokogiri::HTML(svg)
148
+ res = Curl::Easy.perform(url)
149
+ code = res.response_code
150
+ raise("Failed loading data from GitHub: #{url} #{code}") if code != 200
151
+ html = Nokogiri::HTML(res.body_str)
150
152
  html.css('.day').map do |x|
151
153
  x.attributes.values_at('data-date', 'data-count').map(&:value)
152
154
  end
153
- rescue
154
- raise 'Unable to load data from Github'
155
155
  end
156
156
 
157
157
  def method_missing(sym, *args, &block)
@@ -3,5 +3,5 @@
3
3
  ##
4
4
  # Define the version
5
5
  module GithubStats
6
- VERSION = '1.4.0'.freeze
6
+ VERSION = '2.0.0'.freeze
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: 1.4.0
4
+ version: 2.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: 2017-06-09 00:00:00.000000000 Z
11
+ date: 2017-09-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: curb
@@ -58,42 +58,56 @@ dependencies:
58
58
  requirements:
59
59
  - - "~>"
60
60
  - !ruby/object:Gem::Version
61
- version: 0.8.0
61
+ version: 0.9.0
62
62
  type: :development
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
66
  - - "~>"
67
67
  - !ruby/object:Gem::Version
68
- version: 0.8.0
68
+ version: 0.9.0
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: rubocop
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
73
  - - "~>"
74
74
  - !ruby/object:Gem::Version
75
- version: 0.49.0
75
+ version: 0.50.0
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - "~>"
81
+ - !ruby/object:Gem::Version
82
+ version: 0.50.0
83
+ - !ruby/object:Gem::Dependency
84
+ name: goodcop
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - "~>"
88
+ - !ruby/object:Gem::Version
89
+ version: 0.1.0
76
90
  type: :development
77
91
  prerelease: false
78
92
  version_requirements: !ruby/object:Gem::Requirement
79
93
  requirements:
80
94
  - - "~>"
81
95
  - !ruby/object:Gem::Version
82
- version: 0.49.0
96
+ version: 0.1.0
83
97
  - !ruby/object:Gem::Dependency
84
98
  name: rake
85
99
  requirement: !ruby/object:Gem::Requirement
86
100
  requirements:
87
101
  - - "~>"
88
102
  - !ruby/object:Gem::Version
89
- version: 12.0.0
103
+ version: 12.1.0
90
104
  type: :development
91
105
  prerelease: false
92
106
  version_requirements: !ruby/object:Gem::Requirement
93
107
  requirements:
94
108
  - - "~>"
95
109
  - !ruby/object:Gem::Version
96
- version: 12.0.0
110
+ version: 12.1.0
97
111
  - !ruby/object:Gem::Dependency
98
112
  name: codecov
99
113
  requirement: !ruby/object:Gem::Requirement
@@ -191,7 +205,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
191
205
  version: '0'
192
206
  requirements: []
193
207
  rubyforge_project:
194
- rubygems_version: 2.6.11
208
+ rubygems_version: 2.6.13
195
209
  signing_key:
196
210
  specification_version: 4
197
211
  summary: Present Github contributions stats in a consumable format