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 +4 -4
- data/.circle-ruby +3 -3
- data/.rubocop.yml +4 -3
- data/CHANGELOG.md +4 -0
- data/Gemfile +0 -1
- data/Rakefile +1 -2
- data/githubstats.gemspec +8 -6
- data/lib/githubstats.rb +5 -5
- data/lib/githubstats/version.rb +1 -1
- metadata +23 -9
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c24647a4f63470021797a9309535a4438a830c1b
|
4
|
+
data.tar.gz: 7c42bba5c6566f54cab50f0e8873e0e1c3506a44
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ca040015df256cea023906e5504f59b38ca5fe552e2b3f4e44956e8faf9793be060896afa655252699e1f7d84d84673b3ebce091b8a53aac5ab7466ba9a787bb
|
7
|
+
data.tar.gz: 5cff21515fdd91ebba43d39cdb9fb6a3c95122f95a9f5fb2e1d205e98f0dc7ad72b64628a52bfeacc86d6721ff5af82109f2d7e952b1291fb162477802ce7085
|
data/.circle-ruby
CHANGED
@@ -1,3 +1,3 @@
|
|
1
|
-
2.4.
|
2
|
-
2.3.
|
3
|
-
2.2.
|
1
|
+
2.4.2
|
2
|
+
2.3.5
|
3
|
+
2.2.8
|
data/.rubocop.yml
CHANGED
data/CHANGELOG.md
CHANGED
data/Gemfile
CHANGED
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: [
|
13
|
+
task default: %i[spec rubocop build install]
|
data/githubstats.gemspec
CHANGED
@@ -1,13 +1,14 @@
|
|
1
|
-
|
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(
|
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 =
|
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.
|
25
|
-
s.add_development_dependency 'rubocop', '~> 0.
|
26
|
-
s.add_development_dependency '
|
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'
|
data/lib/githubstats.rb
CHANGED
@@ -41,7 +41,7 @@ module GithubStats
|
|
41
41
|
class User
|
42
42
|
include MethodCacher
|
43
43
|
|
44
|
-
attr_reader :name, :url, :
|
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
|
-
|
149
|
-
|
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)
|
data/lib/githubstats/version.rb
CHANGED
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: 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-
|
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.
|
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.
|
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.
|
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.
|
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.
|
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.
|
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.
|
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
|