hubba 0.5.1 → 0.5.2
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/lib/hubba/client.rb +9 -6
- data/lib/hubba/github.rb +6 -0
- data/lib/hubba/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8362d3b3f03aadf2fb3708be499e3daeccfe343d
|
4
|
+
data.tar.gz: ce865016b107b78fbd72d3817364040551d61596
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 37c9ed873b55c67f5db957ea663222f3a6c0bb9ee8e4b5c58ca52917159407e1cf88e2bba9f86bcf63d42431a531dc09c0954bd9e9f1c66a0b4dab724c34534d
|
7
|
+
data.tar.gz: 9fbb4951feade4506e5721c9cb635856227f346def9f11d50557048f8acb41e1e927901617de5177d9c8363c2513b9bfa3b354b7bc5f532c77f1b53e6d0dd525
|
data/lib/hubba/client.rb
CHANGED
@@ -20,12 +20,12 @@ end # method initialize
|
|
20
20
|
|
21
21
|
|
22
22
|
def get( request_uri )
|
23
|
-
###
|
24
|
-
# e.g. /users/geraldb
|
25
|
-
# /users/geraldb/repos
|
26
|
-
|
27
23
|
puts "GET #{request_uri}"
|
28
|
-
|
24
|
+
|
25
|
+
## note: request_uri ALWAYS starts with leading /, thus use + for now!!!
|
26
|
+
# e.g. /users/geraldb
|
27
|
+
# /users/geraldb/repos
|
28
|
+
url = BASE_URL + request_uri
|
29
29
|
|
30
30
|
headers = {}
|
31
31
|
headers['User-Agent'] = 'ruby/hubba' ## required by GitHub API
|
@@ -57,9 +57,12 @@ def get( request_uri )
|
|
57
57
|
# => "text/html; charset=UTF-8"
|
58
58
|
|
59
59
|
# Iterate all response headers.
|
60
|
+
puts "HTTP HEADERS:"
|
60
61
|
res.headers.each do |key, value|
|
61
|
-
puts "#{key}
|
62
|
+
puts " #{key}: >#{value}<"
|
62
63
|
end
|
64
|
+
puts
|
65
|
+
|
63
66
|
# => "location => http://www.google.com/"
|
64
67
|
# => "content-type => text/html; charset=UTF-8"
|
65
68
|
# ...
|
data/lib/hubba/github.rb
CHANGED
@@ -57,6 +57,7 @@ class Orgs < Resource
|
|
57
57
|
## sort by name
|
58
58
|
data.map { |item| item['login'] }.sort
|
59
59
|
end
|
60
|
+
alias_method :names, :logins ## add name alias - why? why not?
|
60
61
|
end
|
61
62
|
|
62
63
|
|
@@ -137,4 +138,9 @@ end
|
|
137
138
|
|
138
139
|
end # class Github
|
139
140
|
|
141
|
+
############
|
142
|
+
# add convenience alias for alternate spelling - why? why not?
|
143
|
+
GitHub = Github
|
144
|
+
|
145
|
+
|
140
146
|
end # module Hubba
|
data/lib/hubba/version.rb
CHANGED