omniauth-vkontakte 1.3.3 → 1.3.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: 4600f52193d082fd35375e34e6b822fc721b90a7
4
- data.tar.gz: e41076cf4280c38734d72f1d190a8cd32ad95c05
3
+ metadata.gz: 1c6686250c9a81bc7bc6f7545e9d6d9fe702ca17
4
+ data.tar.gz: 953f4cf5c904b0857cd0f25ba766eb7920ee548e
5
5
  SHA512:
6
- metadata.gz: 3a783498b480bf99966df984f77e3cda737476fa65957f2d4b15b0bf9280d555fe5b46e158afbf2166536be30c04afc9096c8e4423fce1b38e81eb2cbe0d3313
7
- data.tar.gz: bd9b323713bfd7d2d00b46d1d14918f6aa415ad66d85fdaff741bffb3564b58c7e05260584dd33e52d30b6bb557edcd68a62873d1249faa689d392c2a4f2cbdf
6
+ metadata.gz: 8721c3341d33bd33ea8af12ed8f2cc0ea9cb4b8f25a5192f87314ce5b1c19e97155021c27fc91fbb19dda6bda9d3239942257443c48f3fc35ff62a0ccef554b1
7
+ data.tar.gz: 20849621b7bd8cd91b0264bbb5e290af9fdd592a4ff16a192ab6bdfd1d48463bc850961ba5e8da2486d0de4316ef68850037334542b5cea1ccab13b64275adde
data/README.md CHANGED
@@ -18,7 +18,7 @@ You can configure several options, which you pass in to the `provider` method vi
18
18
  * `scope`: a comma-separated list of access permissions you want to request from the user. [Read the Vkontakte docs for more details](http://vk.com/dev/permissions)
19
19
  * `display`: the display context to show the authentication page. Valid options include `page`, `popup` and `mobile`.
20
20
  * `lang`: specifies the language. Optional options include `ru`, `ua`, `be`, `en`, `es`, `fi`, `de`, `it`.
21
- * `image_size`: defines the size of the user's image. Valid options include `mini`(50x50), `bigger`(100x100) and `original`(200x200). Default is `mini`.
21
+ * `image_size`: defines the size of the user's image. Valid options include `mini`(50x50), `bigger`(100x100), `bigger_x2`(200x200), `original`(200x*) and `original_x2`(400x*). Default is `mini`.
22
22
  * `info_fields`: specify which fields should be added to AuthHash when
23
23
  getting the user's info. Value should be a comma-separated string as per http://vk.com/dev/fields.
24
24
 
@@ -1,5 +1,5 @@
1
1
  module OmniAuth
2
2
  module Vkontakte
3
- VERSION = "1.3.3"
3
+ VERSION = "1.3.4"
4
4
  end
5
5
  end
@@ -15,7 +15,7 @@ module OmniAuth
15
15
  class Vkontakte < OmniAuth::Strategies::OAuth2
16
16
  class NoRawData < StandardError; end
17
17
 
18
- API_VERSION = '5.2'
18
+ API_VERSION = '5.8'
19
19
 
20
20
  DEFAULT_SCOPE = ''
21
21
 
@@ -96,8 +96,8 @@ module OmniAuth
96
96
 
97
97
  def info_options
98
98
  # http://vk.com/dev/fields
99
- fields = ['nickname', 'screen_name', 'sex', 'city', 'country', 'online', 'bdate', 'photo_50', 'photo_100', 'photo_200_orig']
100
- fields.concat(options[:info_fields].split(',')) if options[:info_fields]
99
+ fields = %w[nickname screen_name sex city country online bdate photo_50 photo_100 photo_200 photo_200_orig photo_400_orig]
100
+ fields.concat(options[:info_fields].split(',')) if options[:info_fields]
101
101
  return fields.join(',')
102
102
  end
103
103
 
@@ -111,45 +111,21 @@ module OmniAuth
111
111
  raw_info['photo_50']
112
112
  when 'bigger'
113
113
  raw_info['photo_100']
114
+ when 'bigger_x2'
115
+ raw_info['photo_200']
114
116
  when 'original'
115
117
  raw_info['photo_200_orig']
118
+ when 'original_x2'
119
+ raw_info['photo_400_orig']
116
120
  else
117
121
  raw_info['photo_50']
118
122
  end
119
123
  end
120
124
 
121
- # http://vk.com/dev/database.getCountriesById
122
- def get_country
123
- if raw_info['country'] && raw_info['country'] != "0"
124
- params = {
125
- :country_ids => raw_info['country'],
126
- :lang => lang_option,
127
- :v => API_VERSION,
128
- }
129
- country = access_token.get('/method/database.getCountriesById', :params => params).parsed['response']
130
- country && country.first ? country.first['title'] : ''
131
- else
132
- ''
133
- end
134
- end
135
-
136
- # http://vk.com/dev/database.getCitiesById
137
- def get_city
138
- if raw_info['city'] && raw_info['city'] != "0"
139
- params = {
140
- :city_ids => raw_info['city'],
141
- :lang => lang_option,
142
- :v => API_VERSION,
143
- }
144
- city = access_token.get('/method/database.getCitiesById', :params => params).parsed['response']
145
- city && city.first ? city.first['title'] : ''
146
- else
147
- ''
148
- end
149
- end
150
-
151
125
  def location
152
- @location ||= [get_country, get_city].map(&:strip).reject(&:empty?).join(', ')
126
+ country = raw_info.fetch('country', {})['title']
127
+ city = raw_info.fetch('city', {})['title']
128
+ @location ||= [country, city].compact.join(', ')
153
129
  end
154
130
 
155
131
  def callback_phase
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: omniauth-vkontakte
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.3
4
+ version: 1.3.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Anton Maminov
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-09-01 00:00:00.000000000 Z
11
+ date: 2015-10-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: omniauth
@@ -86,7 +86,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
86
86
  version: '0'
87
87
  requirements: []
88
88
  rubyforge_project:
89
- rubygems_version: 2.2.2
89
+ rubygems_version: 2.4.8
90
90
  signing_key:
91
91
  specification_version: 4
92
92
  summary: Unofficial VKontakte strategy for OmniAuth 1.0