omniauth-facebook-access-token 0.1.3 → 0.1.4

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 712317d348e99624fffc0ef2ab364994f0805004
4
- data.tar.gz: 05eff4e4130387040d1d03324d4c8bf49202a3a5
3
+ metadata.gz: 2d2a55e1ccd17d71e11984eb5fbf5c6cf888be55
4
+ data.tar.gz: f72189b11a50934b4fd69dfc724935a564521a54
5
5
  SHA512:
6
- metadata.gz: b96a430de42bcdfecc34cf6537fd48f76a7a7999839da4a81a56adcb68801ed5aea130e6ca0998aa74d7d5c301f40dcdbe51613438b94a3396e0f8ee50c21c99
7
- data.tar.gz: c8e5268bce100feeab03d0954649980294a0d92645800b53836e4ac72e23d07631a5d65f84b34177dc6f4cb44e549be3ca7772d77a296e59b4ea2577d63fb57c
6
+ metadata.gz: eeb6fb4e161264bf7e6605fd4c588d910a83ff943530ed665ded3f6195a6b425e93fae753253f6b1983badc40d299eba4dbfdb6bcea269e38927d3f4dba16171
7
+ data.tar.gz: 2d6804f82760566754a306c3e9e4193f6a4ee6e0d7ef99cf9276acbfb0d5d4b8434b58c091e1cddc9c3439f0d4c7ddc21d3478be81d675264d2535c79608ef9c
@@ -1,5 +1,5 @@
1
1
  module OmniAuth
2
2
  module FacebookAccessToken
3
- VERSION = '0.1.3'
3
+ VERSION = '0.1.4'
4
4
  end
5
5
  end
@@ -1,4 +1,5 @@
1
1
  require 'oauth2'
2
+ require 'omniauth'
2
3
 
3
4
  module OmniAuth
4
5
  module Strategies
@@ -34,7 +35,7 @@ module OmniAuth
34
35
  'name' => raw_info['name'],
35
36
  'first_name' => raw_info['first_name'],
36
37
  'last_name' => raw_info['last_name'],
37
- 'image' => "#{options[:secure_image_url] ? 'https' : 'http'}://graph.facebook.com/#{uid}/picture?type=#{options[:image_size] || 'square'}",
38
+ 'image' => image_url(uid, options),
38
39
  'description' => raw_info['bio'],
39
40
  'urls' => {
40
41
  'Facebook' => raw_info['link'],
@@ -62,7 +63,7 @@ module OmniAuth
62
63
  def raw_info
63
64
  @raw_info ||= access_token.get('/me', info_options).parsed || {}
64
65
  end
65
-
66
+
66
67
  def info_options
67
68
  options[:info_fields] ? {:params => {:fields => options[:info_fields]}} : {}
68
69
  end
@@ -123,7 +124,7 @@ module OmniAuth
123
124
  hash = request.params.slice("access_token", "expires_at", "expires_in", "refresh_token")
124
125
  hash.update(options.access_token_options)
125
126
  ::OAuth2::AccessToken.from_hash(
126
- client,
127
+ client,
127
128
  hash
128
129
  )
129
130
  end
@@ -135,6 +136,19 @@ module OmniAuth
135
136
  end
136
137
  end
137
138
 
139
+ def image_url(uid, options)
140
+ uri_class = options[:secure_image_url] ? URI::HTTPS : URI::HTTP
141
+ url = uri_class.build({:host => 'graph.facebook.com', :path => "/#{uid}/picture"})
142
+
143
+ query = if options[:image_size].is_a?(String)
144
+ { :type => options[:image_size] }
145
+ elsif options[:image_size].is_a?(Hash)
146
+ options[:image_size]
147
+ end
148
+ url.query = Rack::Utils.build_query(query) if query
149
+
150
+ url.to_s
151
+ end
138
152
  end
139
153
  end
140
154
  end
@@ -2,8 +2,8 @@
2
2
  require File.expand_path('../lib/omniauth-facebook-access-token/version', __FILE__)
3
3
 
4
4
  Gem::Specification.new do |gem|
5
- gem.add_dependency 'omniauth', '~> 1.0'
6
- gem.add_dependency 'oauth2', '~> 0.8.0'
5
+ gem.add_dependency 'omniauth', '~> 1.2'
6
+ gem.add_dependency 'oauth2', '~> 0.9.3'
7
7
 
8
8
  gem.authors = ["Dor Shahaf"]
9
9
  gem.email = ["dor@shahaf.com"]
metadata CHANGED
@@ -1,43 +1,43 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: omniauth-facebook-access-token
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dor Shahaf
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-09-27 00:00:00.000000000 Z
11
+ date: 2014-06-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: omniauth
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ~>
17
+ - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '1.0'
19
+ version: '1.2'
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
- version: '1.0'
26
+ version: '1.2'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: oauth2
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - ~>
31
+ - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: 0.8.0
33
+ version: 0.9.3
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
- version: 0.8.0
40
+ version: 0.9.3
41
41
  description: 'A Facebook using access-token strategy for OmniAuth. Can be used for
42
42
  client side Facebook login. '
43
43
  email:
@@ -46,7 +46,7 @@ executables: []
46
46
  extensions: []
47
47
  extra_rdoc_files: []
48
48
  files:
49
- - .gitignore
49
+ - ".gitignore"
50
50
  - Gemfile
51
51
  - README.markdown
52
52
  - lib/omniauth-facebook-access-token.rb
@@ -63,17 +63,17 @@ require_paths:
63
63
  - lib
64
64
  required_ruby_version: !ruby/object:Gem::Requirement
65
65
  requirements:
66
- - - '>='
66
+ - - ">="
67
67
  - !ruby/object:Gem::Version
68
68
  version: '0'
69
69
  required_rubygems_version: !ruby/object:Gem::Requirement
70
70
  requirements:
71
- - - '>='
71
+ - - ">="
72
72
  - !ruby/object:Gem::Version
73
73
  version: '0'
74
74
  requirements: []
75
75
  rubyforge_project:
76
- rubygems_version: 2.0.3
76
+ rubygems_version: 2.2.2
77
77
  signing_key:
78
78
  specification_version: 4
79
79
  summary: A Facebook using access-token strategy for OmniAuth.