ghuls 1.6.0 → 1.7.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 +4 -4
- data/CHANGELOG.md +3 -0
- data/lib/ghuls/cli.rb +31 -0
- metadata +15 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d96ebaf7216af0c8e93271bb14238818dbe6a088
|
4
|
+
data.tar.gz: ceb76c4ac2fb680547cbdf2acf88e22052d4a634
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3a325f5990f46132ceda09ab0c397220bf646216341ff1964b99d2cfd05f7128c677f093dda28355d56b1a94e9901972755ca0403a50c2cfc11777b1aa405e6a
|
7
|
+
data.tar.gz: 65da39f08c167f1f2a494fd57b24885f5f6ac24592d724a3eb556584aeb85cacbd37cd2b5facdd724fc3c426f3195d8d45859a4df61ab90c76ecdb1236f1811a
|
data/CHANGELOG.md
CHANGED
data/lib/ghuls/cli.rb
CHANGED
@@ -2,10 +2,13 @@ require 'paint'
|
|
2
2
|
require 'progress_bar'
|
3
3
|
require 'ghuls/lib'
|
4
4
|
require 'array_utility'
|
5
|
+
require 'string-utility'
|
6
|
+
require 'github/calendar'
|
5
7
|
|
6
8
|
module GHULS
|
7
9
|
class CLI
|
8
10
|
using ArrayUtility
|
11
|
+
using StringUtility
|
9
12
|
|
10
13
|
# Parses the arguments (typically ARGV) into a usable hash.
|
11
14
|
# @param args [Array] The arguments to parse.
|
@@ -148,6 +151,33 @@ module GHULS
|
|
148
151
|
end
|
149
152
|
end
|
150
153
|
|
154
|
+
def calendar_data(username)
|
155
|
+
puts "Total contributions this year: #{GitHub::Calendar.get_total_year(username).to_s.separate}"
|
156
|
+
puts "An average day has #{GitHub::Calendar.get_average_day(username).to_s.separate} contributions"
|
157
|
+
puts "An average week has #{GitHub::Calendar.get_average_week(username).to_s.separate} contributions"
|
158
|
+
puts "An average month has #{GitHub::Calendar.get_average_month(username).to_s.separate} contributions"
|
159
|
+
puts "Current contribution streak is #{GitHub::Calendar.get_current_streak(username).to_s.separate} days"
|
160
|
+
puts "Longest contribution streak is #{GitHub::Calendar.get_longest_streak(username).to_s.separate} days"
|
161
|
+
GitHub::Calendar.get_monthly(username).each do |month, amount|
|
162
|
+
month_name = case month
|
163
|
+
when '01' then 'January'
|
164
|
+
when '02' then 'February'
|
165
|
+
when '03' then 'March'
|
166
|
+
when '04' then 'April'
|
167
|
+
when '05' then 'May'
|
168
|
+
when '06' then 'June'
|
169
|
+
when '07' then 'July'
|
170
|
+
when '08' then 'August'
|
171
|
+
when '09' then 'September'
|
172
|
+
when '10' then 'October'
|
173
|
+
when '11' then 'November'
|
174
|
+
when '12' then 'December'
|
175
|
+
else month
|
176
|
+
end
|
177
|
+
puts "#{month_name} had #{amount.to_s.separate} contributions"
|
178
|
+
end
|
179
|
+
end
|
180
|
+
|
151
181
|
# Simply runs the program.
|
152
182
|
def run
|
153
183
|
puts @usage if failed?
|
@@ -172,6 +202,7 @@ module GHULS
|
|
172
202
|
follower_data(user[:username])
|
173
203
|
issue_data(@repos)
|
174
204
|
issue_data(@org_repos)
|
205
|
+
calendar_data(user[:username])
|
175
206
|
end
|
176
207
|
exit
|
177
208
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ghuls
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.7.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Eli Foster
|
@@ -66,6 +66,20 @@ dependencies:
|
|
66
66
|
- - ">="
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: 1.1.0
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: string-utility
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - ">="
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: 2.6.1
|
76
|
+
type: :runtime
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - ">="
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: 2.6.1
|
69
83
|
description: Getting GitHub repository language data by user! It also has a web alternative
|
70
84
|
at http://ghuls.herokuapp.com
|
71
85
|
email: elifosterwy@gmail.com
|