social_profile 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.
data/.gitignore CHANGED
@@ -15,3 +15,4 @@ spec/reports
15
15
  test/tmp
16
16
  test/version_tmp
17
17
  tmp
18
+ .versions.conf
@@ -54,6 +54,10 @@ module SocialProfile
54
54
  def info?
55
55
  auth_hash['info'] && auth_hash['info'].is_a?(Hash)
56
56
  end
57
+
58
+ def works?
59
+ false
60
+ end
57
61
 
58
62
  def avatar_url
59
63
  @avatar_url ||= info('image')
@@ -1,4 +1,5 @@
1
1
  # encoding: utf-8
2
+
2
3
  module SocialProfile
3
4
  module Providers
4
5
  class Facebook < Base
@@ -37,6 +38,15 @@ module SocialProfile
37
38
  nil
38
39
  end
39
40
  end
41
+
42
+ def works?
43
+ raw_info? && extra('raw_info')['work'] && extra('raw_info')['work'].is_a?(Array)
44
+ end
45
+
46
+ def works
47
+ return [] unless works?
48
+ @works ||= extra('raw_info')['work']
49
+ end
40
50
 
41
51
  protected
42
52
 
@@ -50,6 +60,9 @@ module SocialProfile
50
60
  end
51
61
  end
52
62
 
63
+ def raw_info?
64
+ extra('raw_info') && extra('raw_info').is_a?(Hash)
65
+ end
53
66
  end
54
67
  end
55
68
  end
@@ -1,4 +1,4 @@
1
1
  # encoding: utf-8
2
2
  module SocialProfile
3
- VERSION = "0.1.3"
3
+ VERSION = "0.1.4"
4
4
  end
@@ -22,6 +22,8 @@ describe SocialProfile::Providers::Facebook do
22
22
  @profile.picture_url.should == "http://profile.ak.fbcdn.net/hprofile-ak-prn1/41634_100000730417342_973_n.jpg"
23
23
  @profile.gender.should == 2
24
24
  @profile.profile_url.should == "http://www.facebook.com/pavel.galeta"
25
+ @profile.works.should == []
26
+ @profile.works?.should == true
25
27
  end
26
28
  end
27
29
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: social_profile
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.4
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-04-30 00:00:00.000000000 Z
12
+ date: 2013-09-24 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler