fb_graph 2.6.2 → 2.6.3
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/Gemfile.lock +6 -6
- data/VERSION +1 -1
- data/fb_graph.gemspec +1 -1
- data/lib/fb_graph/age_range.rb +12 -0
- data/lib/fb_graph/application.rb +1 -0
- data/lib/fb_graph/auth/signed_request.rb +1 -1
- data/lib/fb_graph/device.rb +11 -0
- data/lib/fb_graph/exception.rb +1 -1
- data/lib/fb_graph/node.rb +1 -1
- data/lib/fb_graph/page.rb +4 -4
- data/lib/fb_graph/tagged_object.rb +1 -2
- data/lib/fb_graph/user.rb +31 -32
- data/lib/fb_graph.rb +2 -0
- data/spec/fb_graph/open_graph/action_spec.rb +1 -1
- data/spec/fb_graph/open_graph/object_spec.rb +1 -1
- data/spec/fb_graph/page_spec.rb +20 -1
- data/spec/fb_graph/tagged_object_spec.rb +1 -1
- data/spec/fb_graph/targeting_spec.rb +1 -1
- data/spec/fb_graph/user_spec.rb +163 -129
- metadata +8 -6
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
fb_graph (2.6.
|
4
|
+
fb_graph (2.6.3)
|
5
5
|
httpclient (>= 2.2.0.2)
|
6
6
|
multi_json (>= 1.3)
|
7
7
|
rack-oauth2 (>= 0.14.4)
|
@@ -37,7 +37,7 @@ GEM
|
|
37
37
|
crack (0.3.2)
|
38
38
|
diff-lcs (1.1.3)
|
39
39
|
erubis (2.7.0)
|
40
|
-
fb_graph-mock (0.0
|
40
|
+
fb_graph-mock (0.1.0)
|
41
41
|
fb_graph
|
42
42
|
rspec
|
43
43
|
webmock
|
@@ -47,8 +47,8 @@ GEM
|
|
47
47
|
i18n (0.6.1)
|
48
48
|
journey (1.0.4)
|
49
49
|
multi_json (1.5.0)
|
50
|
-
oj (2.0.
|
51
|
-
rack (1.4.
|
50
|
+
oj (2.0.2)
|
51
|
+
rack (1.4.4)
|
52
52
|
rack-cache (1.2)
|
53
53
|
rack (>= 0.4)
|
54
54
|
rack-oauth2 (1.0.0)
|
@@ -68,7 +68,7 @@ GEM
|
|
68
68
|
rspec-core (2.12.2)
|
69
69
|
rspec-expectations (2.12.1)
|
70
70
|
diff-lcs (~> 1.1.3)
|
71
|
-
rspec-mocks (2.12.
|
71
|
+
rspec-mocks (2.12.2)
|
72
72
|
sprockets (2.2.2)
|
73
73
|
hike (~> 1.2)
|
74
74
|
multi_json (~> 1.0)
|
@@ -88,7 +88,7 @@ DEPENDENCIES
|
|
88
88
|
actionpack (>= 3.0.6)
|
89
89
|
cover_me (>= 1.2.0)
|
90
90
|
fb_graph!
|
91
|
-
fb_graph-mock
|
91
|
+
fb_graph-mock (>= 0.1.0)
|
92
92
|
jruby-openssl (>= 0.7)
|
93
93
|
oj
|
94
94
|
rake (>= 0.8)
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
2.6.
|
1
|
+
2.6.3
|
data/fb_graph.gemspec
CHANGED
@@ -23,6 +23,6 @@ Gem::Specification.new do |s|
|
|
23
23
|
s.add_development_dependency "rcov", ">= 0.9"
|
24
24
|
end
|
25
25
|
s.add_development_dependency "rspec", ">= 2"
|
26
|
-
s.add_development_dependency "fb_graph-mock"
|
26
|
+
s.add_development_dependency "fb_graph-mock", ">= 0.1.0"
|
27
27
|
s.add_development_dependency "actionpack", ">= 3.0.6"
|
28
28
|
end
|
data/lib/fb_graph/application.rb
CHANGED
@@ -96,6 +96,7 @@ module FbGraph
|
|
96
96
|
auth = Auth.new(self.identifier, self.secret)
|
97
97
|
self.access_token = auth.client.access_token! :client_auth_body
|
98
98
|
end
|
99
|
+
alias_method :app_access_token, :get_access_token
|
99
100
|
|
100
101
|
def access_token_with_auto_fetch
|
101
102
|
access_token_without_auto_fetch ||
|
data/lib/fb_graph/exception.rb
CHANGED
@@ -81,7 +81,7 @@ module FbGraph
|
|
81
81
|
def initialize(code, message, body = '')
|
82
82
|
@code = code
|
83
83
|
if body.present?
|
84
|
-
response = MultiJson
|
84
|
+
response = MultiJson.load(body).with_indifferent_access
|
85
85
|
message = response[:error][:message]
|
86
86
|
@type = response[:error][:type]
|
87
87
|
end
|
data/lib/fb_graph/node.rb
CHANGED
@@ -135,7 +135,7 @@ module FbGraph
|
|
135
135
|
when 'null'
|
136
136
|
nil
|
137
137
|
else
|
138
|
-
_response_ = MultiJson
|
138
|
+
_response_ = MultiJson.load(response.body).with_indifferent_access
|
139
139
|
if (200...300).include?(response.status)
|
140
140
|
_response_
|
141
141
|
else
|
data/lib/fb_graph/page.rb
CHANGED
@@ -46,11 +46,11 @@ module FbGraph
|
|
46
46
|
end
|
47
47
|
end
|
48
48
|
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
get({:fields => "access_token"})["access_token"]
|
49
|
+
def get_access_token(options = {})
|
50
|
+
access_token = get options.merge(:fields => "access_token")
|
51
|
+
self.access_token = Rack::OAuth2::AccessToken::Legacy.new access_token
|
53
52
|
end
|
53
|
+
alias_method :page_access_token, :get_access_token
|
54
54
|
end
|
55
55
|
end
|
56
56
|
|
@@ -1,10 +1,9 @@
|
|
1
1
|
module FbGraph
|
2
2
|
class TaggedObject < Node
|
3
|
-
attr_accessor :name, :offset, :length
|
3
|
+
attr_accessor :name, :offset, :length
|
4
4
|
|
5
5
|
def initialize(identifier, attributes = {})
|
6
6
|
super
|
7
|
-
@raw_attributes = attributes
|
8
7
|
[:name, :offset, :length].each do |key|
|
9
8
|
self.send("#{key}=", attributes[key])
|
10
9
|
end
|
data/lib/fb_graph/user.rb
CHANGED
@@ -46,35 +46,40 @@ module FbGraph
|
|
46
46
|
include OpenGraph::UserContext
|
47
47
|
extend Searchable
|
48
48
|
|
49
|
-
|
49
|
+
@@attributes = {
|
50
|
+
:raw => [
|
51
|
+
:name, :first_name, :middle_name, :last_name, :gender,
|
52
|
+
:locale, :link, :username, :third_party_id, :timezone,
|
53
|
+
:verified, :about, :bio, :email, :political, :quotes,
|
54
|
+
:relationship_status, :relationship, :video_upload_limits,
|
55
|
+
:website, :mobile_phone, :installed, :rsvp_status,
|
56
|
+
:security_settings, :currency, :religion
|
57
|
+
],
|
58
|
+
:custom => [
|
59
|
+
:languages, :like_count, :updated_time,
|
60
|
+
:birthday, :education, :hometown, :interested_in, :location,
|
61
|
+
:favorite_teams, :age_range, :significant_other,
|
62
|
+
:work, :devices, :sports, :favorite_athletes, :inspirational_people,
|
63
|
+
:address, :mobile_phone
|
64
|
+
]
|
65
|
+
}
|
50
66
|
|
51
|
-
|
52
|
-
attr_accessor :sports, :favorite_athletes, :inspirational_people, :address, :mobile_phone, :installed, :rsvp_status
|
67
|
+
attr_accessor *@@attributes.values.flatten
|
53
68
|
|
54
69
|
def initialize(identifier, attributes = {})
|
55
70
|
super
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
@last_name = attributes[:last_name]
|
60
|
-
@gender = attributes[:gender]
|
61
|
-
@locale = attributes[:locale]
|
71
|
+
@@attributes[:raw].each do |key|
|
72
|
+
self.send :"#{key}=", attributes[key]
|
73
|
+
end
|
62
74
|
@languages = []
|
63
75
|
if attributes[:languages]
|
64
76
|
attributes[:languages].each do |language|
|
65
77
|
@languages << Page.new(language[:id], language)
|
66
78
|
end
|
67
79
|
end
|
68
|
-
@link = attributes[:link]
|
69
|
-
@username = attributes[:username]
|
70
|
-
@third_party_id = attributes[:third_party_id]
|
71
|
-
@timezone = attributes[:timezone]
|
72
80
|
if attributes[:updated_time]
|
73
81
|
@updated_time = Time.parse(attributes[:updated_time]).utc
|
74
82
|
end
|
75
|
-
@verified = attributes[:verified]
|
76
|
-
@about = attributes[:about]
|
77
|
-
@bio = attributes[:bio]
|
78
83
|
if attributes[:birthday]
|
79
84
|
month, day, year = attributes[:birthday].split('/').collect(&:to_i)
|
80
85
|
year ||= 0
|
@@ -86,7 +91,6 @@ module FbGraph
|
|
86
91
|
@education << Education.new(education)
|
87
92
|
end
|
88
93
|
end
|
89
|
-
@email = attributes[:email]
|
90
94
|
if (hometown = attributes[:hometown])
|
91
95
|
@hometown = Page.new(hometown[:id], hometown)
|
92
96
|
end
|
@@ -94,32 +98,31 @@ module FbGraph
|
|
94
98
|
if (location = attributes[:location])
|
95
99
|
@location = Page.new(location[:id], location)
|
96
100
|
end
|
97
|
-
@political = attributes[:political]
|
98
101
|
@favorite_teams = []
|
99
102
|
if attributes[:favorite_teams]
|
100
103
|
attributes[:favorite_teams].each do |favorite_team|
|
101
104
|
@favorite_teams << Page.new(favorite_team[:id], favorite_team)
|
102
105
|
end
|
103
106
|
end
|
104
|
-
@quotes = attributes[:quotes]
|
105
|
-
@relationship_status = attributes[:relationship_status]
|
106
|
-
@religion = attributes[:religion]
|
107
107
|
if (significant_other = attributes[:significant_other])
|
108
108
|
@significant_other = User.new(significant_other[:id], significant_other)
|
109
109
|
end
|
110
|
-
# If this user was build from the family connection, set the relationship type
|
111
|
-
@relationship = attributes[:relationship]
|
112
|
-
# NOTE: couldn't find "video_upload_limits" in the response..
|
113
|
-
# @video_upload_limits = ??
|
114
|
-
@website = attributes[:website]
|
115
110
|
@work = []
|
116
111
|
if attributes[:work]
|
117
112
|
attributes[:work].each do |work|
|
118
113
|
@work << Work.new(work)
|
119
114
|
end
|
120
115
|
end
|
121
|
-
|
122
|
-
|
116
|
+
@devices = []
|
117
|
+
if attributes[:devices]
|
118
|
+
attributes[:devices].each do |device|
|
119
|
+
@devices << Device.new(device)
|
120
|
+
end
|
121
|
+
end
|
122
|
+
@security_settings = attributes[:security_settings]
|
123
|
+
if attributes[:age_range]
|
124
|
+
@age_range = AgeRange.new(attributes[:age_range])
|
125
|
+
end
|
123
126
|
@sports = []
|
124
127
|
if (sports = attributes[:sports])
|
125
128
|
sports.each do |sport|
|
@@ -141,14 +144,10 @@ module FbGraph
|
|
141
144
|
if attributes[:address]
|
142
145
|
@address = Venue.new(attributes[:address])
|
143
146
|
end
|
144
|
-
@mobile_phone = attributes[:mobile_phone]
|
145
|
-
@installed = attributes[:installed]
|
146
|
-
@rsvp_status = attributes[:rsvp_status]
|
147
147
|
end
|
148
148
|
|
149
149
|
def self.me(access_token)
|
150
150
|
new('me', :access_token => access_token)
|
151
151
|
end
|
152
|
-
|
153
152
|
end
|
154
153
|
end
|
data/lib/fb_graph.rb
CHANGED
@@ -5,7 +5,7 @@ describe FbGraph::OpenGraph::Action do
|
|
5
5
|
FbGraph::OpenGraph::Action.new attributes[:id], attributes
|
6
6
|
end
|
7
7
|
let :attributes do
|
8
|
-
MultiJson
|
8
|
+
MultiJson.load(json).with_indifferent_access
|
9
9
|
end
|
10
10
|
shared_examples_for :og_action_initialized do
|
11
11
|
its(:from) do
|
data/spec/fb_graph/page_spec.rb
CHANGED
@@ -51,7 +51,7 @@ describe FbGraph::Page do
|
|
51
51
|
context 'when access_token field fetched' do
|
52
52
|
subject do
|
53
53
|
mock_graph :get, 'my_page', 'pages/with_token', :access_token => 'user_token', :params => {
|
54
|
-
:fields =>
|
54
|
+
:fields => 'access_token'
|
55
55
|
} do
|
56
56
|
FbGraph::Page.fetch('my_page', :fields => :access_token, :access_token => 'user_token')
|
57
57
|
end
|
@@ -59,4 +59,23 @@ describe FbGraph::Page do
|
|
59
59
|
its(:access_token) { should == 'page_token' }
|
60
60
|
end
|
61
61
|
end
|
62
|
+
|
63
|
+
describe '#get_access_token' do
|
64
|
+
it 'should specify fields=access_token' do
|
65
|
+
expect do
|
66
|
+
FbGraph::Page.new('FbGraph').page_access_token
|
67
|
+
end.to request_to 'FbGraph?fields=access_token', :GET
|
68
|
+
end
|
69
|
+
|
70
|
+
it 'should return Rack::OAuth2::AccessToken::Legacy' do
|
71
|
+
mock_graph :get, 'page_id', 'pages/with_token', :access_token => 'user_token', :params => {
|
72
|
+
:fields => 'access_token'
|
73
|
+
} do
|
74
|
+
page = FbGraph::Page.new('page_id', :access_token => 'user_token')
|
75
|
+
page_token = page.get_access_token
|
76
|
+
page_token.should be_instance_of Rack::OAuth2::AccessToken::Legacy
|
77
|
+
page.access_token.should == page_token
|
78
|
+
end
|
79
|
+
end
|
80
|
+
end
|
62
81
|
end
|
@@ -25,7 +25,7 @@ describe FbGraph::Targeting, '.to_json' do
|
|
25
25
|
:region => 'Tokyo'
|
26
26
|
}
|
27
27
|
targeting = FbGraph::Targeting.new(attributes)
|
28
|
-
hash = MultiJson
|
28
|
+
hash = MultiJson.load(targeting.to_json).with_indifferent_access
|
29
29
|
hash[:country].should == attributes[:country]
|
30
30
|
hash[:city].should == attributes[:city]
|
31
31
|
hash[:locale].should == attributes[:locale]
|
data/spec/fb_graph/user_spec.rb
CHANGED
@@ -1,150 +1,184 @@
|
|
1
1
|
require 'spec_helper'
|
2
2
|
|
3
|
-
describe FbGraph::User
|
4
|
-
|
5
|
-
attributes
|
6
|
-
|
7
|
-
|
8
|
-
:
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
3
|
+
describe FbGraph::User do
|
4
|
+
describe '.new' do
|
5
|
+
it 'should setup all supported attributes' do
|
6
|
+
attributes = {
|
7
|
+
:id => '12345',
|
8
|
+
:address => {
|
9
|
+
:city => "Kawasaki",
|
10
|
+
:state => "Kanagawa",
|
11
|
+
:country => "Japan"
|
12
|
+
},
|
13
|
+
:mobile_phone => '810000000000',
|
14
|
+
:installed => true
|
15
|
+
}
|
16
|
+
user = FbGraph::User.new(attributes.delete(:id), attributes)
|
17
|
+
user.address.should == FbGraph::Venue.new(attributes[:address])
|
18
|
+
user.mobile_phone.should == '810000000000'
|
19
|
+
user.installed.should be_true
|
20
|
+
end
|
21
|
+
|
22
|
+
it 'should support year-hidden birthday' do
|
23
|
+
user = FbGraph::User.new(12345, :birthday => '12/13')
|
24
|
+
user.birthday.year.should == 0
|
25
|
+
user.birthday.month.should == 12
|
26
|
+
user.birthday.day.should == 13
|
27
|
+
end
|
28
|
+
|
29
|
+
it 'should support non-default fields' do
|
30
|
+
mock_graph :get, 'me', 'users/with_non_default_fields', :access_token => 'access_token', :params => {
|
31
|
+
:fields => 'devices, video_upload_limits, age_range, currency'
|
32
|
+
} do
|
33
|
+
me = FbGraph::User.me('access_token').fetch(:fields => 'devices, video_upload_limits, age_range, currency')
|
34
|
+
|
35
|
+
# devices
|
36
|
+
me.devices.should be_instance_of Array
|
37
|
+
me.devices.each do |device|
|
38
|
+
device.should be_instance_of FbGraph::Device
|
39
|
+
end
|
40
|
+
me.devices.should == [FbGraph::Device.new(:os => 'iOS', :hardware => 'iPhone')]
|
20
41
|
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
42
|
+
# video_upload_limits
|
43
|
+
me.video_upload_limits.should be_instance_of ActiveSupport::HashWithIndifferentAccess
|
44
|
+
me.video_upload_limits.should == {'length' => 1200, 'size' => 1073741824}
|
45
|
+
|
46
|
+
# age_range
|
47
|
+
me.age_range.should be_instance_of FbGraph::AgeRange
|
48
|
+
me.age_range.should == (21..FbGraph::AgeRange::DEFAULT_MAX_AGE)
|
49
|
+
|
50
|
+
# currency
|
51
|
+
me.currency.should be_instance_of ActiveSupport::HashWithIndifferentAccess
|
52
|
+
me.currency.should == {
|
53
|
+
'user_currency' => 'JPY',
|
54
|
+
'currency_exchange' => 0.10846341,
|
55
|
+
'currency_exchange_inverse' => 9.2196990672,
|
56
|
+
'currency_offset' => 1
|
57
|
+
}
|
58
|
+
end
|
59
|
+
end
|
26
60
|
end
|
27
|
-
end
|
28
61
|
|
29
|
-
describe
|
30
|
-
|
31
|
-
|
62
|
+
describe '.me' do
|
63
|
+
it 'should return FbGraph::User instance with access_token' do
|
64
|
+
FbGraph::User.me('access_token').should == FbGraph::User.new('me', :access_token => 'access_token')
|
65
|
+
end
|
32
66
|
end
|
33
|
-
end
|
34
67
|
|
35
|
-
describe
|
36
|
-
|
68
|
+
describe '.fetch' do
|
69
|
+
context 'with me context' do
|
37
70
|
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
71
|
+
context 'when no access_token given' do
|
72
|
+
it 'should raise FbGraph::Unauthorized' do
|
73
|
+
mock_graph :get, 'me', 'users/me_public', :status => [401, 'Unauthorized'] do
|
74
|
+
lambda do
|
75
|
+
FbGraph::User.fetch('me')
|
76
|
+
end.should raise_exception(FbGraph::Unauthorized)
|
77
|
+
end
|
44
78
|
end
|
45
79
|
end
|
46
|
-
end
|
47
80
|
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
81
|
+
context 'when access_token given' do
|
82
|
+
it 'should get current user profile' do
|
83
|
+
mock_graph :get, 'me', 'users/me_private', :access_token => 'access_token' do
|
84
|
+
user = FbGraph::User.me('access_token').fetch
|
85
|
+
user.interested_in.should == ['female']
|
86
|
+
user.relationship_status.should == 'Married'
|
87
|
+
user.website.should == 'http://matake.jp'
|
88
|
+
user.religion.should be_nil
|
89
|
+
user.political.should be_nil
|
90
|
+
user.timezone.should == 9
|
91
|
+
user.verified.should be_true
|
92
|
+
end
|
59
93
|
end
|
60
94
|
end
|
61
|
-
end
|
62
95
|
|
63
|
-
|
96
|
+
end
|
64
97
|
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
98
|
+
context 'when no access_token given' do
|
99
|
+
it 'should get only public profile' do
|
100
|
+
mock_graph :get, 'arjun', 'users/arjun_public' do
|
101
|
+
user = FbGraph::User.fetch('arjun')
|
102
|
+
user.name.should == 'Arjun Banker'
|
103
|
+
user.first_name.should == 'Arjun'
|
104
|
+
user.last_name.should == 'Banker'
|
105
|
+
user.identifier.should == '7901103'
|
106
|
+
user.link.should == 'http://www.facebook.com/Arjun'
|
107
|
+
user.location.should == FbGraph::Page.new(114952118516947, :name => 'San Francisco, California')
|
108
|
+
user.gender.should == 'male'
|
109
|
+
end
|
76
110
|
end
|
77
111
|
end
|
78
|
-
end
|
79
112
|
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
113
|
+
context 'when access_token given' do
|
114
|
+
it 'should get public + private profile' do
|
115
|
+
mock_graph :get, 'arjun', 'users/arjun_private', :access_token => 'access_token' do
|
116
|
+
user = FbGraph::User.fetch('arjun', :access_token => 'access_token')
|
117
|
+
|
118
|
+
# public
|
119
|
+
user.name.should == 'Arjun Banker'
|
120
|
+
user.first_name.should == 'Arjun'
|
121
|
+
user.last_name.should == 'Banker'
|
122
|
+
user.identifier.should == '7901103'
|
123
|
+
user.link.should == 'http://www.facebook.com/Arjun'
|
124
|
+
user.location.should == FbGraph::Page.new(114952118516947, :name => 'San Francisco, California')
|
125
|
+
user.gender.should == 'male'
|
126
|
+
|
127
|
+
# private
|
128
|
+
user.about.should == 'daydrea'
|
129
|
+
user.birthday.should == Date.strptime("04/15/1984", "%m/%d/%Y")
|
130
|
+
user.work.should == [
|
131
|
+
FbGraph::Work.new({
|
132
|
+
:employer => {:name => 'Facebook', :id => 20531316728},
|
133
|
+
:position => {:name => 'Software Engineer', :id => 107879555911138},
|
134
|
+
:location => {:name => 'Palo Alto, California', :id => 104022926303756},
|
135
|
+
:start_date => '2007-11'
|
136
|
+
}),
|
137
|
+
FbGraph::Work.new({
|
138
|
+
:employer => {:name => 'Zillow', :id => 113816405300191},
|
139
|
+
:position => {:name => 'Business Intelligence Analyst', :id => 105918922782444},
|
140
|
+
:start_date => '2006-03',
|
141
|
+
:end_date => '2007-10'
|
142
|
+
}),
|
143
|
+
FbGraph::Work.new({
|
144
|
+
:employer => {:name => 'Microsoft', :id => 20528438720},
|
145
|
+
:position => {:name => 'SDET', :id => 110006949022640},
|
146
|
+
:start_date => '2004-08',
|
147
|
+
:end_date => '2006-03'
|
148
|
+
}),
|
149
|
+
FbGraph::Work.new({
|
150
|
+
:employer => {:name => 'Dell', :id => 7706457055},
|
151
|
+
:position => {:name => 'Programmer Analyst', :id => 110344568993267},
|
152
|
+
:start_date => '2003-06',
|
153
|
+
:end_date => '2004-07'
|
154
|
+
})
|
155
|
+
]
|
156
|
+
user.education.should == [
|
157
|
+
FbGraph::Education.new({
|
158
|
+
:school => {:name => 'Texas Academy Of Math And Science', :id => 107922345906866},
|
159
|
+
:year => {:name => '2001', :id => 102241906483610}
|
160
|
+
}),
|
161
|
+
FbGraph::Education.new({
|
162
|
+
:school => {:name => 'The University of Texas at Austin', :id => 24147741537},
|
163
|
+
:year => {:name => '2003', :id => 108077232558120},
|
164
|
+
:concentration => [
|
165
|
+
{:name => 'Computer Science', :id => 116831821660155}
|
166
|
+
]
|
167
|
+
})
|
168
|
+
]
|
169
|
+
user.email.should == nil
|
170
|
+
user.website.should == nil
|
171
|
+
user.hometown.should == FbGraph::Page.new(109533479072558, :name => 'Minnetonka, Minnesota')
|
172
|
+
user.interested_in.should == ['female']
|
173
|
+
user.relationship_status.should == 'In a Relationship'
|
174
|
+
user.religion.should == 'zorp'
|
175
|
+
user.political.should == 'Liberal'
|
176
|
+
user.verified.should be_nil
|
177
|
+
# What's this?
|
178
|
+
# user.significant_other
|
179
|
+
user.timezone.should be_nil
|
180
|
+
user.updated_time.should == Time.parse('2010-05-29T04:29:23+0000')
|
181
|
+
end
|
148
182
|
end
|
149
183
|
end
|
150
184
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fb_graph
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.6.
|
4
|
+
version: 2.6.3
|
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-01-
|
12
|
+
date: 2013-01-29 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: httpclient
|
@@ -130,7 +130,7 @@ dependencies:
|
|
130
130
|
requirements:
|
131
131
|
- - ! '>='
|
132
132
|
- !ruby/object:Gem::Version
|
133
|
-
version:
|
133
|
+
version: 0.1.0
|
134
134
|
type: :development
|
135
135
|
prerelease: false
|
136
136
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -138,7 +138,7 @@ dependencies:
|
|
138
138
|
requirements:
|
139
139
|
- - ! '>='
|
140
140
|
- !ruby/object:Gem::Version
|
141
|
-
version:
|
141
|
+
version: 0.1.0
|
142
142
|
- !ruby/object:Gem::Dependency
|
143
143
|
name: actionpack
|
144
144
|
requirement: !ruby/object:Gem::Requirement
|
@@ -191,6 +191,7 @@ files:
|
|
191
191
|
- lib/fb_graph/ad_keyword_valid.rb
|
192
192
|
- lib/fb_graph/ad_preview.rb
|
193
193
|
- lib/fb_graph/ad_user.rb
|
194
|
+
- lib/fb_graph/age_range.rb
|
194
195
|
- lib/fb_graph/album.rb
|
195
196
|
- lib/fb_graph/app_request.rb
|
196
197
|
- lib/fb_graph/application.rb
|
@@ -288,6 +289,7 @@ files:
|
|
288
289
|
- lib/fb_graph/connections/votes.rb
|
289
290
|
- lib/fb_graph/cover.rb
|
290
291
|
- lib/fb_graph/debugger.rb
|
292
|
+
- lib/fb_graph/device.rb
|
291
293
|
- lib/fb_graph/doc.rb
|
292
294
|
- lib/fb_graph/domain.rb
|
293
295
|
- lib/fb_graph/education.rb
|
@@ -522,7 +524,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
522
524
|
version: '0'
|
523
525
|
segments:
|
524
526
|
- 0
|
525
|
-
hash:
|
527
|
+
hash: 1720782367254273780
|
526
528
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
527
529
|
none: false
|
528
530
|
requirements:
|
@@ -531,7 +533,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
531
533
|
version: '0'
|
532
534
|
segments:
|
533
535
|
- 0
|
534
|
-
hash:
|
536
|
+
hash: 1720782367254273780
|
535
537
|
requirements: []
|
536
538
|
rubyforge_project:
|
537
539
|
rubygems_version: 1.8.24
|