socialmux 0.0.4 → 0.0.5

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: 2faf70f83ed7c597f3ae72bce7d908dc6d911cc5
4
- data.tar.gz: 82e42fd5ce81f56eeedbdcf431506aacaf78947e
3
+ metadata.gz: aa22bc43651260b9bf9d759aa142da59a9fa4fd1
4
+ data.tar.gz: 754b6ce65db9e047bee072c3bb8ee7bf25e80692
5
5
  SHA512:
6
- metadata.gz: 25153356f1813ea2b7fed1028f0fdbe30154a9e3113c85e505b40374f879a40ecbee1547f9da55bad9192f385bb56cf47ede471fa6a59859131fb53acc5ba89a
7
- data.tar.gz: 84733413ac3b3d3c8e8d69087b0c06fb9100ada27754c1e9d9fd0d83a1a0cca80b6f81ffbb35f65fd1a4dd5c5d317ccb36ec25b711cb5baf318d67b3f7d79f88
6
+ metadata.gz: 9e1577953efccd53c0c0122168b226710ca7b179a0c988d9bac85d3ffa87ebc9d936f9f58e7350042a509da824c391e510bb508e94b4b3c268c9aaa0ead9b06a
7
+ data.tar.gz: 68c73b80c685a3b2a3e7d0fac80f43c726d78dea0bbed58d5d4a8b7cab80006dd4f55934b6dc9fed80977488a41ff98e356168267a0a32704fb92efce1f1710b
@@ -22,7 +22,7 @@ module Socialmux
22
22
  end
23
23
 
24
24
  def url
25
- info.urls.values.first
25
+ info.urls.values.first if info.urls
26
26
  end
27
27
 
28
28
  def gender
@@ -2,7 +2,7 @@ module Socialmux
2
2
  module AuthMapper
3
3
  class GuessName < Base
4
4
  def first_name
5
- name_chunks.first
5
+ name_chunks.first || ""
6
6
  end
7
7
 
8
8
  def last_name
@@ -0,0 +1,20 @@
1
+ module Socialmux
2
+ module AuthMapper
3
+ class Instagram < GuessName
4
+ def url
5
+ "http://instagram.com/#{nickname}"
6
+ end
7
+
8
+ def description
9
+ info.bio
10
+ end
11
+
12
+ private
13
+
14
+ def nickname
15
+ info["nickname"]
16
+ end
17
+ end
18
+ end
19
+ end
20
+
@@ -8,6 +8,7 @@ require 'socialmux/auth_mapper/twitter'
8
8
  require 'socialmux/auth_mapper/github'
9
9
  require 'socialmux/auth_mapper/google_oauth2'
10
10
  require 'socialmux/auth_mapper/linkedin'
11
+ require 'socialmux/auth_mapper/instagram'
11
12
 
12
13
  module Socialmux
13
14
  module AuthMapper
@@ -1,4 +1,4 @@
1
1
  module Socialmux
2
- VERSION = "0.0.4"
2
+ VERSION = "0.0.5"
3
3
  end
4
4
 
@@ -6,10 +6,7 @@
6
6
  "email": "stefano.verna@gmail.com",
7
7
  "first_name": "Stefano",
8
8
  "last_name": "Verna",
9
- "image": "https://lh3.googleusercontent.com/-Mk9Xg5Qy_vc/AAAAAAAAAAI/AAAAAAAAAK4/h0ffVEFGrTo/photo.jpg",
10
- "urls": {
11
- "Google": "https://plus.google.com/106136318376168001814"
12
- }
9
+ "image": "https://lh3.googleusercontent.com/-Mk9Xg5Qy_vc/AAAAAAAAAAI/AAAAAAAAAK4/h0ffVEFGrTo/photo.jpg"
13
10
  },
14
11
  "credentials": {
15
12
  "token": "XXX",
@@ -0,0 +1,17 @@
1
+ {
2
+ "provider": "instagram",
3
+ "uid": "15075543",
4
+ "info": {
5
+ "nickname": "steffoz",
6
+ "name": "Stefano Verna",
7
+ "image": "http://images.ak.instagram.com/profiles/anonymousUser.jpg",
8
+ "bio": "Foobar",
9
+ "website": "http://google.com"
10
+ },
11
+ "credentials": {
12
+ "token": "XXX",
13
+ "expires": false
14
+ },
15
+ "extra": {}
16
+ }
17
+
@@ -12,10 +12,8 @@ module Socialmux::AuthMapper
12
12
  its(:last_name) { should eq "Verna" }
13
13
  its(:email) { should eq "stefano.verna@gmail.com" }
14
14
  its(:image) { should eq "https://lh3.googleusercontent.com/-Mk9Xg5Qy_vc/AAAAAAAAAAI/AAAAAAAAAK4/h0ffVEFGrTo/photo.jpg" }
15
- its(:url) { should eq "https://plus.google.com/106136318376168001814" }
15
+ its(:url) { should be_nil }
16
16
  its(:gender) { should eq Gender::MALE }
17
17
  end
18
18
  end
19
19
 
20
-
21
-
@@ -0,0 +1,22 @@
1
+ # encoding: utf-8
2
+
3
+ require 'spec_helper'
4
+
5
+ module Socialmux::AuthMapper
6
+ describe Twitter do
7
+ subject do
8
+ Instagram.new(read_json('instagram_response'))
9
+ end
10
+
11
+ its(:uid) { should eq "15075543" }
12
+ its(:provider) { should eq "instagram" }
13
+ its(:first_name) { should eq "Stefano" }
14
+ its(:last_name) { should eq "Verna" }
15
+ its(:email) { should be nil }
16
+ its(:image) { should eq "http://images.ak.instagram.com/profiles/anonymousUser.jpg" }
17
+ its(:description) { should eq "Foobar" }
18
+ its(:url) { should eq "http://instagram.com/steffoz" }
19
+ its(:gender) { should be_nil }
20
+ end
21
+ end
22
+
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: socialmux
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stefano Verna
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-08-02 00:00:00.000000000 Z
11
+ date: 2013-11-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -143,6 +143,7 @@ files:
143
143
  - lib/socialmux/auth_mapper/github.rb
144
144
  - lib/socialmux/auth_mapper/google_oauth2.rb
145
145
  - lib/socialmux/auth_mapper/guess_name.rb
146
+ - lib/socialmux/auth_mapper/instagram.rb
146
147
  - lib/socialmux/auth_mapper/linkedin.rb
147
148
  - lib/socialmux/auth_mapper/twitter.rb
148
149
  - lib/socialmux/event.rb
@@ -154,12 +155,14 @@ files:
154
155
  - spec/fixtures/facebook_response.json
155
156
  - spec/fixtures/github_response.json
156
157
  - spec/fixtures/google_response.json
158
+ - spec/fixtures/instagram_response.json
157
159
  - spec/fixtures/linkedin_response.json
158
160
  - spec/fixtures/twitter_response.json
159
161
  - spec/lib/.gitkeep
160
162
  - spec/lib/auth_mapper/facebook_spec.rb
161
163
  - spec/lib/auth_mapper/github_spec.rb
162
164
  - spec/lib/auth_mapper/google_oauth2_spec.rb
165
+ - spec/lib/auth_mapper/instagram_spec.rb
163
166
  - spec/lib/auth_mapper/linkedin_spec.rb
164
167
  - spec/lib/auth_mapper/twitter_spec.rb
165
168
  - spec/lib/auth_mapper_spec.rb
@@ -188,7 +191,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
188
191
  version: '0'
189
192
  requirements: []
190
193
  rubyforge_project:
191
- rubygems_version: 2.0.0
194
+ rubygems_version: 2.0.3
192
195
  signing_key:
193
196
  specification_version: 4
194
197
  summary: Socialmux implements a strategy to add multiple social providers to the same
@@ -197,12 +200,14 @@ test_files:
197
200
  - spec/fixtures/facebook_response.json
198
201
  - spec/fixtures/github_response.json
199
202
  - spec/fixtures/google_response.json
203
+ - spec/fixtures/instagram_response.json
200
204
  - spec/fixtures/linkedin_response.json
201
205
  - spec/fixtures/twitter_response.json
202
206
  - spec/lib/.gitkeep
203
207
  - spec/lib/auth_mapper/facebook_spec.rb
204
208
  - spec/lib/auth_mapper/github_spec.rb
205
209
  - spec/lib/auth_mapper/google_oauth2_spec.rb
210
+ - spec/lib/auth_mapper/instagram_spec.rb
206
211
  - spec/lib/auth_mapper/linkedin_spec.rb
207
212
  - spec/lib/auth_mapper/twitter_spec.rb
208
213
  - spec/lib/auth_mapper_spec.rb
@@ -211,3 +216,4 @@ test_files:
211
216
  - spec/spec_helper.rb
212
217
  - spec/support/fixture_helpers.rb
213
218
  - spec/support/rspec_config.rb
219
+ has_rdoc: