citygrid_api 0.0.5.1 → 0.0.6

Sign up to get free protection for your applications and to get access to all the features.
Files changed (122) hide show
  1. data/.sass-cache/c6f2c767b164f077e5b9fb1f18a7886d7c755211/test.scssc +0 -0
  2. data/Gemfile +3 -1
  3. data/Gemfile.lock +9 -1
  4. data/VERSION +1 -1
  5. data/citygrid_api.gemspec +85 -45
  6. data/citygrid_api.yml.backup +35 -0
  7. data/citygrid_api.yml.sample +35 -23
  8. data/fixtures/vcr_cassettes/AdGroupCriterion_mutate.yml +30 -0
  9. data/fixtures/vcr_cassettes/AdGroupCriterion_search.yml +35 -0
  10. data/fixtures/vcr_cassettes/Adding_a_place.yml +33 -0
  11. data/fixtures/vcr_cassettes/Call_Detail_by_campaign.yml +79 -0
  12. data/fixtures/vcr_cassettes/Geo.yml +32 -0
  13. data/fixtures/vcr_cassettes/Getting_an_offer_by_listing_ID.yml +54 -0
  14. data/fixtures/vcr_cassettes/Import_a_cg_account.yml +54 -0
  15. data/fixtures/vcr_cassettes/Initiating_a_Details.yml +133 -0
  16. data/fixtures/vcr_cassettes/Initiating_new_MultiDetails.yml +133 -0
  17. data/fixtures/vcr_cassettes/Method_of_Payment_mutate.yml +33 -0
  18. data/fixtures/vcr_cassettes/Method_of_Payment_search.yml +59 -0
  19. data/fixtures/vcr_cassettes/Mutating_AdGroup_Ads.yml +30 -0
  20. data/fixtures/vcr_cassettes/Report_summary_daily.yml +60 -0
  21. data/fixtures/vcr_cassettes/Report_summary_user_actions.yml +36 -0
  22. data/fixtures/vcr_cassettes/Search_Ad_Group_by_Campaign_Id.yml +31 -0
  23. data/fixtures/vcr_cassettes/Search_Billing_by_Campaign_Id.yml +30 -0
  24. data/fixtures/vcr_cassettes/Search_account_manager_by_Campaign_Id.yml +30 -0
  25. data/fixtures/vcr_cassettes/Searching_AdGroup_Geo.yml +57 -0
  26. data/fixtures/vcr_cassettes/Searching_budgets.yml +30 -0
  27. data/fixtures/vcr_cassettes/Searching_categories_by_listing_id.yml +35 -0
  28. data/fixtures/vcr_cassettes/Searching_categories_by_query.yml +33 -0
  29. data/fixtures/vcr_cassettes/Upload_an_image_Add_a_preview.yml +31 -0
  30. data/fixtures/vcr_cassettes/create_campaign.yml +30 -0
  31. data/fixtures/vcr_cassettes/log_in_a_session.yml +24 -0
  32. data/fixtures/vcr_cassettes/log_in_a_session_mutate_places.yml +56 -0
  33. data/fixtures/vcr_cassettes/query_account_type_by_id.yml +30 -0
  34. data/fixtures/vcr_cassettes/search_for_an_account_by_id.yml +31 -0
  35. data/fixtures/vcr_cassettes/search_for_an_account_by_name.yml +55 -0
  36. data/fixtures/vcr_cassettes/searching_for_a_CityGrid_listing.yml +168 -0
  37. data/fixtures/vcr_cassettes/searching_for_a_special_CityGrid_listing.yml +67 -0
  38. data/lib/citygrid/abstraction/requestable.rb +1 -0
  39. data/lib/citygrid/api/accounts/account.rb +17 -0
  40. data/lib/citygrid/api/accounts/authentication.rb +3 -0
  41. data/lib/citygrid/api/accounts/method_of_payment.rb +10 -0
  42. data/lib/citygrid/api/accounts/user.rb +18 -0
  43. data/lib/citygrid/api/accounts.rb +8 -0
  44. data/lib/citygrid/api/advertising/account_manager.rb +9 -0
  45. data/lib/citygrid/api/advertising/ad_group.rb +10 -0
  46. data/lib/citygrid/api/advertising/ad_group_ad.rb +10 -0
  47. data/lib/citygrid/api/advertising/ad_group_criterion.rb +10 -0
  48. data/lib/citygrid/api/advertising/ad_group_geo.rb +10 -0
  49. data/lib/citygrid/api/advertising/billing.rb +9 -0
  50. data/lib/citygrid/api/advertising/budget.rb +10 -0
  51. data/lib/citygrid/api/advertising/call_detail.rb +10 -0
  52. data/lib/citygrid/api/advertising/campaign.rb +10 -0
  53. data/lib/citygrid/api/advertising/category.rb +10 -0
  54. data/lib/citygrid/api/advertising/geolocation.rb +10 -0
  55. data/lib/citygrid/api/{ad_center → advertising}/image.rb +2 -2
  56. data/lib/citygrid/api/{ad_center → advertising}/performance.rb +5 -2
  57. data/lib/citygrid/api/advertising/places.rb +10 -0
  58. data/lib/citygrid/api/advertising.rb +10 -0
  59. data/lib/citygrid/api/content/offers.rb +2 -12
  60. data/lib/citygrid/api/content/places.rb +4 -26
  61. data/lib/citygrid/api/content.rb +1 -5
  62. data/lib/citygrid/api/mutatable.rb +15 -0
  63. data/lib/citygrid/api/searchable.rb +15 -0
  64. data/lib/citygrid/api.rb +54 -52
  65. data/lib/citygrid/details.rb +3 -6
  66. data/lib/citygrid/offers.rb +1 -5
  67. data/lib/citygrid/search.rb +3 -6
  68. data/lib/citygrid/session.rb +65 -0
  69. data/lib/citygrid.rb +46 -75
  70. data/lib/request_ext.rb +4 -5
  71. data/lib/string_ext.rb +7 -0
  72. data/test/api/accounts/test_account.rb +111 -0
  73. data/test/api/accounts/test_method_of_payment.rb +50 -0
  74. data/test/api/advertising/test_account_manager.rb +14 -0
  75. data/test/api/advertising/test_ad_group.rb +13 -0
  76. data/test/api/advertising/test_ad_group_ad.rb +24 -0
  77. data/test/api/advertising/test_ad_group_criterion.rb +47 -0
  78. data/test/api/{ad_center → advertising}/test_ad_group_geo.rb +1 -1
  79. data/test/api/{ad_center → advertising}/test_billing.rb +4 -3
  80. data/test/api/{ad_center → advertising}/test_budget.rb +3 -3
  81. data/test/api/{ad_center → advertising}/test_call_detail.rb +5 -11
  82. data/test/api/{ad_center → advertising}/test_category.rb +9 -12
  83. data/test/api/advertising/test_create_campaign_and_ad_group.rb +56 -0
  84. data/test/api/{ad_center → advertising}/test_geolocation.rb +1 -1
  85. data/test/api/{ad_center → advertising}/test_image.rb +1 -3
  86. data/test/api/{ad_center/test_reports.rb → advertising/test_performance.rb} +6 -10
  87. data/test/api/advertising/test_places.rb +109 -0
  88. data/test/{test_details.rb → api/content/test_details.rb} +2 -3
  89. data/test/{test_search.rb → api/content/test_search.rb} +2 -2
  90. data/test/auth_token.rb +39 -0
  91. data/test/helper.rb +31 -31
  92. data/test/session_helper.rb +20 -0
  93. data/test/test_session.rb +53 -0
  94. metadata +115 -67
  95. data/lib/citygrid/api/ad_center/account.rb +0 -26
  96. data/lib/citygrid/api/ad_center/account_manager.rb +0 -8
  97. data/lib/citygrid/api/ad_center/ad_group.rb +0 -8
  98. data/lib/citygrid/api/ad_center/ad_group_ad.rb +0 -8
  99. data/lib/citygrid/api/ad_center/ad_group_criterion.rb +0 -8
  100. data/lib/citygrid/api/ad_center/ad_group_geo.rb +0 -8
  101. data/lib/citygrid/api/ad_center/authentication.rb +0 -20
  102. data/lib/citygrid/api/ad_center/billing.rb +0 -8
  103. data/lib/citygrid/api/ad_center/budget.rb +0 -9
  104. data/lib/citygrid/api/ad_center/call_detail.rb +0 -25
  105. data/lib/citygrid/api/ad_center/campaign.rb +0 -8
  106. data/lib/citygrid/api/ad_center/category.rb +0 -9
  107. data/lib/citygrid/api/ad_center/geolocation.rb +0 -9
  108. data/lib/citygrid/api/ad_center/method_of_payment.rb +0 -10
  109. data/lib/citygrid/api/ad_center/places.rb +0 -8
  110. data/lib/citygrid/api/ad_center/user.rb +0 -8
  111. data/lib/citygrid/api/ad_center.rb +0 -20
  112. data/lib/citygrid/api/content/places/detail.rb +0 -11
  113. data/lib/citygrid/api/content/places/search.rb +0 -11
  114. data/test/api/ad_center/test_account.rb +0 -120
  115. data/test/api/ad_center/test_ad_group.rb +0 -50
  116. data/test/api/ad_center/test_ad_group_ad.rb +0 -27
  117. data/test/api/ad_center/test_ad_group_criterion.rb +0 -37
  118. data/test/api/ad_center/test_authentication.rb +0 -22
  119. data/test/api/ad_center/test_campaign.rb +0 -27
  120. data/test/api/ad_center/test_method_of_payment.rb +0 -51
  121. data/test/api/ad_center/test_places.rb +0 -79
  122. data/test/api/content/test_places.rb +0 -66
