ghuls 1.6.0 → 1.7.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +3 -0
  3. data/lib/ghuls/cli.rb +31 -0
  4. metadata +15 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e4f02949862605287aeecff20058850ff5df3953
4
- data.tar.gz: a6355a8600c6688917efe2bfe43f805b24ace8f9
3
+ metadata.gz: d96ebaf7216af0c8e93271bb14238818dbe6a088
4
+ data.tar.gz: ceb76c4ac2fb680547cbdf2acf88e22052d4a634
5
5
  SHA512:
6
- metadata.gz: 81cb3bfbb5267f3f85a4d89269e88ca1fbdf304897c6bc78cccd67ad6e5a268013f17877f96b5a7f5095371aae052ad599fc59d42f5789d64d81a18f9fb6f660
7
- data.tar.gz: 2fe5aea1b6f27c85f9937a2fdc5413ad59583223705d04985f0756fa324a4d013c3ab3d1f58aba003fbe1158f86eeb33038e3e9f5d248b1e05c0e5d5380f8f5a
6
+ metadata.gz: 3a325f5990f46132ceda09ab0c397220bf646216341ff1964b99d2cfd05f7128c677f093dda28355d56b1a94e9901972755ca0403a50c2cfc11777b1aa405e6a
7
+ data.tar.gz: 65da39f08c167f1f2a494fd57b24885f5f6ac24592d724a3eb556584aeb85cacbd37cd2b5facdd724fc3c426f3195d8d45859a4df61ab90c76ecdb1236f1811a
data/CHANGELOG.md CHANGED
@@ -1,5 +1,8 @@
1
1
  # Changelog
2
2
  ## Version 1
3
+ ### Version 1.7.0
4
+ * Add data provided by github-calendar (#2).
5
+
3
6
  ### Version 1.6.0
4
7
  * Update dependency versions.
5
8
  * ruby: 2.2.3 -> 2.3.0
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.6.0
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