fb_graph2 0.0.8 → 0.0.9

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 37cb2d2c7a4656ed062f89cdd23f62c4d3330b75
4
- data.tar.gz: e7245ddeb28a753a0c0a944090d9c2405bc91362
3
+ metadata.gz: 0ced8aa3650b1b6f29f4a37aad427360f5fc5c4b
4
+ data.tar.gz: e38a6dce278fc1b54458b96ba8d26e261f73edf6
5
5
  SHA512:
6
- metadata.gz: e9ffa26d19e497c0c528ef45a9b9d5745d1a0762d102d25a37080226a9d9d9f0eaf5b15a4b917335342927a5fc11b9ce22f5967b981ef3d202873e12a6a6cceb
7
- data.tar.gz: 086e24af8d48fd1e0857cdbf55e1aec2b701c57cc176530952be8bc49ea491d20bd56f7640ebbd128185dc4e0a40bd7a693525177e0e3658fdef1151ecf58030
6
+ metadata.gz: 485b1bce88aa4d0144c1b06104ac7b5c793ac03e51ebb0f52398b8e9008d15f46e08cea520276ecd5a74445b3a4c5122ca362f50dbcfcb278d567db0cb098cd7
7
+ data.tar.gz: b2baf4351d291e6cdb2b0be4d73d22f540e118c17b5241cd3d3c7bdbc089395205121ea84d3a90c5595164258c6c098f31225831b99871ac49b4681dded77df5
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.8
1
+ 0.0.9
@@ -2,7 +2,7 @@ require 'active_support/all'
2
2
  require 'rack/oauth2'
3
3
 
4
4
  module FbGraph2
5
- cattr_accessor :root_url, :api_version, :gem_version, :logger, :debugging, :_http_config_, :object_classes
5
+ mattr_accessor :root_url, :api_version, :gem_version, :logger, :debugging, :_http_config_, :object_classes
6
6
 
7
7
  self.root_url = 'https://graph.facebook.com'
8
8
  self.api_version = 'v2.0'
@@ -1,13 +1,33 @@
1
1
  module FbGraph2
2
2
  class Auth < Rack::OAuth2::Client
3
+ class Grant
4
+ class FbExchangeToken < Rack::OAuth2::Client::Grant
5
+ attr_required :fb_exchange_token
6
+ end
7
+ end
8
+
3
9
  def initialize(client_id, client_secret, options = {})
4
10
  super options.merge(
5
11
  identifier: client_id,
6
12
  secret: client_secret,
7
13
  host: URI.parse(FbGraph2.root_url).host,
8
- authorize_endpoint: '/oauth/authorize',
14
+ authorization_endpoint: '/oauth/authorize',
9
15
  token_endpoint: '/oauth/access_token'
10
16
  )
11
17
  end
18
+
19
+ def fb_exchange_token=(access_token)
20
+ @grant = Grant::FbExchangeToken.new(
21
+ fb_exchange_token: access_token
22
+ )
23
+ end
24
+
25
+ def access_token!(options = {})
26
+ super options.merge(
27
+ client_auth_method: :body
28
+ )
29
+ rescue Rack::OAuth2::Client::Error => e
30
+ raise Exception.detect_from_status(detect_from_status).new(e.message)
31
+ end
12
32
  end
13
33
  end
@@ -3,7 +3,7 @@ module FbGraph2
3
3
  attr_accessor :id, :access_token, :raw_attributes
4
4
 
5
5
  def self.inherited(klass)
6
- klass.include AttributeAssigner
6
+ klass.send :include, AttributeAssigner
7
7
  FbGraph2.object_classes << klass
8
8
  end
9
9
 
@@ -1,7 +1,7 @@
1
1
  module FbGraph2
2
2
  class Struct
3
3
  def self.inherited(klass)
4
- klass.include AttributeAssigner
4
+ klass.send :include, AttributeAssigner
5
5
  end
6
6
 
7
7
  def initialize(attributes = {})
@@ -22,4 +22,12 @@ describe FbGraph2::RequestFilter::Authenticator do
22
22
  request.header["Authorization"].should == ["Bearer #{token.access_token}"]
23
23
  end
24
24
  end
25
+
26
+ context 'when Rack::OAuth2::AccessToken::Legacy given' do
27
+ let(:token) { Rack::OAuth2::AccessToken::Legacy.new access_token: 'token' }
28
+ it do
29
+ request_filter.filter_request(request)
30
+ request.header["Authorization"].should == ["OAuth #{token.access_token}"]
31
+ end
32
+ end
25
33
  end
metadata CHANGED
@@ -1,139 +1,139 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fb_graph2
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.8
4
+ version: 0.0.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - nov matake
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-06-11 00:00:00.000000000 Z
11
+ date: 2014-06-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: httpclient
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ">="
17
+ - - '>='
18
18
  - !ruby/object:Gem::Version
19
19
  version: '2.3'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - ">="
24
+ - - '>='
25
25
  - !ruby/object:Gem::Version
26
26
  version: '2.3'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: rack-oauth2
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - ">="
31
+ - - '>='
32
32
  - !ruby/object:Gem::Version
33
33
  version: '1.0'
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - ">="
38
+ - - '>='
39
39
  - !ruby/object:Gem::Version
40
40
  version: '1.0'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: multi_json
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - ">="
45
+ - - '>='
46
46
  - !ruby/object:Gem::Version
47
47
  version: '0'
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - ">="
52
+ - - '>='
53
53
  - !ruby/object:Gem::Version
54
54
  version: '0'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: activesupport
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - ">="
59
+ - - '>='
60
60
  - !ruby/object:Gem::Version
61
61
  version: '4.0'
62
62
  type: :runtime
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
- - - ">="
66
+ - - '>='
67
67
  - !ruby/object:Gem::Version
68
68
  version: '4.0'
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: rake
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
- - - ">="
73
+ - - '>='
74
74
  - !ruby/object:Gem::Version
75
75
  version: '0'
76
76
  type: :development
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
- - - ">="
80
+ - - '>='
81
81
  - !ruby/object:Gem::Version
82
82
  version: '0'
83
83
  - !ruby/object:Gem::Dependency
84
84
  name: simplecov
85
85
  requirement: !ruby/object:Gem::Requirement
86
86
  requirements:
87
- - - ">="
87
+ - - '>='
88
88
  - !ruby/object:Gem::Version
89
89
  version: '0'
90
90
  type: :development
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
- - - ">="
94
+ - - '>='
95
95
  - !ruby/object:Gem::Version
96
96
  version: '0'
97
97
  - !ruby/object:Gem::Dependency
98
98
  name: webmock
99
99
  requirement: !ruby/object:Gem::Requirement
100
100
  requirements:
101
- - - ">="
101
+ - - '>='
102
102
  - !ruby/object:Gem::Version
103
103
  version: '0'
104
104
  type: :development
105
105
  prerelease: false
106
106
  version_requirements: !ruby/object:Gem::Requirement
107
107
  requirements:
108
- - - ">="
108
+ - - '>='
109
109
  - !ruby/object:Gem::Version
110
110
  version: '0'
111
111
  - !ruby/object:Gem::Dependency
112
112
  name: rspec
113
113
  requirement: !ruby/object:Gem::Requirement
114
114
  requirements:
115
- - - ">="
115
+ - - '>='
116
116
  - !ruby/object:Gem::Version
117
117
  version: '0'
118
118
  type: :development
119
119
  prerelease: false
120
120
  version_requirements: !ruby/object:Gem::Requirement
121
121
  requirements:
122
- - - ">="
122
+ - - '>='
123
123
  - !ruby/object:Gem::Version
124
124
  version: '0'
125
125
  - !ruby/object:Gem::Dependency
126
126
  name: rspec-its
127
127
  requirement: !ruby/object:Gem::Requirement
128
128
  requirements:
129
- - - ">="
129
+ - - '>='
130
130
  - !ruby/object:Gem::Version
131
131
  version: '0'
132
132
  type: :development
133
133
  prerelease: false
134
134
  version_requirements: !ruby/object:Gem::Requirement
135
135
  requirements:
136
- - - ">="
136
+ - - '>='
137
137
  - !ruby/object:Gem::Version
138
138
  version: '0'
139
139
  description: Facebook Graph API v2.0 Wrapper in Ruby
@@ -143,8 +143,8 @@ executables: []
143
143
  extensions: []
144
144
  extra_rdoc_files: []
145
145
  files:
146
- - ".gitignore"
147
- - ".travis.yml"
146
+ - .gitignore
147
+ - .travis.yml
148
148
  - Gemfile
149
149
  - LICENSE.txt
150
150
  - README.md
@@ -379,17 +379,17 @@ require_paths:
379
379
  - lib
380
380
  required_ruby_version: !ruby/object:Gem::Requirement
381
381
  requirements:
382
- - - ">="
382
+ - - '>='
383
383
  - !ruby/object:Gem::Version
384
384
  version: '0'
385
385
  required_rubygems_version: !ruby/object:Gem::Requirement
386
386
  requirements:
387
- - - ">="
387
+ - - '>='
388
388
  - !ruby/object:Gem::Version
389
389
  version: '0'
390
390
  requirements: []
391
391
  rubyforge_project:
392
- rubygems_version: 2.2.2
392
+ rubygems_version: 2.0.3
393
393
  signing_key:
394
394
  specification_version: 4
395
395
  summary: Facebook Graph API v2.0 Wrapper in Ruby