githubstats 0.2.3 → 0.2.4
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/Gemfile.lock +2 -2
- data/bin/githubstats +2 -2
- data/githubstats.gemspec +1 -1
- data/lib/githubstats.rb +5 -4
- data/lib/githubstats/data.rb +3 -1
- data/vendor/cache/timecop-0.7.0.gem +0 -0
- metadata +3 -3
- data/vendor/cache/timecop-0.6.3.gem +0 -0
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: fb88ee5beaeff5df29bcfac891df839e313af322
|
|
4
|
+
data.tar.gz: 4dce81c985ec3596c5d3113559e582670af3925d
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: f768130d5d3b6856e5f4a0e0cce61ca79d2d947df01919964764931f55b32a382c8dc3c0e17d2e66591d8217f9d23c220d36107e745e78614e9638daa54068a0
|
|
7
|
+
data.tar.gz: 715bcd10f1e9349e61d97a527a101b5dea8f288c95adf774269496a7b9538db174511ecec736426b03e27af2b8a904094e698b65881c46763a2b864cc33932df
|
data/Gemfile.lock
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
PATH
|
|
2
2
|
remote: .
|
|
3
3
|
specs:
|
|
4
|
-
githubstats (0.2.
|
|
4
|
+
githubstats (0.2.4)
|
|
5
5
|
basiccache (< 2)
|
|
6
6
|
curb
|
|
7
7
|
json
|
|
@@ -59,7 +59,7 @@ GEM
|
|
|
59
59
|
term-ansicolor (1.2.2)
|
|
60
60
|
tins (~> 0.8)
|
|
61
61
|
thor (0.18.1)
|
|
62
|
-
timecop (0.
|
|
62
|
+
timecop (0.7.0)
|
|
63
63
|
tins (0.13.1)
|
|
64
64
|
travis-lint (1.7.0)
|
|
65
65
|
hashr (~> 0.0.22)
|
data/bin/githubstats
CHANGED
|
@@ -6,8 +6,8 @@ user = GithubStats.new ARGV.first
|
|
|
6
6
|
|
|
7
7
|
puts "Contribution data for #{user.name}:
|
|
8
8
|
Today's score: #{user.today}
|
|
9
|
-
Current streak: #{user.streak.length}
|
|
10
|
-
Longest streak: #{user.longest_streak.length}
|
|
9
|
+
Current streak: #{(user.streak || []).length}
|
|
10
|
+
Longest streak: #{(user.longest_streak || []).length}
|
|
11
11
|
High score: #{user.max.score} on #{user.max.date}
|
|
12
12
|
Quartile boundaries: #{user.quartile_boundaries.inspect}"
|
|
13
13
|
|
data/githubstats.gemspec
CHANGED
data/lib/githubstats.rb
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
require 'curb'
|
|
2
2
|
require 'json'
|
|
3
|
-
|
|
3
|
+
|
|
4
4
|
##
|
|
5
5
|
# Rugged is used if available to look up the user's Github username
|
|
6
6
|
|
|
7
7
|
begin
|
|
8
|
-
|
|
8
|
+
require 'rugged'
|
|
9
|
+
USE_RUGGED = true
|
|
9
10
|
rescue LoadError
|
|
10
|
-
|
|
11
|
+
USE_RUGGED = false
|
|
11
12
|
end
|
|
12
13
|
|
|
13
14
|
##
|
|
@@ -72,7 +73,7 @@ module GithubStats
|
|
|
72
73
|
# Guesses the user's name based on system environment
|
|
73
74
|
|
|
74
75
|
def guess_user(names = [])
|
|
75
|
-
names <<
|
|
76
|
+
names << Rugged::Config.global['github.user'] if USE_RUGGED
|
|
76
77
|
names << ENV['USER']
|
|
77
78
|
names.find { |name| !name.nil? } || (fail 'Failed to guess username')
|
|
78
79
|
end
|
data/lib/githubstats/data.rb
CHANGED
|
@@ -73,13 +73,14 @@ module GithubStats
|
|
|
73
73
|
acc
|
|
74
74
|
end
|
|
75
75
|
streaks.reject! { |s| s.empty? }
|
|
76
|
-
streaks
|
|
76
|
+
streaks
|
|
77
77
|
end
|
|
78
78
|
|
|
79
79
|
##
|
|
80
80
|
# The longest streak
|
|
81
81
|
|
|
82
82
|
def longest_streak
|
|
83
|
+
return nil if streaks.empty?
|
|
83
84
|
streaks.max { |a, b| a.length <=> b.length }
|
|
84
85
|
end
|
|
85
86
|
|
|
@@ -87,6 +88,7 @@ module GithubStats
|
|
|
87
88
|
# The current streak, or nil
|
|
88
89
|
|
|
89
90
|
def streak
|
|
91
|
+
return nil if streaks.empty?
|
|
90
92
|
streaks.last.last.date >= Date.today - 1 ? streaks.last : []
|
|
91
93
|
end
|
|
92
94
|
|
|
Binary file
|
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: 0.2.
|
|
4
|
+
version: 0.2.4
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Les Aker
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2013-12-
|
|
11
|
+
date: 2013-12-02 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: curb
|
|
@@ -222,7 +222,7 @@ files:
|
|
|
222
222
|
- vendor/cache/slop-3.4.7.gem
|
|
223
223
|
- vendor/cache/term-ansicolor-1.2.2.gem
|
|
224
224
|
- vendor/cache/thor-0.18.1.gem
|
|
225
|
-
- vendor/cache/timecop-0.
|
|
225
|
+
- vendor/cache/timecop-0.7.0.gem
|
|
226
226
|
- vendor/cache/tins-0.13.1.gem
|
|
227
227
|
- vendor/cache/travis-lint-1.7.0.gem
|
|
228
228
|
homepage: https://github.com/akerl/githubstats
|
|
Binary file
|