fb_graph 2.6.0 → 2.6.1
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile.lock +14 -14
- data/VERSION +1 -1
- data/fb_graph.gemspec +1 -1
- data/lib/fb_graph/ad_connection_object.rb +18 -3
- data/spec/fb_graph/ad_connection_object_spec.rb +40 -1
- metadata +6 -6
data/Gemfile.lock
CHANGED
@@ -1,18 +1,18 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
fb_graph (2.6.
|
4
|
+
fb_graph (2.6.1)
|
5
5
|
httpclient (>= 2.2.0.2)
|
6
|
-
multi_json
|
6
|
+
multi_json (>= 1.3)
|
7
7
|
rack-oauth2 (>= 0.14.4)
|
8
8
|
tzinfo
|
9
9
|
|
10
10
|
GEM
|
11
11
|
remote: http://rubygems.org/
|
12
12
|
specs:
|
13
|
-
actionpack (3.2.
|
14
|
-
activemodel (= 3.2.
|
15
|
-
activesupport (= 3.2.
|
13
|
+
actionpack (3.2.11)
|
14
|
+
activemodel (= 3.2.11)
|
15
|
+
activesupport (= 3.2.11)
|
16
16
|
builder (~> 3.0.0)
|
17
17
|
erubis (~> 2.7.0)
|
18
18
|
journey (~> 1.0.4)
|
@@ -20,10 +20,10 @@ GEM
|
|
20
20
|
rack-cache (~> 1.2)
|
21
21
|
rack-test (~> 0.6.1)
|
22
22
|
sprockets (~> 2.2.1)
|
23
|
-
activemodel (3.2.
|
24
|
-
activesupport (= 3.2.
|
23
|
+
activemodel (3.2.11)
|
24
|
+
activesupport (= 3.2.11)
|
25
25
|
builder (~> 3.0.0)
|
26
|
-
activesupport (3.2.
|
26
|
+
activesupport (3.2.11)
|
27
27
|
i18n (~> 0.6)
|
28
28
|
multi_json (~> 1.0)
|
29
29
|
addressable (2.3.2)
|
@@ -34,7 +34,7 @@ GEM
|
|
34
34
|
cover_me (1.2.0)
|
35
35
|
configatron
|
36
36
|
hashie
|
37
|
-
crack (0.3.
|
37
|
+
crack (0.3.2)
|
38
38
|
diff-lcs (1.1.3)
|
39
39
|
erubis (2.7.0)
|
40
40
|
fb_graph-mock (0.0.3)
|
@@ -43,12 +43,12 @@ GEM
|
|
43
43
|
webmock
|
44
44
|
hashie (1.2.0)
|
45
45
|
hike (1.2.1)
|
46
|
-
httpclient (2.3.
|
46
|
+
httpclient (2.3.2)
|
47
47
|
i18n (0.6.1)
|
48
48
|
journey (1.0.4)
|
49
49
|
multi_json (1.5.0)
|
50
|
-
oj (
|
51
|
-
rack (1.4.
|
50
|
+
oj (2.0.0)
|
51
|
+
rack (1.4.3)
|
52
52
|
rack-cache (1.2)
|
53
53
|
rack (>= 0.4)
|
54
54
|
rack-oauth2 (1.0.0)
|
@@ -66,9 +66,9 @@ GEM
|
|
66
66
|
rspec-expectations (~> 2.12.0)
|
67
67
|
rspec-mocks (~> 2.12.0)
|
68
68
|
rspec-core (2.12.2)
|
69
|
-
rspec-expectations (2.12.
|
69
|
+
rspec-expectations (2.12.1)
|
70
70
|
diff-lcs (~> 1.1.3)
|
71
|
-
rspec-mocks (2.12.
|
71
|
+
rspec-mocks (2.12.1)
|
72
72
|
sprockets (2.2.2)
|
73
73
|
hike (~> 1.2)
|
74
74
|
multi_json (~> 1.0)
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
2.6.
|
1
|
+
2.6.1
|
data/fb_graph.gemspec
CHANGED
@@ -15,7 +15,7 @@ Gem::Specification.new do |s|
|
|
15
15
|
s.add_runtime_dependency "httpclient", ">= 2.2.0.2"
|
16
16
|
s.add_runtime_dependency "rack-oauth2", ">= 0.14.4"
|
17
17
|
s.add_runtime_dependency "tzinfo"
|
18
|
-
s.add_runtime_dependency "multi_json"
|
18
|
+
s.add_runtime_dependency "multi_json", ">= 1.3"
|
19
19
|
s.add_development_dependency "rake", ">= 0.8"
|
20
20
|
if RUBY_VERSION >= '1.9'
|
21
21
|
s.add_development_dependency "cover_me", ">= 1.2.0"
|
@@ -1,6 +1,6 @@
|
|
1
1
|
module FbGraph
|
2
2
|
class AdConnectionObject < Node
|
3
|
-
attr_accessor :name, :url, :type, :tabs, :picture, :object
|
3
|
+
attr_accessor :name, :url, :type, :tabs, :picture, :object, :is_game, :og_actions, :og_namespace, :og_objects, :supported_platforms
|
4
4
|
|
5
5
|
TYPES = {
|
6
6
|
:page => 1,
|
@@ -9,13 +9,28 @@ module FbGraph
|
|
9
9
|
:place => 6,
|
10
10
|
:domain => 7
|
11
11
|
}
|
12
|
-
|
12
|
+
|
13
|
+
SUPPORTED_PLATFORM_TYPES = {
|
14
|
+
:web => 1,
|
15
|
+
:canvas => 2,
|
16
|
+
:mobile_web => 3,
|
17
|
+
:iphone => 4,
|
18
|
+
:ipad => 5,
|
19
|
+
:android => 6
|
20
|
+
}
|
21
|
+
|
13
22
|
def initialize(identifier, attributes = {})
|
14
23
|
super
|
15
24
|
|
16
25
|
%w(name url type tabs picture).each do |field|
|
17
26
|
send("#{field}=", attributes[field.to_sym])
|
18
27
|
end
|
28
|
+
|
29
|
+
if self.type == TYPES[:application]
|
30
|
+
%w(is_game og_actions og_namespace og_objects supported_platforms).each do |field|
|
31
|
+
send("#{field}=", attributes[field.to_sym])
|
32
|
+
end
|
33
|
+
end
|
19
34
|
|
20
35
|
self.object = if page?
|
21
36
|
FbGraph::Page.new(identifier)
|
@@ -35,4 +50,4 @@ module FbGraph
|
|
35
50
|
define_method("#{object_type}?") { type == TYPES[object_type] }
|
36
51
|
end
|
37
52
|
end
|
38
|
-
end
|
53
|
+
end
|
@@ -16,7 +16,7 @@ describe FbGraph::AdConnectionObject, '.new' do
|
|
16
16
|
"http://www.facebook.com/MyPage?sk=app_2373072222" => "Discussions"
|
17
17
|
},
|
18
18
|
:picture => "http://profile.ak.fbcdn.net/hprofile-ak-snc4/41591_354545238178_3195000_s.jpg"
|
19
|
-
}
|
19
|
+
}
|
20
20
|
ad_connection = FbGraph::AdConnectionObject.new(attributes.delete(:id), attributes)
|
21
21
|
ad_connection.identifier.should == 354545238888
|
22
22
|
ad_connection.name.should == "MyPage"
|
@@ -28,5 +28,44 @@ describe FbGraph::AdConnectionObject, '.new' do
|
|
28
28
|
ad_connection.picture.should == "http://profile.ak.fbcdn.net/hprofile-ak-snc4/41591_354545238178_3195000_s.jpg"
|
29
29
|
ad_connection.tabs.should be_instance_of(Hash)
|
30
30
|
ad_connection.tabs["http://www.facebook.com/MyPage?sk=wall"].should == "Wall"
|
31
|
+
|
32
|
+
application_attributes = {
|
33
|
+
:id => 354545238889,
|
34
|
+
:is_game => false,
|
35
|
+
:name => "MyApp",
|
36
|
+
:og_actions => [{
|
37
|
+
:connected_objects => ["planes"],
|
38
|
+
:display_name => "Yaw",
|
39
|
+
:name => "app_name_space:yaw",
|
40
|
+
:properties => []
|
41
|
+
}],
|
42
|
+
:og_namespace => "app_name_space",
|
43
|
+
:og_objects => [{
|
44
|
+
:display_name => "Plane",
|
45
|
+
:name => "planes",
|
46
|
+
:properties => []
|
47
|
+
}],
|
48
|
+
:picture => "https://fbcdn-profile-a.akamaihd.net/static-ak/rsrc.php/v1/y0/r/XsEg9L6Ie5_.jpg",
|
49
|
+
:supported_platforms => [2],
|
50
|
+
:tabs => [],
|
51
|
+
:type => 2,
|
52
|
+
:url => "http://apps.facebook.com/test_app/"
|
53
|
+
}
|
54
|
+
|
55
|
+
ad_connection = FbGraph::AdConnectionObject.new(application_attributes.delete(:id), application_attributes)
|
56
|
+
ad_connection.identifier.should == 354545238889
|
57
|
+
ad_connection.is_game.should == false
|
58
|
+
ad_connection.name.should == "MyApp"
|
59
|
+
ad_connection.og_actions.should be_instance_of(Array)
|
60
|
+
ad_connection.og_actions.first.should be_instance_of(Hash)
|
61
|
+
ad_connection.og_namespace.should == "app_name_space"
|
62
|
+
ad_connection.og_objects.should be_instance_of(Array)
|
63
|
+
ad_connection.og_objects.first.should be_instance_of(Hash)
|
64
|
+
ad_connection.object.identifier.should == 354545238889
|
65
|
+
ad_connection.picture.should == "https://fbcdn-profile-a.akamaihd.net/static-ak/rsrc.php/v1/y0/r/XsEg9L6Ie5_.jpg"
|
66
|
+
ad_connection.supported_platforms.should == [2]
|
67
|
+
ad_connection.tabs.should == []
|
68
|
+
ad_connection.type.should == 2
|
69
|
+
ad_connection.url.should == "http://apps.facebook.com/test_app/"
|
31
70
|
end
|
32
71
|
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.1
|
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:
|
12
|
+
date: 2013-01-10 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: httpclient
|
@@ -66,7 +66,7 @@ dependencies:
|
|
66
66
|
requirements:
|
67
67
|
- - ! '>='
|
68
68
|
- !ruby/object:Gem::Version
|
69
|
-
version: '
|
69
|
+
version: '1.3'
|
70
70
|
type: :runtime
|
71
71
|
prerelease: false
|
72
72
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -74,7 +74,7 @@ dependencies:
|
|
74
74
|
requirements:
|
75
75
|
- - ! '>='
|
76
76
|
- !ruby/object:Gem::Version
|
77
|
-
version: '
|
77
|
+
version: '1.3'
|
78
78
|
- !ruby/object:Gem::Dependency
|
79
79
|
name: rake
|
80
80
|
requirement: !ruby/object:Gem::Requirement
|
@@ -522,7 +522,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
522
522
|
version: '0'
|
523
523
|
segments:
|
524
524
|
- 0
|
525
|
-
hash:
|
525
|
+
hash: -2372248614373952887
|
526
526
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
527
527
|
none: false
|
528
528
|
requirements:
|
@@ -531,7 +531,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
531
531
|
version: '0'
|
532
532
|
segments:
|
533
533
|
- 0
|
534
|
-
hash:
|
534
|
+
hash: -2372248614373952887
|
535
535
|
requirements: []
|
536
536
|
rubyforge_project:
|
537
537
|
rubygems_version: 1.8.24
|