hublingo 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +8 -8
  2. data/lib/hublingo.rb +10 -0
  3. metadata +1 -1
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- ODI0NDY5MGExMzQyMWQ4MmEyMzE4YjNkZDJiNGZmOGNjMDFiZGM5Yw==
4
+ ZTU0NTY5YzgyZWRmOTkyYzUxNzY2YzczODdlZjczYjU1ZmQ1Zjk3MA==
5
5
  data.tar.gz: !binary |-
6
- MTNhMzE5NDE4ZmI4ZjljMzVmZDZhZmIyMzVmMzUwZjg4OTkyNTYzMw==
6
+ ZjI1MTgyOTc1MzdiYjI0MTgxYWFmOTVhNGRhMTZhNjI5MGMzYjk1NA==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- MGQ5ZmNiZjg0NTAwZGIyMDZlMjVjZWUyNDdlOWU0YWFhZDZhNWEzMjE5M2Vj
10
- MDYxZWUzY2RiMjRjOGQ0ZGI5MDM1NWUxMWYyYTUzZTdkMmRkOGUzOTdkNDRl
11
- NGU3Njk5OWM2NTE2M2Q1OTUwYmI2MTFjODMwZmM0ZjdiYWNmMjU=
9
+ YTRhMzUwZGUwMGJmNmMzYmI4MzY3NzM2NWE5NTk2ZmFjZDJiNjg2Y2EzZjI5
10
+ NGViNDQyMDk2OWY4YmFjYmQyM2NmY2NiMDYxZTNhZjFkNzE1OGI0MjQ4NGQ0
11
+ OWJlMTliYjM2YmE3NGQyMTQ0ODBmNTlmYTQzZGIzNWVjZDc0M2Y=
12
12
  data.tar.gz: !binary |-
13
- ZjNkMGM2MzkxN2ZiZGNjMDlhY2VhMGZlMmMyZWJjNjM4NzhiZDNkOWFiNGVh
14
- NTcwOGZlMDJjYTU2ODE3MTdjYzhlZTBmN2IzYWVjNWZkOTllNDZkOTM5ZWZi
15
- OGU0YzhhNDgwMTg2ZGZmY2FkODdmNjIyZmUwMDhkOTVjYmQ1NzA=
13
+ MGQzNmI2ZjRiMmZjNTMxMjY0ODkwNDhiNzUzN2U2ZmU2Yzg1NTc4MzM0YmQ4
14
+ ZTA4MDk2ZjRiM2NkYTc5OGIzOTgzNzQzMjRmODVkMWQyM2JiY2FmOGU4Y2Jm
15
+ MWIxNmFkZTk2ZDI2MzkwMTAxZDc3NGM1OTE1YzQ1MTExMmU3N2M=
data/lib/hublingo.rb CHANGED
@@ -1,19 +1,27 @@
1
1
  require 'octokit'
2
2
 
3
+ # @author Dave Goodchild
3
4
  class Hublingo
4
5
 
5
6
  attr_accessor :repos
6
7
  attr_accessor :frequencies
7
8
 
9
+ # Constructor initializes repos array and frequencies hash.
8
10
  def initialize
9
11
  @repos = []
10
12
  @frequencies = Hash.new(0)
11
13
  end
12
14
 
15
+ # Returns the size of the repos array.
16
+ # @return [Fixnum] the size of the array.
13
17
  def size
14
18
  repos.size
15
19
  end
16
20
 
21
+ # Given a Github user name, retrieves all public repos for that.
22
+ # user and assembles a hash containing language frequency.
23
+ # @param hacker [String] the Github username
24
+ # @return [String] error response or favourite language.
17
25
  def lingo(hacker)
18
26
  @repos = Octokit.repos(hacker)
19
27
  languages || "Sorry that hacker has no public repos!"
@@ -23,6 +31,8 @@ class Hublingo
23
31
  "Uh oh! Rate limit! Please try again at #{Octokit.rate_limit.resets_at}"
24
32
  end
25
33
 
34
+ # Cycles through the repos and builds a hash of language frequencies.
35
+ # @return [String] of most used language.
26
36
  def languages
27
37
  if repos.any?
28
38
  repos.each do |repo|
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hublingo
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dave Goodchild