@@ -0,0 +1,39 @@
1
+ class AuthToken
2
+ class << self
3
+ def kunimom
4
+ @@kunimom ||= CityGrid.login(
5
+ :username => 'kunimom',
6
+ :password => 'pppppp'
7
+ ).authToken
8
+ end
9
+
10
+ def dou
11
+ @@dou ||= CityGrid.login(
12
+ :username => 'doushen2',
13
+ :password => 'abcd1234'
14
+ ).authToken
15
+ end
16
+
17
+ def sales_coord
18
+ @@sales_cord ||= CityGrid.login(
19
+ :username => 'QASalesCoord',
20
+ :password => 'pppppp'
21
+ ).authToken
22
+ end
23
+
24
+ def gary_test
25
+ @@gary_test ||= CityGrid.login(
26
+ :username => 'GARYTEST',
27
+ :password => 'pppppp'
28
+ ).authToken
29
+ end
30
+
31
+ def rand_number
32
+ @@rand_number ||= rand(10000000)
33
+ end
34
+
35
+ def generate
36
+ kunimom
37
+ end
38
+ end
39
+ end
data/test/helper.rb CHANGED
@@ -1,32 +1,8 @@
1
- # Hack to allow storing tokens between tests
2
- class AuthToken
3
- class << self
4
- def kunimom
5
- @@kunimom ||= CityGrid.login(
6
- :username => 'kunimom',
7
- :password => 'pppppp'
8
- ).authToken
9
- end
10
-
11
- def sales_coord
12
- @@sales_cord ||= CityGrid.login(
13
- :username => 'QASalesCoord',
14
- :password => 'pppppp'
15
- ).authToken
16
- end
17
-
18
- def rand_number
19
- @@rand_number ||= rand(10000000)
20
- end
21
-
22
- def generate
23
- kunimom
24
- end
25
- end
26
- end
1
+ require File.join(File.dirname(__FILE__), "auth_token")
2
+ require File.join(File.dirname(__FILE__), "session_helper")
27
3
 
