warden-github 0.5.0 → 0.5.1
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.
- data/lib/warden-github/user.rb +11 -4
- data/lib/warden-github/version.rb +1 -1
- metadata +4 -4
data/lib/warden-github/user.rb
CHANGED
@@ -64,14 +64,18 @@ module Warden
|
|
64
64
|
# Send a V3 API GET request to path and parse the response body
|
65
65
|
#
|
66
66
|
# path - the path on api.github.com to hit
|
67
|
+
# params - extra params for calling the api
|
67
68
|
#
|
68
69
|
# Returns a parsed JSON response
|
69
70
|
#
|
70
71
|
# Examples
|
71
72
|
# github_request("/user")
|
72
73
|
# # => { 'login' => 'atmos', ... }
|
73
|
-
|
74
|
-
|
74
|
+
#
|
75
|
+
# github_request("/user/repos", {:page => 2})
|
76
|
+
# # => [ { 'name' => 'gollum' ... } ]
|
77
|
+
def github_request(path, params = {})
|
78
|
+
Yajl.load(github_raw_request(path, params))
|
75
79
|
end
|
76
80
|
|
77
81
|
# Send a V3 API GET request to path
|
@@ -83,8 +87,11 @@ module Warden
|
|
83
87
|
# Examples
|
84
88
|
# github_raw_request("/user")
|
85
89
|
# # => RestClient::Response
|
86
|
-
|
87
|
-
|
90
|
+
#
|
91
|
+
# github_raw_request("/user/repos", {:page => 3})
|
92
|
+
# # => RestClient::Response
|
93
|
+
def github_raw_request(path, params = {})
|
94
|
+
RestClient.get("#{github_api_uri}/#{path}", :params => params.merge({ :access_token => token }), :accept => :json)
|
88
95
|
end
|
89
96
|
|
90
97
|
private
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: warden-github
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 9
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 5
|
9
|
-
-
|
10
|
-
version: 0.5.
|
9
|
+
- 1
|
10
|
+
version: 0.5.1
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Corey Donohoe
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2012-
|
18
|
+
date: 2012-06-02 00:00:00 -07:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|