sinatra_auth_github 0.3.0 → 0.3.1
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/sinatra/auth/github.rb +3 -2
- data/sinatra_auth_github.gemspec +2 -1
- data/spec/app.rb +3 -3
- metadata +37 -22
data/lib/sinatra/auth/github.rb
CHANGED
@@ -1,3 +1,4 @@
|
|
1
|
+
require 'yajl'
|
1
2
|
require 'sinatra/base'
|
2
3
|
require 'warden-github'
|
3
4
|
require 'rest_client'
|
@@ -72,7 +73,7 @@ module Sinatra
|
|
72
73
|
RestClient.get("https://api.github.com/#{path}", :params => { :access_token => github_user.token }, :accept => :json)
|
73
74
|
end
|
74
75
|
|
75
|
-
# Send a V3 API GET request to path and
|
76
|
+
# Send a V3 API GET request to path and parse the response body
|
76
77
|
#
|
77
78
|
# path - the path on api.github.com to hit
|
78
79
|
#
|
@@ -82,7 +83,7 @@ module Sinatra
|
|
82
83
|
# github_request("/user")
|
83
84
|
# # => { 'login' => 'atmos', ... }
|
84
85
|
def github_request(path)
|
85
|
-
|
86
|
+
Yajl.load(github_raw_request(path))
|
86
87
|
end
|
87
88
|
|
88
89
|
# See if the user is a public member of the named organization
|
data/sinatra_auth_github.gemspec
CHANGED
@@ -3,7 +3,7 @@ $:.push File.expand_path("../lib", __FILE__)
|
|
3
3
|
|
4
4
|
Gem::Specification.new do |s|
|
5
5
|
s.name = "sinatra_auth_github"
|
6
|
-
s.version = "0.3.
|
6
|
+
s.version = "0.3.1"
|
7
7
|
s.platform = Gem::Platform::RUBY
|
8
8
|
s.authors = ["Corey Donohoe"]
|
9
9
|
s.email = ["atmos@atmos.org"]
|
@@ -14,6 +14,7 @@ Gem::Specification.new do |s|
|
|
14
14
|
s.rubyforge_project = "sinatra_auth_github"
|
15
15
|
|
16
16
|
s.add_dependency "sinatra", "~>1.0"
|
17
|
+
s.add_dependency "yajl-ruby", "~>1.1"
|
17
18
|
s.add_dependency "rest-client", "~>1.6.1"
|
18
19
|
s.add_dependency "warden-github", "~>0.3.0"
|
19
20
|
|
data/spec/app.rb
CHANGED
@@ -5,9 +5,9 @@ module Example
|
|
5
5
|
enable :sessions
|
6
6
|
|
7
7
|
set :github_options, {
|
8
|
-
|
9
|
-
|
10
|
-
|
8
|
+
:secret => ENV['GITHUB_CLIENT_SECRET'],
|
9
|
+
:client_id => ENV['GITHUB_CLIENT_ID'],
|
10
|
+
}
|
11
11
|
|
12
12
|
register Sinatra::Auth::Github
|
13
13
|
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sinatra_auth_github
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 17
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 3
|
9
|
-
-
|
10
|
-
version: 0.3.
|
9
|
+
- 1
|
10
|
+
version: 0.3.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-01-
|
18
|
+
date: 2012-01-19 00:00:00 -08:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|
@@ -34,9 +34,24 @@ dependencies:
|
|
34
34
|
type: :runtime
|
35
35
|
version_requirements: *id001
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
|
-
name:
|
37
|
+
name: yajl-ruby
|
38
38
|
prerelease: false
|
39
39
|
requirement: &id002 !ruby/object:Gem::Requirement
|
40
|
+
none: false
|
41
|
+
requirements:
|
42
|
+
- - ~>
|
43
|
+
- !ruby/object:Gem::Version
|
44
|
+
hash: 13
|
45
|
+
segments:
|
46
|
+
- 1
|
47
|
+
- 1
|
48
|
+
version: "1.1"
|
49
|
+
type: :runtime
|
50
|
+
version_requirements: *id002
|
51
|
+
- !ruby/object:Gem::Dependency
|
52
|
+
name: rest-client
|
53
|
+
prerelease: false
|
54
|
+
requirement: &id003 !ruby/object:Gem::Requirement
|
40
55
|
none: false
|
41
56
|
requirements:
|
42
57
|
- - ~>
|
@@ -48,11 +63,11 @@ dependencies:
|
|
48
63
|
- 1
|
49
64
|
version: 1.6.1
|
50
65
|
type: :runtime
|
51
|
-
version_requirements: *
|
66
|
+
version_requirements: *id003
|
52
67
|
- !ruby/object:Gem::Dependency
|
53
68
|
name: warden-github
|
54
69
|
prerelease: false
|
55
|
-
requirement: &
|
70
|
+
requirement: &id004 !ruby/object:Gem::Requirement
|
56
71
|
none: false
|
57
72
|
requirements:
|
58
73
|
- - ~>
|
@@ -64,11 +79,11 @@ dependencies:
|
|
64
79
|
- 0
|
65
80
|
version: 0.3.0
|
66
81
|
type: :runtime
|
67
|
-
version_requirements: *
|
82
|
+
version_requirements: *id004
|
68
83
|
- !ruby/object:Gem::Dependency
|
69
84
|
name: rake
|
70
85
|
prerelease: false
|
71
|
-
requirement: &
|
86
|
+
requirement: &id005 !ruby/object:Gem::Requirement
|
72
87
|
none: false
|
73
88
|
requirements:
|
74
89
|
- - ">="
|
@@ -78,11 +93,11 @@ dependencies:
|
|
78
93
|
- 0
|
79
94
|
version: "0"
|
80
95
|
type: :development
|
81
|
-
version_requirements: *
|
96
|
+
version_requirements: *id005
|
82
97
|
- !ruby/object:Gem::Dependency
|
83
98
|
name: rspec
|
84
99
|
prerelease: false
|
85
|
-
requirement: &
|
100
|
+
requirement: &id006 !ruby/object:Gem::Requirement
|
86
101
|
none: false
|
87
102
|
requirements:
|
88
103
|
- - ~>
|
@@ -94,11 +109,11 @@ dependencies:
|
|
94
109
|
- 0
|
95
110
|
version: 1.3.0
|
96
111
|
type: :development
|
97
|
-
version_requirements: *
|
112
|
+
version_requirements: *id006
|
98
113
|
- !ruby/object:Gem::Dependency
|
99
114
|
name: shotgun
|
100
115
|
prerelease: false
|
101
|
-
requirement: &
|
116
|
+
requirement: &id007 !ruby/object:Gem::Requirement
|
102
117
|
none: false
|
103
118
|
requirements:
|
104
119
|
- - ">="
|
@@ -108,11 +123,11 @@ dependencies:
|
|
108
123
|
- 0
|
109
124
|
version: "0"
|
110
125
|
type: :development
|
111
|
-
version_requirements: *
|
126
|
+
version_requirements: *id007
|
112
127
|
- !ruby/object:Gem::Dependency
|
113
128
|
name: ZenTest
|
114
129
|
prerelease: false
|
115
|
-
requirement: &
|
130
|
+
requirement: &id008 !ruby/object:Gem::Requirement
|
116
131
|
none: false
|
117
132
|
requirements:
|
118
133
|
- - ~>
|
@@ -124,11 +139,11 @@ dependencies:
|
|
124
139
|
- 0
|
125
140
|
version: 4.5.0
|
126
141
|
type: :development
|
127
|
-
version_requirements: *
|
142
|
+
version_requirements: *id008
|
128
143
|
- !ruby/object:Gem::Dependency
|
129
144
|
name: randexp
|
130
145
|
prerelease: false
|
131
|
-
requirement: &
|
146
|
+
requirement: &id009 !ruby/object:Gem::Requirement
|
132
147
|
none: false
|
133
148
|
requirements:
|
134
149
|
- - ~>
|
@@ -140,11 +155,11 @@ dependencies:
|
|
140
155
|
- 5
|
141
156
|
version: 0.1.5
|
142
157
|
type: :development
|
143
|
-
version_requirements: *
|
158
|
+
version_requirements: *id009
|
144
159
|
- !ruby/object:Gem::Dependency
|
145
160
|
name: rack-test
|
146
161
|
prerelease: false
|
147
|
-
requirement: &
|
162
|
+
requirement: &id010 !ruby/object:Gem::Requirement
|
148
163
|
none: false
|
149
164
|
requirements:
|
150
165
|
- - ~>
|
@@ -156,11 +171,11 @@ dependencies:
|
|
156
171
|
- 3
|
157
172
|
version: 0.5.3
|
158
173
|
type: :development
|
159
|
-
version_requirements: *
|
174
|
+
version_requirements: *id010
|
160
175
|
- !ruby/object:Gem::Dependency
|
161
176
|
name: ruby-debug
|
162
177
|
prerelease: false
|
163
|
-
requirement: &
|
178
|
+
requirement: &id011 !ruby/object:Gem::Requirement
|
164
179
|
none: false
|
165
180
|
requirements:
|
166
181
|
- - ">="
|
@@ -170,7 +185,7 @@ dependencies:
|
|
170
185
|
- 0
|
171
186
|
version: "0"
|
172
187
|
type: :development
|
173
|
-
version_requirements: *
|
188
|
+
version_requirements: *id011
|
174
189
|
description: A sinatra extension for easy oauth integration with github
|
175
190
|
email:
|
176
191
|
- atmos@atmos.org
|