oauth2 0.0.4 → 0.0.5

Sign up to get free protection for your applications and to get access to all the features.
data/LICENSE CHANGED
@@ -1,4 +1,4 @@
1
- Copyright (c) 2009 Michael Bleigh
1
+ Copyright (c) 2009 Intridea, Inc. and Michael Bleigh
2
2
 
3
3
  Permission is hereby granted, free of charge, to any person obtaining
4
4
  a copy of this software and associated documentation files (the
@@ -54,4 +54,4 @@ That's all there is to it! You can use the access token like you would with the
54
54
 
55
55
  == Copyright
56
56
 
57
- Copyright (c) 2010 Michael Bleigh. See LICENSE for details.
57
+ Copyright (c) 2010 Intridea, Inc. and Michael Bleigh. See LICENSE for details.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.4
1
+ 0.0.5
@@ -8,7 +8,7 @@ module OAuth2
8
8
  self.default_connection_adapter = :net_http
9
9
 
10
10
  attr_accessor :id, :secret, :site, :connection, :options
11
-
11
+
12
12
  # Instantiate a new OAuth 2.0 client using the
13
13
  # client ID and client secret registered to your
14
14
  # application.
@@ -31,20 +31,24 @@ module OAuth2
31
31
  connection.build { |b| b.adapter(adapter) }
32
32
  end
33
33
  end
34
-
34
+
35
35
  def authorize_url(params = nil)
36
36
  path = options[:authorize_url] || options[:authorize_path] || "/oauth/authorize"
37
37
  connection.build_url(path, params).to_s
38
38
  end
39
-
39
+
40
40
  def access_token_url(params = nil)
41
41
  path = options[:access_token_url] || options[:access_token_path] || "/oauth/access_token"
42
42
  connection.build_url(path, params).to_s
43
43
  end
44
-
44
+
45
45
  def request(verb, url, params = {}, headers = {})
46
- resp = connection.run_request(verb, url, nil, headers) do |req|
47
- req.params.update(params)
46
+ if verb == :get
47
+ resp = connection.run_request(verb, url, nil, headers) do |req|
48
+ req.params.update(params)
49
+ end
50
+ else
51
+ resp = connection.run_request(verb, url, params, headers)
48
52
  end
49
53
  case resp.status
50
54
  when 200...201 then resp.body
@@ -58,7 +62,7 @@ module OAuth2
58
62
  raise e
59
63
  end
60
64
  end
61
-
65
+
62
66
  def web_server; OAuth2::Strategy::WebServer.new(self) end
63
67
  end
64
68
  end
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{oauth2}
8
- s.version = "0.0.4"
8
+ s.version = "0.0.5"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Michael Bleigh"]
12
- s.date = %q{2010-04-22}
12
+ s.date = %q{2010-04-23}
13
13
  s.description = %q{A Ruby wrapper for the OAuth 2.0 protocol built with a similar style to the original OAuth gem.}
14
14
  s.email = %q{michael@intridea.com}
15
15
  s.extra_rdoc_files = [
@@ -6,9 +6,9 @@ describe OAuth2::AccessToken do
6
6
  cli.connection.build do |b|
7
7
  b.adapter :test do |stub|
8
8
  stub.get('/client?access_token=monkey') { |env| [200, {}, 'get'] }
9
- stub.post('/client?access_token=monkey') { |env| [200, {}, 'post'] }
10
- stub.put('/client?access_token=monkey') { |env| [200, {}, 'put'] }
11
- stub.delete('/client?access_token=monkey') { |env| [200, {}, 'delete'] }
9
+ stub.post('/client') { |env| [200, {}, 'post'] }
10
+ stub.put('/client') { |env| [200, {}, 'put'] }
11
+ stub.delete('/client') { |env| [200, {}, 'delete'] }
12
12
  end
13
13
  end
14
14
  cli
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 0
8
- - 4
9
- version: 0.0.4
8
+ - 5
9
+ version: 0.0.5
10
10
  platform: ruby
11
11
  authors:
12
12
  - Michael Bleigh
@@ -14,7 +14,7 @@ autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
16
 
17
- date: 2010-04-22 00:00:00 -04:00
17
+ date: 2010-04-23 00:00:00 -04:00
18
18
  default_executable:
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency