socialmux 0.0.3 → 0.0.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: 02c380f10efb4669fa95201452f090749d29f2c9
4
- data.tar.gz: 61afe3b7bb7ef028e97cc38c36525471f1a9d42a
3
+ metadata.gz: 2faf70f83ed7c597f3ae72bce7d908dc6d911cc5
4
+ data.tar.gz: 82e42fd5ce81f56eeedbdcf431506aacaf78947e
5
5
  SHA512:
6
- metadata.gz: d04c27726d1a2130dcbd3ff9e46631af77883b21eed68da150e118b1a86f72d541e6f9ad3ef265f6222de95b36d19ba590c3e06e64bbef01854b0a85efe162ea
7
- data.tar.gz: 3440567c452161935b33a7107b5d5f9e12ee39c4ff037b7c33260ed112ab0105265f3653daac5f4f1cc314282c14f3b566c74f57189e3565b445cff07655b931
6
+ metadata.gz: 25153356f1813ea2b7fed1028f0fdbe30154a9e3113c85e505b40374f879a40ecbee1547f9da55bad9192f385bb56cf47ede471fa6a59859131fb53acc5ba89a
7
+ data.tar.gz: 84733413ac3b3d3c8e8d69087b0c06fb9100ada27754c1e9d9fd0d83a1a0cca80b6f81ffbb35f65fd1a4dd5c5d317ccb36ec25b711cb5baf318d67b3f7d79f88
@@ -1,5 +1,6 @@
1
1
  require 'hashie'
2
2
  require 'active_support/core_ext/module/delegation'
3
+ require 'socialmux/gender'
3
4
 
4
5
  module Socialmux
5
6
  module AuthMapper
@@ -19,6 +20,14 @@ module Socialmux
19
20
  def initialize(data)
20
21
  @data = Hashie::Mash.new(data)
21
22
  end
23
+
24
+ def url
25
+ info.urls.values.first
26
+ end
27
+
28
+ def gender
29
+ nil
30
+ end
22
31
  end
23
32
  end
24
33
  end
@@ -1,6 +1,16 @@
1
1
  module Socialmux
2
2
  module AuthMapper
3
3
  class Facebook < Base
4
+ def gender
5
+ case data.extra.raw_info["gender"]
6
+ when "male"
7
+ Gender::MALE
8
+ when "female"
9
+ Gender::FEMALE
10
+ else
11
+ nil
12
+ end
13
+ end
4
14
  end
5
15
  end
6
16
  end
@@ -1,6 +1,9 @@
1
1
  module Socialmux
2
2
  module AuthMapper
3
3
  class Github < GuessName
4
+ def url
5
+ info.urls["GitHub"]
6
+ end
4
7
  end
5
8
  end
6
9
  end
@@ -1,6 +1,16 @@
1
1
  module Socialmux
2
2
  module AuthMapper
3
3
  class GoogleOauth2 < Base
4
+ def gender
5
+ case data.extra.raw_info["gender"]
6
+ when "male"
7
+ Gender::MALE
8
+ when "female"
9
+ Gender::FEMALE
10
+ else
11
+ nil
12
+ end
13
+ end
4
14
  end
5
15
  end
6
16
  end
@@ -1,6 +1,9 @@
1
1
  module Socialmux
2
2
  module AuthMapper
3
3
  class Twitter < GuessName
4
+ def url
5
+ info.urls["Twitter"]
6
+ end
4
7
  end
5
8
  end
6
9
  end
@@ -0,0 +1,5 @@
1
+ module Gender
2
+ MALE = :male
3
+ FEMALE = :female
4
+ end
5
+
@@ -1,4 +1,4 @@
1
1
  module Socialmux
2
- VERSION = "0.0.3"
2
+ VERSION = "0.0.4"
3
3
  end
4
4
 
@@ -15,7 +15,7 @@
15
15
  "verified": true
16
16
  },
17
17
  "credentials": {
18
- "token": "CAAEFnHx42BIBAAl6OMh3HZC5y7MQ7AfAObg27UkrUCdx2YqSp651w6UMHvd6PrNJMEaBKE1dpb4oH152Ppq6OBsg56pnIWC0ZCYvRRO4JaCZBiW01uaDyXxLLc8O5mZBLpRpy8DyklJBGiGhplO6C4VkZCfkZBZCNUZD",
18
+ "token": "XXX",
19
19
  "expires_at": 1380465613,
20
20
  "expires": true
21
21
  },
@@ -12,7 +12,7 @@
12
12
  }
13
13
  },
