social_profile 0.2.0 → 0.2.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: d44aa58dfddf32479ef916e66b88cb18006ddb01
4
+ data.tar.gz: 02d418b320701c6378d5b3c773fb017e8a46c369
5
+ SHA512:
6
+ metadata.gz: ac9db1fcbd22aee01f98b9f67fca013253c461aba73b22989a0fc4b50a19b9d9631183b5ac14b45144294d435c2062e2a73d58614cd33344805229a115e3a614
7
+ data.tar.gz: 7f30303b62b4f02700c4fb7832992e9ff7f4289ece4b2e011ef47f45810ecd34ec041a24fadf73d1a09e2aa24cc203c9f8e65f341a4ac61d9b9c6ede20b1c1fc
@@ -1,11 +1,10 @@
1
- # encoding: utf-8
2
1
  module SocialProfile
3
2
  module Providers
4
3
  class Vkontakte < Base
5
4
  def picture_url
6
5
  @picture_url ||= begin
7
- if auth_hash['extra'] && auth_hash['extra']['raw_info']
8
- photo = auth_hash['extra']['raw_info']['photo_big']
6
+ if auth_hash['extra'] && info = auth_hash['extra']['raw_info']
7
+ photo = info['photo_big'] || info['photo_200_orig']
9
8
  Utils.blank?(photo) ? nil : photo
10
9
  end
11
10
  end
@@ -1,4 +1,4 @@
1
1
  # encoding: utf-8
2
2
  module SocialProfile
3
- VERSION = "0.2.0"
3
+ VERSION = "0.2.1"
4
4
  end
@@ -6,7 +6,7 @@ describe SocialProfile::Providers::Vkontakte do
6
6
  SocialProfile::Providers.should be_a(Module)
7
7
  end
8
8
 
9
- context "vkontakte" do
9
+ context "vkontakte with old response" do
10
10
  before(:each) do
11
11
  hash = {"info"=>{"name"=>"Павел Галета", "location"=>"Ukraine, Kiev", "urls"=>{"Vkontakte"=>"http://vkontakte.ru/id2592709"}, "nickname"=>"", "birth_date"=>"10.3.1987", "last_name"=>"Галета", "image"=>"http://cs10901.vkontakte.ru/u2592709/e_f8b6e3b9.jpg", "first_name"=>"Павел"}, "uid"=>2592709, "credentials"=>{"token"=>"7a1cfdd37a3b72167a3b7216ac7a1347bde7a3b7a3a7216c95a735a210be6d4"}, "extra"=>{"raw_info"=>{"timezone"=>2, "sex"=>"2", "photo_big"=>"http://cs10901.vkontakte.ru/u2592709/a_d8f124ce.jpg"}}, "provider"=>"vkontakte"}
12
12
  @profile = SocialProfile.get(hash)
@@ -23,4 +23,34 @@ describe SocialProfile::Providers::Vkontakte do
23
23
  @profile.profile_url.should == "http://vkontakte.ru/id2592709"
24
24
  end
25
25
  end
26
+
27
+ context "vkontakte with new response" do
28
+ before(:each) do
29
+ hash = { "provider"=>"vkontakte", "uid"=>"2592709",
30
+ "info"=>{"name"=>"Павел Галета", "nickname"=>"super_p", "first_name"=>"Павел", "last_name"=>"Галета",
31
+ "image"=>"http://cs11376.vk.me/u2592709/e_a3716437.jpg",
32
+ "location"=>"Украина, Киев",
33
+ "urls"=>{"Vkontakte"=>"http://vk.com/pavel.galeta"}},
34
+ "credentials"=>{"token"=>"4b349b337f9ee42d4e3c2351fba07075f0d9ef7998150b2bd58571b4d329bc72aa4f3bea3e8328c409ac1202303eb",
35
+ "expires_at"=>1399544280, "expires"=>true},
36
+ "extra"=>{"raw_info"=>{"id"=>2592709, "first_name"=>"Павел", "last_name"=>"Галета", "sex"=>2,
37
+ "nickname"=>"super_p", "screen_name"=>"pavel.galeta", "bdate"=>"10.3.1987", "city"=>314,
38
+ "country"=>2, "photo_50"=>"http://cs11376.vk.me/u2592709/e_a3716437.jpg",
39
+ "photo_100"=>"http://cs11376.vk.me/u2592709/d_847b328d.jpg",
40
+ "photo_200_orig"=>"http://cs11376.vk.me/u2592709/a_1e6cab29.jpg", "online"=>0}}}
41
+
42
+ @profile = SocialProfile.get(hash)
43
+ end
44
+
45
+ it "should be a facebook profile" do
46
+ @profile.should be_a(SocialProfile::Providers::Vkontakte)
47
+ end
48
+
49
+ it "should parse profile" do
50
+ @profile.name.should == "Павел Галета"
51
+ @profile.picture_url.should == "http://cs11376.vk.me/u2592709/a_1e6cab29.jpg"
52
+ @profile.gender.should == 2
53
+ @profile.profile_url.should == "http://vk.com/pavel.galeta"
54
+ end
55
+ end
26
56
  end
metadata CHANGED
@@ -1,20 +1,18 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: social_profile
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
5
- prerelease:
4
+ version: 0.2.1
6
5
  platform: ruby
7
6
  authors:
8
7
  - Igor Galeta
9
8
  autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2014-04-20 00:00:00.000000000 Z
11
+ date: 2014-05-08 00:00:00.000000000 Z
13
12
  dependencies:
14
13
  - !ruby/object:Gem::Dependency
15
14
  name: bundler
16
15
  requirement: !ruby/object:Gem::Requirement
17
- none: false
18
16
  requirements:
19
17
  - - ~>
20
18
  - !ruby/object:Gem::Version
@@ -22,7 +20,6 @@ dependencies:
22
20
  type: :development
23
21
  prerelease: false
24
22
  version_requirements: !ruby/object:Gem::Requirement
25
- none: false
26
23
  requirements:
27
24
  - - ~>
28
25
  - !ruby/object:Gem::Version
@@ -30,97 +27,85 @@ dependencies:
30
27
  - !ruby/object:Gem::Dependency
31
28
  name: rake
32
29
  requirement: !ruby/object:Gem::Requirement
33
- none: false
34
30
  requirements:
35
- - - ! '>='
31
+ - - '>='
36
32
  - !ruby/object:Gem::Version
37
33
  version: '0'
38
34
  type: :development
39
35
  prerelease: false
40
36
  version_requirements: !ruby/object:Gem::Requirement
41
- none: false
42
37
  requirements:
43
- - - ! '>='
38
+ - - '>='
44
39
  - !ruby/object:Gem::Version
45
40
  version: '0'
46
41
  - !ruby/object:Gem::Dependency
47
42
  name: fb_graph
48
43
  requirement: !ruby/object:Gem::Requirement
49
- none: false
50
44
  requirements:
51
- - - ! '>='
45
+ - - '>='
52
46
  - !ruby/object:Gem::Version
53
47
  version: '0'
54
48
  type: :runtime
55
49
  prerelease: false
56
50
  version_requirements: !ruby/object:Gem::Requirement
57
- none: false
58
51
  requirements:
59
- - - ! '>='
52
+ - - '>='
60
53
  - !ruby/object:Gem::Version
61
54
  version: '0'
62
55
  - !ruby/object:Gem::Dependency
63
56
  name: vkontakte
64
57
  requirement: !ruby/object:Gem::Requirement
65
- none: false
66
58
  requirements:
67
- - - ! '>='
59
+ - - '>='
68
60
  - !ruby/object:Gem::Version
69
61
  version: '0'
70
62
  type: :runtime
71
63
  prerelease: false
72
64
  version_requirements: !ruby/object:Gem::Requirement
73
- none: false
74
65
  requirements:
75
- - - ! '>='
66
+ - - '>='
76
67
  - !ruby/object:Gem::Version
77
68
  version: '0'
78
69
  - !ruby/object:Gem::Dependency
79
70
  name: twitter
80
71
  requirement: !ruby/object:Gem::Requirement
81
- none: false
82
72
  requirements:
83
- - - ! '>='
73
+ - - '>='
84
74
  - !ruby/object:Gem::Version
85
75
  version: '0'
86
76
  type: :runtime
87
77
  prerelease: false
88
78
  version_requirements: !ruby/object:Gem::Requirement
89
- none: false
90
79
  requirements:
91
- - - ! '>='
80
+ - - '>='
92
81
  - !ruby/object:Gem::Version
93
82
  version: '0'
94
83
  - !ruby/object:Gem::Dependency
95
84
  name: httpclient
96
85
  requirement: !ruby/object:Gem::Requirement
97
- none: false
98
86
  requirements:
99
- - - ! '>='
87
+ - - '>='
100
88
  - !ruby/object:Gem::Version
101
89
  version: '0'
102
90
  type: :runtime
103
91
  prerelease: false
104
92
  version_requirements: !ruby/object:Gem::Requirement
105
- none: false
106
93
  requirements:
107
- - - ! '>='
94
+ - - '>='
108
95
  - !ruby/object:Gem::Version
109
96
  version: '0'
110
97
  - !ruby/object:Gem::Dependency
111
98
  name: multi_json
112
99
  requirement: !ruby/object:Gem::Requirement
113
- none: false
114
100
  requirements:
115
- - - ! '>='
101
+ - - '>='
116
102
  - !ruby/object:Gem::Version
117
103
  version: '0'
118
104
  type: :runtime
119
105
  prerelease: false
120
106
  version_requirements: !ruby/object:Gem::Requirement
121
- none: false
122
107
  requirements:
123
- - - ! '>='
108
+ - - '>='
124
109
  - !ruby/object:Gem::Version
125
110
  version: '0'
126
111
  description: Wrapper for Omniauth profile hash, post photo to album
@@ -174,27 +159,26 @@ files:
174
159
  homepage: https://github.com/galetahub/social_profile
175
160
  licenses:
176
161
  - MIT
162
+ metadata: {}
177
163
  post_install_message:
178
164
  rdoc_options: []
179
165
  require_paths:
180
166
  - lib
181
167
  required_ruby_version: !ruby/object:Gem::Requirement
182
- none: false
183
168
  requirements:
184
- - - ! '>='
169
+ - - '>='
185
170
  - !ruby/object:Gem::Version
186
171
  version: '0'
187
172
  required_rubygems_version: !ruby/object:Gem::Requirement
188
- none: false
189
173
  requirements:
190
- - - ! '>='
174
+ - - '>='
191
175
  - !ruby/object:Gem::Version
192
176
  version: '0'
193
177
  requirements: []
194
178
  rubyforge_project:
195
- rubygems_version: 1.8.25
179
+ rubygems_version: 2.1.11
196
180
  signing_key:
197
- specification_version: 3
181
+ specification_version: 4
198
182
  summary: Wrapper for Omniauth profile hash
199
183
  test_files:
200
184
  - spec/mock_json/facebook/first_post.json