fb_graph 2.2.4 → 2.2.5
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/lib/fb_graph.rb +1 -0
- data/lib/fb_graph/ad_account.rb +1 -0
- data/lib/fb_graph/ad_preview.rb +10 -0
- data/lib/fb_graph/connections/ad_previews.rb +10 -0
- data/spec/fb_graph/connections/ad_previews_spec.rb +18 -0
- data/spec/mock_json/ad_accounts/ad_previews/test_ad_previews.json +4 -0
- metadata +128 -74
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
2.2.
|
1
|
+
2.2.5
|
data/lib/fb_graph.rb
CHANGED
@@ -75,6 +75,7 @@ require 'fb_graph/ad_keyword_suggestion'
|
|
75
75
|
require 'fb_graph/ad_keyword_valid'
|
76
76
|
require 'fb_graph/broad_targeting_category'
|
77
77
|
require 'fb_graph/reach_estimate.rb'
|
78
|
+
require 'fb_graph/ad_preview.rb'
|
78
79
|
require 'fb_graph/album'
|
79
80
|
require 'fb_graph/app_request'
|
80
81
|
require 'fb_graph/application'
|
data/lib/fb_graph/ad_account.rb
CHANGED
@@ -7,6 +7,7 @@ module FbGraph
|
|
7
7
|
include Connections::BroadTargetingCategories
|
8
8
|
include Connections::ReachEstimates
|
9
9
|
include Connections::AdConnectionObjects
|
10
|
+
include Connections::AdPreviews
|
10
11
|
|
11
12
|
attr_accessor :account_id, :name, :account_status, :daily_spend_limit, :users, :currency, :timezone_id, :timezone_name, :capabilities, :account_groups
|
12
13
|
|
@@ -0,0 +1,10 @@
|
|
1
|
+
module FbGraph
|
2
|
+
module Connections
|
3
|
+
module AdPreviews
|
4
|
+
def ad_previews(options = {})
|
5
|
+
ad_previews = self.post(options.merge!(:method => 'get', :connection => :adpreviews))
|
6
|
+
AdPreview.new(ad_previews.merge(:access_token => options[:access_token] || self.access_token))
|
7
|
+
end
|
8
|
+
end
|
9
|
+
end
|
10
|
+
end
|
@@ -0,0 +1,18 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe FbGraph::Connections::AdPreviews, '#ad_previews' do
|
4
|
+
context 'when included by FbGraph::AdAccount' do
|
5
|
+
context 'when access_token is given' do
|
6
|
+
it 'should return ad_preview as FbGraph::AdPreview' do
|
7
|
+
mock_graph :post, 'act_123456789/adpreviews', 'ad_accounts/ad_previews/test_ad_previews' do
|
8
|
+
ad_account = FbGraph::AdAccount.new('act_123456789', :access_token => 'access_token')
|
9
|
+
ad_preview = ad_account.ad_previews(:access_token => 'access_token', :preview_spec => {})
|
10
|
+
ad_preview.should be_instance_of(FbGraph::AdPreview)
|
11
|
+
ad_preview.preview_data.should == 'hello world'
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
18
|
+
|
metadata
CHANGED
@@ -1,101 +1,141 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: fb_graph
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
hash: 13
|
5
5
|
prerelease:
|
6
|
+
segments:
|
7
|
+
- 2
|
8
|
+
- 2
|
9
|
+
- 5
|
10
|
+
version: 2.2.5
|
6
11
|
platform: ruby
|
7
|
-
authors:
|
12
|
+
authors:
|
8
13
|
- nov matake
|
9
14
|
autorequire:
|
10
15
|
bindir: bin
|
11
16
|
cert_chain: []
|
12
|
-
|
13
|
-
|
14
|
-
|
17
|
+
|
18
|
+
date: 2012-01-05 00:00:00 Z
|
19
|
+
dependencies:
|
20
|
+
- !ruby/object:Gem::Dependency
|
15
21
|
name: httpclient
|
16
|
-
|
22
|
+
prerelease: false
|
23
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
17
24
|
none: false
|
18
|
-
requirements:
|
19
|
-
- -
|
20
|
-
- !ruby/object:Gem::Version
|
25
|
+
requirements:
|
26
|
+
- - ">="
|
27
|
+
- !ruby/object:Gem::Version
|
28
|
+
hash: 123
|
29
|
+
segments:
|
30
|
+
- 2
|
31
|
+
- 2
|
32
|
+
- 0
|
33
|
+
- 2
|
21
34
|
version: 2.2.0.2
|
22
35
|
type: :runtime
|
23
|
-
|
24
|
-
|
25
|
-
- !ruby/object:Gem::Dependency
|
36
|
+
version_requirements: *id001
|
37
|
+
- !ruby/object:Gem::Dependency
|
26
38
|
name: rack-oauth2
|
27
|
-
|
39
|
+
prerelease: false
|
40
|
+
requirement: &id002 !ruby/object:Gem::Requirement
|
28
41
|
none: false
|
29
|
-
requirements:
|
30
|
-
- -
|
31
|
-
- !ruby/object:Gem::Version
|
42
|
+
requirements:
|
43
|
+
- - ">="
|
44
|
+
- !ruby/object:Gem::Version
|
45
|
+
hash: 51
|
46
|
+
segments:
|
47
|
+
- 0
|
48
|
+
- 9
|
49
|
+
- 4
|
32
50
|
version: 0.9.4
|
33
51
|
type: :runtime
|
34
|
-
|
35
|
-
|
36
|
-
- !ruby/object:Gem::Dependency
|
52
|
+
version_requirements: *id002
|
53
|
+
- !ruby/object:Gem::Dependency
|
37
54
|
name: rake
|
38
|
-
|
55
|
+
prerelease: false
|
56
|
+
requirement: &id003 !ruby/object:Gem::Requirement
|
39
57
|
none: false
|
40
|
-
requirements:
|
41
|
-
- -
|
42
|
-
- !ruby/object:Gem::Version
|
43
|
-
|
58
|
+
requirements:
|
59
|
+
- - ">="
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
hash: 27
|
62
|
+
segments:
|
63
|
+
- 0
|
64
|
+
- 8
|
65
|
+
version: "0.8"
|
44
66
|
type: :development
|
67
|
+
version_requirements: *id003
|
68
|
+
- !ruby/object:Gem::Dependency
|
69
|
+
name: rcov
|
45
70
|
prerelease: false
|
46
|
-
|
47
|
-
- !ruby/object:Gem::Dependency
|
48
|
-
name: cover_me
|
49
|
-
requirement: &70109471654980 !ruby/object:Gem::Requirement
|
71
|
+
requirement: &id004 !ruby/object:Gem::Requirement
|
50
72
|
none: false
|
51
|
-
requirements:
|
52
|
-
- -
|
53
|
-
- !ruby/object:Gem::Version
|
54
|
-
|
73
|
+
requirements:
|
74
|
+
- - ">="
|
75
|
+
- !ruby/object:Gem::Version
|
76
|
+
hash: 25
|
77
|
+
segments:
|
78
|
+
- 0
|
79
|
+
- 9
|
80
|
+
version: "0.9"
|
55
81
|
type: :development
|
56
|
-
|
57
|
-
|
58
|
-
- !ruby/object:Gem::Dependency
|
82
|
+
version_requirements: *id004
|
83
|
+
- !ruby/object:Gem::Dependency
|
59
84
|
name: rspec
|
60
|
-
|
85
|
+
prerelease: false
|
86
|
+
requirement: &id005 !ruby/object:Gem::Requirement
|
61
87
|
none: false
|
62
|
-
requirements:
|
63
|
-
- -
|
64
|
-
- !ruby/object:Gem::Version
|
65
|
-
|
88
|
+
requirements:
|
89
|
+
- - ">="
|
90
|
+
- !ruby/object:Gem::Version
|
91
|
+
hash: 7
|
92
|
+
segments:
|
93
|
+
- 2
|
94
|
+
version: "2"
|
66
95
|
type: :development
|
67
|
-
|
68
|
-
|
69
|
-
- !ruby/object:Gem::Dependency
|
96
|
+
version_requirements: *id005
|
97
|
+
- !ruby/object:Gem::Dependency
|
70
98
|
name: webmock
|
71
|
-
|
99
|
+
prerelease: false
|
100
|
+
requirement: &id006 !ruby/object:Gem::Requirement
|
72
101
|
none: false
|
73
|
-
requirements:
|
74
|
-
- -
|
75
|
-
- !ruby/object:Gem::Version
|
102
|
+
requirements:
|
103
|
+
- - ">="
|
104
|
+
- !ruby/object:Gem::Version
|
105
|
+
hash: 11
|
106
|
+
segments:
|
107
|
+
- 1
|
108
|
+
- 6
|
109
|
+
- 2
|
76
110
|
version: 1.6.2
|
77
111
|
type: :development
|
78
|
-
|
79
|
-
|
80
|
-
- !ruby/object:Gem::Dependency
|
112
|
+
version_requirements: *id006
|
113
|
+
- !ruby/object:Gem::Dependency
|
81
114
|
name: actionpack
|
82
|
-
|
115
|
+
prerelease: false
|
116
|
+
requirement: &id007 !ruby/object:Gem::Requirement
|
83
117
|
none: false
|
84
|
-
requirements:
|
85
|
-
- -
|
86
|
-
- !ruby/object:Gem::Version
|
118
|
+
requirements:
|
119
|
+
- - ">="
|
120
|
+
- !ruby/object:Gem::Version
|
121
|
+
hash: 11
|
122
|
+
segments:
|
123
|
+
- 3
|
124
|
+
- 0
|
125
|
+
- 6
|
87
126
|
version: 3.0.6
|
88
127
|
type: :development
|
89
|
-
|
90
|
-
version_requirements: *70109471651740
|
128
|
+
version_requirements: *id007
|
91
129
|
description: A full-stack Facebook Graph API wrapper in Ruby.
|
92
130
|
email: nov@matake.jp
|
93
131
|
executables: []
|
132
|
+
|
94
133
|
extensions: []
|
95
|
-
|
134
|
+
|
135
|
+
extra_rdoc_files:
|
96
136
|
- LICENSE
|
97
137
|
- README.rdoc
|
98
|
-
files:
|
138
|
+
files:
|
99
139
|
- .document
|
100
140
|
- .gitignore
|
101
141
|
- .rspec
|
@@ -121,6 +161,7 @@ files:
|
|
121
161
|
- lib/fb_graph/ad_keyword.rb
|
122
162
|
- lib/fb_graph/ad_keyword_suggestion.rb
|
123
163
|
- lib/fb_graph/ad_keyword_valid.rb
|
164
|
+
- lib/fb_graph/ad_preview.rb
|
124
165
|
- lib/fb_graph/ad_user.rb
|
125
166
|
- lib/fb_graph/album.rb
|
126
167
|
- lib/fb_graph/app_request.rb
|
@@ -144,6 +185,7 @@ files:
|
|
144
185
|
- lib/fb_graph/connections/ad_connection_objects.rb
|
145
186
|
- lib/fb_graph/connections/ad_group_stats.rb
|
146
187
|
- lib/fb_graph/connections/ad_groups.rb
|
188
|
+
- lib/fb_graph/connections/ad_previews.rb
|
147
189
|
- lib/fb_graph/connections/admins.rb
|
148
190
|
- lib/fb_graph/connections/albums.rb
|
149
191
|
- lib/fb_graph/connections/app_requests.rb
|
@@ -289,6 +331,7 @@ files:
|
|
289
331
|
- spec/fb_graph/connections/ad_connection_objects_spec.rb
|
290
332
|
- spec/fb_graph/connections/ad_group_stat_spec.rb
|
291
333
|
- spec/fb_graph/connections/ad_groups_spec.rb
|
334
|
+
- spec/fb_graph/connections/ad_previews_spec.rb
|
292
335
|
- spec/fb_graph/connections/admins_spec.rb
|
293
336
|
- spec/fb_graph/connections/albums_spec.rb
|
294
337
|
- spec/fb_graph/connections/app_requests_spec.rb
|
@@ -406,6 +449,7 @@ files:
|
|
406
449
|
- spec/mock_json/ad_accounts/ad_connection_objects/test_connection_objects.json
|
407
450
|
- spec/mock_json/ad_accounts/ad_group_stats/test_ad_group_stats.json
|
408
451
|
- spec/mock_json/ad_accounts/ad_groups/post_with_valid_access_token.json
|
452
|
+
- spec/mock_json/ad_accounts/ad_previews/test_ad_previews.json
|
409
453
|
- spec/mock_json/ad_accounts/broad_targeting_categories/test_bct.json
|
410
454
|
- spec/mock_json/ad_accounts/reach_estimates/test_reach_estimates.json
|
411
455
|
- spec/mock_json/ad_accounts/test_ad_account.json
|
@@ -584,30 +628,38 @@ files:
|
|
584
628
|
- spec/spec_helper.rb
|
585
629
|
homepage: http://github.com/nov/fb_graph
|
586
630
|
licenses: []
|
631
|
+
|
587
632
|
post_install_message:
|
588
|
-
rdoc_options:
|
633
|
+
rdoc_options:
|
589
634
|
- --charset=UTF-8
|
590
|
-
require_paths:
|
635
|
+
require_paths:
|
591
636
|
- lib
|
592
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
637
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
593
638
|
none: false
|
594
|
-
requirements:
|
595
|
-
- -
|
596
|
-
- !ruby/object:Gem::Version
|
597
|
-
|
598
|
-
|
639
|
+
requirements:
|
640
|
+
- - ">="
|
641
|
+
- !ruby/object:Gem::Version
|
642
|
+
hash: 3
|
643
|
+
segments:
|
644
|
+
- 0
|
645
|
+
version: "0"
|
646
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
599
647
|
none: false
|
600
|
-
requirements:
|
601
|
-
- -
|
602
|
-
- !ruby/object:Gem::Version
|
603
|
-
|
648
|
+
requirements:
|
649
|
+
- - ">="
|
650
|
+
- !ruby/object:Gem::Version
|
651
|
+
hash: 3
|
652
|
+
segments:
|
653
|
+
- 0
|
654
|
+
version: "0"
|
604
655
|
requirements: []
|
656
|
+
|
605
657
|
rubyforge_project:
|
606
|
-
rubygems_version: 1.8.
|
658
|
+
rubygems_version: 1.8.6
|
607
659
|
signing_key:
|
608
660
|
specification_version: 3
|
609
661
|
summary: A full-stack Facebook Graph API wrapper in Ruby.
|
610
|
-
test_files:
|
662
|
+
test_files:
|
611
663
|
- spec/fb_graph/achievement_spec.rb
|
612
664
|
- spec/fb_graph/ad_account_spec.rb
|
613
665
|
- spec/fb_graph/ad_campaign_spec.rb
|
@@ -636,6 +688,7 @@ test_files:
|
|
636
688
|
- spec/fb_graph/connections/ad_connection_objects_spec.rb
|
637
689
|
- spec/fb_graph/connections/ad_group_stat_spec.rb
|
638
690
|
- spec/fb_graph/connections/ad_groups_spec.rb
|
691
|
+
- spec/fb_graph/connections/ad_previews_spec.rb
|
639
692
|
- spec/fb_graph/connections/admins_spec.rb
|
640
693
|
- spec/fb_graph/connections/albums_spec.rb
|
641
694
|
- spec/fb_graph/connections/app_requests_spec.rb
|
@@ -753,6 +806,7 @@ test_files:
|
|
753
806
|
- spec/mock_json/ad_accounts/ad_connection_objects/test_connection_objects.json
|
754
807
|
- spec/mock_json/ad_accounts/ad_group_stats/test_ad_group_stats.json
|
755
808
|
- spec/mock_json/ad_accounts/ad_groups/post_with_valid_access_token.json
|
809
|
+
- spec/mock_json/ad_accounts/ad_previews/test_ad_previews.json
|
756
810
|
- spec/mock_json/ad_accounts/broad_targeting_categories/test_bct.json
|
757
811
|
- spec/mock_json/ad_accounts/reach_estimates/test_reach_estimates.json
|
758
812
|
- spec/mock_json/ad_accounts/test_ad_account.json
|