rack-oauth2 0.8.0 → 0.8.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/Gemfile.lock CHANGED
@@ -40,7 +40,7 @@ PLATFORMS
40
40
 
41
41
  DEPENDENCIES
42
42
  rack-oauth2!
43
- rake (>= 0.8)
43
+ rake (< 0.9, >= 0.8)
44
44
  rcov (>= 0.9)
45
- rspec (<= 2.5, >= 2)
45
+ rspec (< 2.6, >= 2)
46
46
  webmock (>= 1.6.2)
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.8.0
1
+ 0.8.1
data/lib/rack/oauth2.rb CHANGED
@@ -1,3 +1,11 @@
1
+ module Rack
2
+ module OAuth2
3
+ VERSION = ::File.read(
4
+ ::File.join(::File.dirname(__FILE__), '../../VERSION')
5
+ )
6
+ end
7
+ end
8
+
1
9
  require 'rack'
2
10
  require 'json'
3
11
  require 'httpclient'
@@ -2,17 +2,19 @@ module Rack
2
2
  module OAuth2
3
3
  class AccessToken
4
4
  include AttrRequired, AttrOptional
5
- attr_required :access_token, :token_type, :client
5
+ attr_required :access_token, :token_type, :httpclient
6
6
  attr_optional :refresh_token, :expires_in, :scope
7
- delegate :get, :post, :put, :delete, :to => :client
7
+ delegate :get, :post, :put, :delete, :to => :httpclient
8
8
 
9
9
  def initialize(attributes = {})
10
10
  (required_attributes + optional_attributes).each do |key|
11
11
  self.send :"#{key}=", attributes[key]
12
12
  end
13
13
  @token_type = self.class.to_s.split('::').last.underscore.to_sym
14
- @client = HTTPClient.new
15
- @client.request_filter << Authenticator.new(self)
14
+ @httpclient = HTTPClient.new(
15
+ :agent_name => "#{self.class} (#{VERSION})"
16
+ )
17
+ @httpclient.request_filter << Authenticator.new(self)
16
18
  attr_missing!
17
19
  end
18
20
 
@@ -51,7 +51,9 @@ module Rack
51
51
  :client_secret => self.secret
52
52
  )
53
53
  handle_response do
54
- HTTPClient.new.post absolute_uri_for(token_endpoint), Util.compact_hash(params)
54
+ HTTPClient.new(
55
+ :agent_name => "#{self.class} (#{VERSION})"
56
+ ).post absolute_uri_for(token_endpoint), Util.compact_hash(params)
55
57
  end
56
58
  end
57
59
 
data/rack-oauth2.gemspec CHANGED
@@ -19,8 +19,8 @@ Gem::Specification.new do |s|
19
19
  s.add_runtime_dependency "activesupport", ">= 2.3"
20
20
  s.add_runtime_dependency "i18n"
21
21
  s.add_runtime_dependency "attr_required", ">= 0.0.3"
22
- s.add_development_dependency "rake", ">= 0.8"
22
+ s.add_development_dependency "rake", ">= 0.8", "< 0.9"
23
23
  s.add_development_dependency "rcov", ">= 0.9"
24
- s.add_development_dependency "rspec", ">= 2", "<= 2.5"
24
+ s.add_development_dependency "rspec", ">= 2", "< 2.6"
25
25
  s.add_development_dependency "webmock", ">= 1.6.2"
26
26
  end
@@ -51,8 +51,8 @@ describe Rack::OAuth2::AccessToken do
51
51
  [:get, :delete, :post, :put].each do |method|
52
52
  describe method do
53
53
  it 'should delegate to HTTPClient with Authenticator filter' do
54
- token.client.should_receive(method).with(resource_endpoint)
55
- token.client.request_filter.last.should be_a Rack::OAuth2::AccessToken::Authenticator
54
+ token.httpclient.should_receive(method).with(resource_endpoint)
55
+ token.httpclient.request_filter.last.should be_a Rack::OAuth2::AccessToken::Authenticator
56
56
  token.send method, resource_endpoint
57
57
  end
58
58
  end
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: rack-oauth2
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.8.0
5
+ version: 0.8.1
6
6
  platform: ruby
7
7
  authors:
8
8
  - nov matake
@@ -10,7 +10,7 @@ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
12
 
13
- date: 2011-05-21 00:00:00 Z
13
+ date: 2011-05-28 00:00:00 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: rack
@@ -87,6 +87,9 @@ dependencies:
87
87
  - - ">="
88
88
  - !ruby/object:Gem::Version
89
89
  version: "0.8"
90
+ - - <
91
+ - !ruby/object:Gem::Version
92
+ version: "0.9"
90
93
  type: :development
91
94
  version_requirements: *id007
92
95
  - !ruby/object:Gem::Dependency
@@ -109,9 +112,9 @@ dependencies:
109
112
  - - ">="
110
113
  - !ruby/object:Gem::Version
111
114
  version: "2"
112
- - - <=
115
+ - - <
113
116
  - !ruby/object:Gem::Version
114
- version: "2.5"
117
+ version: "2.6"
115
118
  type: :development
116
119
  version_requirements: *id009
117
120
  - !ruby/object:Gem::Dependency