28
4
  # don't do gem setup if we're in the dashboad environment
29
- unless defined? IN_DASHBOARD
5
+ unless defined? IN_DASHBOARD
30
6
  require 'rubygems'
31
7
  require 'bundler'
32
8
  begin
@@ -45,10 +21,7 @@ unless defined? IN_DASHBOARD
45
21
  require "publisher_helper"
46
22
 
47
23
  # load default config
48
- CityGrid.load_config File.expand_path(File.join(File.dirname(__FILE__), '..', 'citygrid_api.yml')), "qa"
49
- # load endpoints from configs
50
- # CityGrid.set_endpoints File.join(File.dirname(__FILE__), '..', "qa-endpoints.properties")
51
- # CityGrid.set_env File.join(File.dirname(__FILE__), '..', "qa-env.properties")
24
+ CityGrid.load_config File.expand_path(File.join(File.dirname(__FILE__), '..', 'citygrid_api.yml.sample')), "qa"
52
25
 
53
26
  # Run code with rescue so that exceptions
54
27
  # will be printed, but won't stop test suite
@@ -66,4 +39,31 @@ unless defined? IN_DASHBOARD
66
39
  false # return false
67
40
  end
68
41
  end
42
+
43
+ # patch in VCR
44
+ require 'vcr'
45
+
46
+ VCR.config do |c|
47
+ c.cassette_library_dir = 'fixtures/vcr_cassettes'
48
+ c.stub_with :webmock
49
+ c.allow_http_connections_when_no_cassette = true
50
+ end
51
+
52
+ # contexts now use VCR, with a cassette named by the description
53
+ module Riot
54
+ class Context
55
+ alias_method :old_run, :run
56
+ def run reporter
57
+ if option(:vcr) != nil && option(:vcr) == false
58
+ old_run reporter
59
+ else
60
+ VCR.use_cassette self.detailed_description[0..70] do
61
+ old_run reporter
62
+ end
63
+ end
64
+ end
65
+
66
+ end
67
+ end
68
+
69
69
  end
@@ -0,0 +1,20 @@
1
+ # cache sessions
2
+ class SessionHelper
3
+ class << self
4
+ def kunimom
5
+ @@kunimom ||= CityGrid.session 'kunimom', 'pppppp'
6
+ end
7
+
8
+ def dou
9
+ @@dou ||= CityGrid.session 'doushen2', 'abcd1234'
10
+ end
11
+
12
+ def sales_coord
13
+ @@sales_cord ||= CityGrid.session 'QASalesCoord', 'pppppp'
14
+ end
15
+
16
+ def gary_test
17
+ @@gary_test ||= CityGrid.session 'GARYTEST', 'pppppp'
18
+ end
19
+ end
20
+ end
@@ -0,0 +1,53 @@
1
+ require File.expand_path(File.join(File.dirname(__FILE__), 'helper'))
2
+
3
+ context "log in a session" do
4
+ setup do
5
+ CityGrid::Session.login "GARYTEST", "pppppp"
6
+ end
7
+
8
+ should "flag as logged in" do
9
+ topic.logged_in?
10
+ end
11
+
12
+ should "have a valid AuthToken" do
13
+ topic.auth_token
14
+ end
15
+
16
+ # context "run validate" do
17
+ # setup do
18
+ # topic.call_api CityGrid::API::Advertising::Authentication,
19
+ # :validate
20
+ # end
21
+ #
22
+ # should "return correct username" do
23
+ # puts topic
24
+ # end
25
+ # end
26
+
27
+ context "mutate places" do
28
+ setup do
29
+ topic.call_api CityGrid::API::Advertising::Places,
30
+ :mutate,
31
+ "mutateOperationListResource" => [{
32
+ "operator" => "ADD",
33
+ "operand" => {
34
+ "name" => "Pi on sunset in LAAAAAAAAAAAAAA",
35
+ "address_1" => "Jackson 2102",
36
+ "address_2" => "",
37
+ "city" => "Los Angeles",
38
+ "state" => "California",
39
+ "postal_code" => 90025,
40
+ "phone_number" => 3103333333,
41
+ "website_url" => "pi.com",
42
+ "primary_tag_id" => "3623",
43
+ "bullet1" => "Knoll bullet 1",
44
+ "tagline" => "my tagline",
45
+ "primary_tag_id" => 3623,
46
+ "secondary_tags" => '1776'}
47
+ }]
48
+ end
49
+
50
+ should("return code 200") { topic.resources.first.response.code }.equals(200)
51
+ should("return message OK") { topic.resources.first.response.message }.equals("OK")
52
+ end
53
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: citygrid_api
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5.1
4
+ version: 0.0.6
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2011-12-17 00:00:00.000000000Z
12
+ date: 2011-12-30 00:00:00.000000000Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: httparty
16
- requirement: &2153153500 !ruby/object:Gem::Requirement
16
+ requirement: &2156985800 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ~>
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: 0.8.1
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *2153153500
24
+ version_requirements: *2156985800
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: json
27
- requirement: &2153152460 !ruby/object:Gem::Requirement
27
+ requirement: &2156985320 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - =
@@ -32,10 +32,10 @@ dependencies:
32
32
  version: 1.5.3
33
33
  type: :runtime
34
34
  prerelease: false
35
- version_requirements: *2153152460
35
+ version_requirements: *2156985320
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: riot
38
- requirement: &2153151200 !ruby/object:Gem::Requirement
38
+ requirement: &2156984840 !ruby/object:Gem::Requirement
39
39
  none: false
40
40
  requirements:
41
41
  - - ~>
@@ -43,10 +43,10 @@ dependencies:
43
43
  version: 0.12.4
44
44
  type: :runtime
45
45
  prerelease: false
