hublingo 0.0.9 → 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/lib/hublingo.rb +7 -3
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
ZTNhZDMyNWIxNjhiZWI2NTMxN2M0ZGE1NTkyOTkwMmE3N2RlYzg5NA==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
ZWExMjU5YmVlYjA0N2VjMDcwYjQxZTE3OTQ4MWJhZTg5NjQ2NjM0Yg==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
NDBhMjQyM2UyNmFjNjAzN2RiZTQ0ZDkxZjkyNDhjZDM5MDUzMzg2NGJmMGRi
|
10
|
+
NTMzZWY5NDQ1MWRlNWQ5ZWNkOGFmY2UxYWVjMWE3ZmM0ZDVlNjkxNzNmN2Q3
|
11
|
+
MmIwZTU4NDY4ZGVmMjRlM2I1MDJhZDVkMTgxYTBiYjgzMWM3YzI=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
YTAyZDFjZDhjY2MyZjJlOTlkOGY5ZmEwZjI0MGEzNjcyOTc0YmJhOGQxMzA0
|
14
|
+
YTZiMjYzNzEwMjYzOGQ3N2E3OTI3ZjNjMGZhYWE1MWI2N2I3NjM1ZDA5Y2Rl
|
15
|
+
MzdkMWMxNTI4ZjA0MjVjM2ZmOGYzMzg4MDYzYTAxYTVjN2NlNTk=
|
data/lib/hublingo.rb
CHANGED
@@ -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 ||
|
33
|
+
languages || raise HublingoNoPublic
|
30
34
|
rescue Octokit::NotFound
|
31
|
-
|
35
|
+
raise HublingoNotFound
|
32
36
|
rescue Octokit::TooManyRequests
|
33
|
-
|
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
|
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-
|
11
|
+
date: 2014-02-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: minitest
|