hublingo 0.0.9 → 0.1.0

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 +7 -3
  3. metadata +2 -2
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- OTE5ZjI4NWQ3YTEyZTlkNGQ5OGVjMzk2MDNmOTgyMjI4NDBhZDQ1MQ==
4
+ ZTNhZDMyNWIxNjhiZWI2NTMxN2M0ZGE1NTkyOTkwMmE3N2RlYzg5NA==
5
5
  data.tar.gz: !binary |-
6
- NDFhYWFmMTZkZGVkZTBiYjAxZmFkYTIyOTYzMDhlOWVkMDU4ZWViMg==
6
+ ZWExMjU5YmVlYjA0N2VjMDcwYjQxZTE3OTQ4MWJhZTg5NjQ2NjM0Yg==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- YzRkNjY0MzY4YWY2Y2M0Y2M0ODU1NTg1NzIyZjg1NTMwYjUwMzE3MGFkZTZj
10
- MzBiYWUxOWE1MWI2M2Y0YTNiNGZjYjYxMzJiZjQ5YTlmYmZjNzQyODBhMjQy
11
- NzY3NzM4YTg3YjAzMmIzZmQ2YzkzMThmZTU1NzFiOThlMTJjMjc=
9
+ NDBhMjQyM2UyNmFjNjAzN2RiZTQ0ZDkxZjkyNDhjZDM5MDUzMzg2NGJmMGRi
10
+ NTMzZWY5NDQ1MWRlNWQ5ZWNkOGFmY2UxYWVjMWE3ZmM0ZDVlNjkxNzNmN2Q3
11
+ MmIwZTU4NDY4ZGVmMjRlM2I1MDJhZDVkMTgxYTBiYjgzMWM3YzI=
12
12
  data.tar.gz: !binary |-
13
- MTE1NTllZTdiZWI2YjIyZjQzMzYyY2JhZmJlNWUzZjMwMDAzN2FhNDBmZmFh
14
- ZDhiOGZlY2JjMzc2N2NmZDRjNDIyZWE1ZmZjNjEwZDQyMjQzYzM1MjNlNTE0
15
- MTg2NmYyMDdiNWU3MmVlZWNkYmY5MmZlYmFjYTM3NjE0ZmJlYjg=
13
+ YTAyZDFjZDhjY2MyZjJlOTlkOGY5ZmEwZjI0MGEzNjcyOTc0YmJhOGQxMzA0
14
+ YTZiMjYzNzEwMjYzOGQ3N2E3OTI3ZjNjMGZhYWE1MWI2N2I3NjM1ZDA5Y2Rl
15
+ MzdkMWMxNTI4ZjA0MjVjM2ZmOGYzMzg4MDYzYTAxYTVjN2NlNTk=
@@ -1,5 +1,9 @@
1
1
  require 'octokit'
2
2
 
3
+ class HublingoNotFound < StandardError
4
+ class HublingoRateLimit < StandardError
5
+ class HublingoNoPublic < StandardError
6
+
3
7
  # @author Dave Goodchild
4
8
  class Hublingo
5
9
 
@@ -26,11 +30,11 @@ class Hublingo
26
30
  def lingo(hacker)
27
31
  @client = Octokit::Client.new(client_id: ENV['GITHUB_CLIENT_ID'], client_secret: ENV['GITHUB_CLIENT_SECRET'])
28
32
  @repos = client.repositories(hacker)
29
- languages || "Sorry that hacker has no public repos!"
33
+ languages || raise HublingoNoPublic
30
34
  rescue Octokit::NotFound
31
- "That hacker doesn't exist baby."
35
+ raise HublingoNotFound
32
36
  rescue Octokit::TooManyRequests
33
- "Uh oh! Rate limit! Please try again at #{Octokit.rate_limit.resets_at}"
37
+ raise HublingoRateLimit rate_limit.resets_at
34
38
  end
35
39
 
36
40
  # Cycles through the repos and builds a hash of language frequencies.
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hublingo
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.9
4
+ version: 0.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dave Goodchild
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-02-06 00:00:00.000000000 Z
11
+ date: 2014-02-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: minitest