46
- version_requirements: *2153151200
46
+ version_requirements: *2156984840
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: awesome_print
49
- requirement: &2153149840 !ruby/object:Gem::Requirement
49
+ requirement: &2156984360 !ruby/object:Gem::Requirement
50
50
  none: false
51
51
  requirements:
52
52
  - - ~>
@@ -54,21 +54,10 @@ dependencies:
54
54
  version: 0.4.0
55
55
  type: :runtime
56
56
  prerelease: false
57
- version_requirements: *2153149840
58
- - !ruby/object:Gem::Dependency
59
- name: haml
60
- requirement: &2153148940 !ruby/object:Gem::Requirement
61
- none: false
62
- requirements:
63
- - - ! '>='
64
- - !ruby/object:Gem::Version
65
- version: '0'
66
- type: :runtime
67
- prerelease: false
68
- version_requirements: *2153148940
57
+ version_requirements: *2156984360
69
58
  - !ruby/object:Gem::Dependency
70
59
  name: bundler
71
- requirement: &2153147700 !ruby/object:Gem::Requirement
60
+ requirement: &2156983880 !ruby/object:Gem::Requirement
72
61
  none: false
73
62
  requirements:
74
63
  - - ~>
@@ -76,10 +65,10 @@ dependencies:
76
65
  version: 1.0.0
77
66
  type: :development
78
67
  prerelease: false
79
- version_requirements: *2153147700
68
+ version_requirements: *2156983880
80
69
  - !ruby/object:Gem::Dependency
81
70
  name: jeweler
82
- requirement: &2153146680 !ruby/object:Gem::Requirement
71
+ requirement: &2156983400 !ruby/object:Gem::Requirement
83
72
  none: false
84
73
  requirements:
85
74
  - - ~>
@@ -87,10 +76,32 @@ dependencies:
87
76
  version: 1.6.2
88
77
  type: :development
89
78
  prerelease: false
90
- version_requirements: *2153146680
79
+ version_requirements: *2156983400
91
80
  - !ruby/object:Gem::Dependency
92
81
  name: rcov
93
- requirement: &2153139180 !ruby/object:Gem::Requirement
82
+ requirement: &2156982920 !ruby/object:Gem::Requirement
83
+ none: false
84
+ requirements:
85
+ - - ! '>='
86
+ - !ruby/object:Gem::Version
87
+ version: '0'
88
+ type: :development
89
+ prerelease: false
90
+ version_requirements: *2156982920
91
+ - !ruby/object:Gem::Dependency
92
+ name: vcr
93
+ requirement: &2156982440 !ruby/object:Gem::Requirement
94
+ none: false
95
+ requirements:
96
+ - - ! '>='
97
+ - !ruby/object:Gem::Version
98
+ version: '0'
99
+ type: :development
100
+ prerelease: false
101
+ version_requirements: *2156982440
102
+ - !ruby/object:Gem::Dependency
103
+ name: webmock
104
+ requirement: &2156981960 !ruby/object:Gem::Requirement
94
105
  none: false
95
106
  requirements:
96
107
  - - ! '>='
@@ -98,7 +109,7 @@ dependencies:
98
109
  version: '0'
99
110
  type: :development
100
111
  prerelease: false
101
- version_requirements: *2153139180
112
+ version_requirements: *2156981960
102
113
  description: Ruby wrapper for CityGrid APIs
103
114
  email: fu7iin@gmail.com
104
115
  executables: []
@@ -110,6 +121,7 @@ extra_rdoc_files:
110
121
  files:
111
122
  - .document
112
123
  - .sass-cache/7a5a675d951455410512a59af5ab2d160bd1735c/test.scssc
124
+ - .sass-cache/c6f2c767b164f077e5b9fb1f18a7886d7c755211/test.scssc
113
125
  - Gemfile
114
126
  - Gemfile.lock
115
127
  - LICENSE.txt
@@ -118,9 +130,40 @@ files:
118
130
  - Rakefile
119
131
  - VERSION
120
132
  - citygrid_api.gemspec
133
+ - citygrid_api.yml.backup
121
134
  - citygrid_api.yml.sample
122
135
  - config.ru
123
136
  - dashboard.rb