14
14
  "credentials": {
15
- "token": "13a3342fedef375a62049c5b43bd1b93d602976e",
15
+ "token": "XXX",
16
16
  "expires": false
17
17
  },
18
18
  "extra": {
@@ -12,7 +12,7 @@
12
12
  }
13
13
  },
14
14
  "credentials": {
15
- "token": "ya29.AHES6ZS4zco44x0wdzotIcxR08dmOz9rlPjUb9BDcaNcRZFSkcroQQ",
15
+ "token": "XXX",
16
16
  "expires_at": 1375288165,
17
17
  "expires": true
18
18
  },
@@ -20,7 +20,7 @@
20
20
  }
21
21
  },
22
22
  "credentials": {
23
- "token": "AQWNmOocx29HFFuURNQLcryKvUsavFZAVdWF0qbQT5UjcHq53urDGqt5rLQt8Hj8U4bK7kiGh9U5vHAqTUWOxDOuy8uNpigdaqT-s5BIFQ1h-NM1MCopCjMqaQbleV8I6l1dJDH8MmHal9SGpPzAGySmhnWPbi7xrAbJvtmCyM2ncoSM05M",
23
+ "token": "XXX",
24
24
  "expires": false
25
25
  },
26
26
  "extra": {
@@ -13,8 +13,8 @@
13
13
  }
14
14
  },
15
15
  "credentials": {
16
- "token": "5521662-DmZYt2BwoWr9FxtyT3MlIt8DscTFJTSDmG0Qy3wU0",
17
- "secret": "PsRfrWeqdnZiWS4fHSot4SSOVe8WnQGdH6nutkXq0"
16
+ "token": "XXX",
17
+ "secret": "YYY"
18
18
  },
19
19
  "extra": {
20
20
  "access_token": {
@@ -12,6 +12,8 @@ module Socialmux::AuthMapper
12
12
  its(:last_name) { should eq "Verna" }
13
13
  its(:email) { should eq "stefano.verna@welaika.com" }
14
14
  its(:image) { should eq "http://graph.facebook.com/771417286/picture?type=square" }
15
+ its(:url) { should eq "https://www.facebook.com/stefano.verna" }
16
+ its(:gender) { should eq Gender::MALE }
15
17
  end
16
18
  end
17
19
 
@@ -12,6 +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://secure.gravatar.com/avatar/f1b1c16a5b246b3b7cff8d8a07aa9725?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-user-420.png" }
15
+ its(:url) { should eq "https://github.com/stefanoverna" }
16
+ its(:gender) { should be_nil }
15
17
  end
16
18
  end
17
19
 
@@ -12,6 +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" }
16
+ its(:gender) { should eq Gender::MALE }
15
17
  end
16
18
  end
17
19
 
@@ -13,6 +13,8 @@ module Socialmux::AuthMapper
13
13
  its(:email) { should eq "stefano.verna@gmail.com" }
14
14
  its(:image) { should eq "http://m.c.lnkd.licdn.com/mpr/mprx/0_dCvykIIfOoeQZqWUdXQ_keMhpEuE4-4UIhTikeHriWZsFnfR5k5KoHyO-G2vUzJBHTBCwfsBBN4N" }
15
15
  its(:description) { should eq "Software Engineer at weLaika" }
16
+ its(:url) { should eq "http://www.linkedin.com/in/stefanoverna" }
17
+ its(:gender) { should be_nil }
16
18
  end
17
19
  end
18
20
 
@@ -15,6 +15,8 @@ module Socialmux::AuthMapper
15
15
  its(:email) { should be nil }
16
16
  its(:image) { should eq "http://a0.twimg.com/profile_images/3060238387/a9b2a4cd85377cf0c12b22fedcac80b3_normal.png" }
17
17
  its(:description) { should eq "28 years, 2 babies, Rails and iOS developer, cofounder of @weLaika. Tweet me anytime! ♥" }
18
+ its(:url) { should eq "https://twitter.com/steffoz" }
19
+ its(:gender) { should be_nil }
18
20
  end
19
21
  end
20
22
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: socialmux
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stefano Verna
@@ -146,6 +146,7 @@ files:
146
146
  - lib/socialmux/auth_mapper/linkedin.rb
147
147
  - lib/socialmux/auth_mapper/twitter.rb
148
148
  - lib/socialmux/event.rb
149
+ - lib/socialmux/gender.rb
149
150
  - lib/socialmux/result.rb
150
151
  - lib/socialmux/strategy.rb
151
152
  - lib/socialmux/version.rb