137
+ - fixtures/vcr_cassettes/AdGroupCriterion_mutate.yml
138
+ - fixtures/vcr_cassettes/AdGroupCriterion_search.yml
139
+ - fixtures/vcr_cassettes/Adding_a_place.yml
140
+ - fixtures/vcr_cassettes/Call_Detail_by_campaign.yml
141
+ - fixtures/vcr_cassettes/Geo.yml
142
+ - fixtures/vcr_cassettes/Getting_an_offer_by_listing_ID.yml
143
+ - fixtures/vcr_cassettes/Import_a_cg_account.yml
144
+ - fixtures/vcr_cassettes/Initiating_a_Details.yml
145
+ - fixtures/vcr_cassettes/Initiating_new_MultiDetails.yml
146
+ - fixtures/vcr_cassettes/Method_of_Payment_mutate.yml
147
+ - fixtures/vcr_cassettes/Method_of_Payment_search.yml
148
+ - fixtures/vcr_cassettes/Mutating_AdGroup_Ads.yml
149
+ - fixtures/vcr_cassettes/Report_summary_daily.yml
150
+ - fixtures/vcr_cassettes/Report_summary_user_actions.yml
151
+ - fixtures/vcr_cassettes/Search_Ad_Group_by_Campaign_Id.yml
152
+ - fixtures/vcr_cassettes/Search_Billing_by_Campaign_Id.yml
153
+ - fixtures/vcr_cassettes/Search_account_manager_by_Campaign_Id.yml
154
+ - fixtures/vcr_cassettes/Searching_AdGroup_Geo.yml
155
+ - fixtures/vcr_cassettes/Searching_budgets.yml
156
+ - fixtures/vcr_cassettes/Searching_categories_by_listing_id.yml
157
+ - fixtures/vcr_cassettes/Searching_categories_by_query.yml
158
+ - fixtures/vcr_cassettes/Upload_an_image_Add_a_preview.yml
159
+ - fixtures/vcr_cassettes/create_campaign.yml
160
+ - fixtures/vcr_cassettes/log_in_a_session.yml
161
+ - fixtures/vcr_cassettes/log_in_a_session_mutate_places.yml
162
+ - fixtures/vcr_cassettes/query_account_type_by_id.yml
163
+ - fixtures/vcr_cassettes/search_for_an_account_by_id.yml
164
+ - fixtures/vcr_cassettes/search_for_an_account_by_name.yml
165
+ - fixtures/vcr_cassettes/searching_for_a_CityGrid_listing.yml
166
+ - fixtures/vcr_cassettes/searching_for_a_special_CityGrid_listing.yml
124
167
  - lib/citygrid.rb
125
168
  - lib/citygrid/abstraction.rb
126
169
  - lib/citygrid/abstraction/collection.rb
@@ -129,69 +172,74 @@ files:
129
172
  - lib/citygrid/abstraction/super_array.rb
130
173
  - lib/citygrid/abstraction/super_hash.rb
131
174
  - lib/citygrid/api.rb
132
- - lib/citygrid/api/ad_center.rb
133
- - lib/citygrid/api/ad_center/account.rb
134
- - lib/citygrid/api/ad_center/account_manager.rb
135
- - lib/citygrid/api/ad_center/ad_group.rb
136
- - lib/citygrid/api/ad_center/ad_group_ad.rb
137
- - lib/citygrid/api/ad_center/ad_group_criterion.rb
138
- - lib/citygrid/api/ad_center/ad_group_geo.rb
139
- - lib/citygrid/api/ad_center/authentication.rb
140
- - lib/citygrid/api/ad_center/billing.rb
141
- - lib/citygrid/api/ad_center/budget.rb
142
- - lib/citygrid/api/ad_center/call_detail.rb
143
- - lib/citygrid/api/ad_center/campaign.rb
144
- - lib/citygrid/api/ad_center/category.rb
145
- - lib/citygrid/api/ad_center/geolocation.rb
146
- - lib/citygrid/api/ad_center/image.rb
147
- - lib/citygrid/api/ad_center/method_of_payment.rb
148
- - lib/citygrid/api/ad_center/performance.rb
149
- - lib/citygrid/api/ad_center/places.rb
150
- - lib/citygrid/api/ad_center/user.rb
175
+ - lib/citygrid/api/accounts.rb
176
+ - lib/citygrid/api/accounts/account.rb
177
+ - lib/citygrid/api/accounts/authentication.rb
178
+ - lib/citygrid/api/accounts/method_of_payment.rb
179
+ - lib/citygrid/api/accounts/user.rb
180
+ - lib/citygrid/api/advertising.rb
181
+ - lib/citygrid/api/advertising/account_manager.rb
182
+ - lib/citygrid/api/advertising/ad_group.rb
183
+ - lib/citygrid/api/advertising/ad_group_ad.rb
184
+ - lib/citygrid/api/advertising/ad_group_criterion.rb
185
+ - lib/citygrid/api/advertising/ad_group_geo.rb
186
+ - lib/citygrid/api/advertising/billing.rb
187
+ - lib/citygrid/api/advertising/budget.rb
188
+ - lib/citygrid/api/advertising/call_detail.rb
189
+ - lib/citygrid/api/advertising/campaign.rb
190
+ - lib/citygrid/api/advertising/category.rb
191
+ - lib/citygrid/api/advertising/geolocation.rb
192
+ - lib/citygrid/api/advertising/image.rb
193
+ - lib/citygrid/api/advertising/performance.rb
194
+ - lib/citygrid/api/advertising/places.rb
151
195
  - lib/citygrid/api/content.rb
152
196
  - lib/citygrid/api/content/offers.rb
153
197
  - lib/citygrid/api/content/places.rb
154
- - lib/citygrid/api/content/places/detail.rb
155
- - lib/citygrid/api/content/places/search.rb
156
198
  - lib/citygrid/api/content/reviews.rb
199
+ - lib/citygrid/api/mutatable.rb
157
200
  - lib/citygrid/api/response.rb
201
+ - lib/citygrid/api/searchable.rb
158
202
  - lib/citygrid/details.rb
159
203
  - lib/citygrid/listing.rb
160
204
  - lib/citygrid/offers.rb
161
205
  - lib/citygrid/reviews.rb
162
206
  - lib/citygrid/search.rb
207
+ - lib/citygrid/session.rb
163
208
  - lib/citygrid_api.rb
164
209
  - lib/dashboard/sinatra_partial.rb
165
210
  - lib/dashboard/stored_reporter.rb
166
211
  - lib/dashboard/test_result.rb
167
212
  - lib/request_ext.rb
213
+ - lib/string_ext.rb
168
214
  - public/javascript/dashboard.js
169
- - test/api/ad_center/test_account.rb
170
- - test/api/ad_center/test_ad_group.rb
171
- - test/api/ad_center/test_ad_group_ad.rb
172
- - test/api/ad_center/test_ad_group_criterion.rb
173
- - test/api/ad_center/test_ad_group_geo.rb
174
- - test/api/ad_center/test_authentication.rb
175
- - test/api/ad_center/test_billing.rb
176
- - test/api/ad_center/test_budget.rb
177
- - test/api/ad_center/test_call_detail.rb
178
- - test/api/ad_center/test_campaign.rb
179
- - test/api/ad_center/test_category.rb
180
- - test/api/ad_center/test_geolocation.rb
181
- - test/api/ad_center/test_image.rb
182
- - test/api/ad_center/test_method_of_payment.rb
183
- - test/api/ad_center/test_places.rb
184
- - test/api/ad_center/test_reports.rb
215
+ - test/api/accounts/test_account.rb
216
+ - test/api/accounts/test_method_of_payment.rb
217
+ - test/api/advertising/test_account_manager.rb
218
+ - test/api/advertising/test_ad_group.rb
219
+ - test/api/advertising/test_ad_group_ad.rb
220
+ - test/api/advertising/test_ad_group_criterion.rb
221
+ - test/api/advertising/test_ad_group_geo.rb
222
+ - test/api/advertising/test_billing.rb
223
+ - test/api/advertising/test_budget.rb
224
+ - test/api/advertising/test_call_detail.rb
225
+ - test/api/advertising/test_category.rb
226
+ - test/api/advertising/test_create_campaign_and_ad_group.rb
227
+ - test/api/advertising/test_geolocation.rb
228
+ - test/api/advertising/test_image.rb
229
+ - test/api/advertising/test_performance.rb
230
+ - test/api/advertising/test_places.rb
231
+ - test/api/content/test_details.rb
185
232
  - test/api/content/test_offers.rb
186
- - test/api/content/test_places.rb
233
+ - test/api/content/test_search.rb
234
+ - test/auth_token.rb
187
235
  - test/helper.rb
188
236
  - test/publisher_helper.rb.sample
237
+ - test/session_helper.rb
189
238
  - test/test_config.rb
190
- - test/test_details.rb
191
239
  - test/test_img.jpg
192
240
  - test/test_img_big.png
193
241
  - test/test_listing.rb
194
- - test/test_search.rb
242
+ - test/test_session.rb
195
243
  - test/test_super_array.rb
196
244
  - test/test_super_hash.rb
197
245
  - views/_context_result.haml
@@ -1,26 +0,0 @@
1
- class CityGrid
2
- class API
3
- class AdCenter
4
- class Account < AdCenter
5
- # Adds new customer account to existing user
6
- # http://docs.prod.cs/display/citygridv2/Internal+-+Account#Internal-Account-AddNewCustomerAccounttoExistingUser
7
- def self.import_to_cg options = {}
8
- token = extract_auth_token options
9
- request_and_handle :post,
10
- "#{base_uri}/accounts/account/v2/customer/mutate",
11
- :body => options.to_json,
12
- :headers => merge_headers("authToken" => token)
13
- end
14
-
15
- #http://docs-dev.prod.cs/display/citygridv2/Internal+-+Account+Type
16
- def self.account_type options = {}
17
- token = extract_auth_token options
18
- request_and_handle :get,
19
- "#{endpoint}/get/type",
20
- :query => options,
21
- :headers => merge_headers("authToken" => token)
22
- end
23
- end
24
- end
25
- end
26
- end
@@ -1,8 +0,0 @@
1
- class CityGrid
2
- class API
3
- class AdCenter
4
- class AccountManager < AdCenter
5
- end
6
- end
7
- end
8
- end
@@ -1,8 +0,0 @@
1
- class CityGrid
2
- class API
3
- class AdCenter
4
- class AdGroup < AdCenter
5
- end
6
- end
7
- end
8
- end
@@ -1,8 +0,0 @@
1
- class CityGrid
2
- class API
3
- class AdCenter
4
- class AdGroupAd < AdCenter
5
- end
6
- end
7
- end
8
- end
@@ -1,8 +0,0 @@
1
- class CityGrid
2
- class API
3
- class AdCenter
4
- class AdGroupCriterion < AdCenter
5
- end
6
- end
7
- end
8
- end
@@ -1,8 +0,0 @@
1
- class CityGrid
2
- class API
3
- class AdCenter
4
- class AdGroupGeo < AdCenter
5
- end
6
- end
7
- end
8
- end
@@ -1,20 +0,0 @@
1
- class CityGrid
2
- class API
3
- class AdCenter
4
- class Authentication < AdCenter
5
- def self.login options = {}
6
- request_and_handle :post,
7
- "#{endpoint}/login",
8
- :query => options
9
- end
10
-
11
- def self.validate options = {}
12
- request_and_handle :get,
13
- "#{endpoint}/validate",
14
- :query => options,
15
- :headers => merge_headers
16
- end
17
- end
18
- end
19
- end
20
- end
@@ -1,8 +0,0 @@
1
- class CityGrid
2
- class API
3
- class AdCenter
4
- class Billing < AdCenter
5
- end
6
- end
7
- end
8
- end
@@ -1,9 +0,0 @@
1
- class CityGrid
2
- class API
3
- class AdCenter
4
- class Budget < AdCenter
5
- endpoint "/adcenter/budget/v2/recommendation"
6
- end
7
- end
8
- end
9
- end
@@ -1,25 +0,0 @@
1
- class CityGrid
2
- class API
3
- class AdCenter
4
- class CallDetail < AdCenter
5
- class << self
6
- def get by, options = {}
7
- token = extract_auth_token options
8
- request_and_handle :post,
9
- "#{endpoint}/#{by}",
10
- :body => options.to_json,
11
- :headers => merge_headers("authToken" => token)
12
- end
13
-
14
- def note options = {}
15
- token = extract_auth_token options
16
- request_and_handle :post,
17
- "#{endpoint}/note",
18
- :body => options.to_json,
19
- :headers => merge_headers("authToken" => token)
20
- end
21
- end
22
- end
23
- end
24
- end
25
- end
@@ -1,8 +0,0 @@
1
- class CityGrid
2
- class API
3
- class AdCenter
4
- class Campaign < AdCenter
5
- end
6
- end
7
- end
8
- end
@@ -1,9 +0,0 @@
1
- class CityGrid
2
- class API
3
- class AdCenter
4
- class Category < AdCenter
5
- endpoint "/adcenter/categories/v2"
6
- end
7
- end
8
- end
9
- end
@@ -1,9 +0,0 @@
1
- class CityGrid
2
- class API
3
- class AdCenter
4
- class GeoLocation < AdCenter
5
- endpoint "/adcenter/categories/v2"
6
- end
7
- end
8
- end
9
- end