adcloud 0.7.5.2 → 0.7.6.0
Sign up to get free protection for your applications and to get access to all the features.
- data/LICENSE.txt +1 -1
- data/README.md +0 -1
- data/RELEASE_NOTES.md +5 -1
- data/lib/adcloud.rb +3 -3
- data/lib/adcloud/campaign.rb +2 -2
- data/lib/adcloud/entity.rb +6 -0
- data/lib/adcloud/response_error_handler.rb +1 -1
- data/lib/adcloud/version.rb +1 -1
- data/test/adcloud/campaign_test.rb +1 -1
- metadata +3 -3
data/LICENSE.txt
CHANGED
data/README.md
CHANGED
data/RELEASE_NOTES.md
CHANGED
@@ -1,6 +1,10 @@
|
|
1
1
|
Release Notes
|
2
2
|
=============
|
3
3
|
|
4
|
+
### 0.7.5.2
|
5
|
+
|
6
|
+
* renamed leads_* to conversions_* for `CampaignPerformanceEntry`
|
7
|
+
|
4
8
|
### 0.7.5.1
|
5
9
|
|
6
10
|
* Log failed api responses
|
@@ -40,4 +44,4 @@ Release Notes
|
|
40
44
|
* Create media files
|
41
45
|
* Find and create products
|
42
46
|
* Fetch report data by day
|
43
|
-
* Find and create topics
|
47
|
+
* Find and create topics
|
data/lib/adcloud.rb
CHANGED
@@ -31,7 +31,7 @@ module Adcloud
|
|
31
31
|
autoload :WebhookConfig, "adcloud/webhook_config"
|
32
32
|
autoload :WebhookEvent, "adcloud/webhook_event"
|
33
33
|
|
34
|
-
module
|
34
|
+
module AdcloudUnknownAPIError; class InvalidApiResponse < StandardError; end; end
|
35
35
|
class BadRequestError < ApiError; end
|
36
36
|
class NotFoundError < ApiError; end
|
37
37
|
class ServerError < ApiError; end
|
@@ -56,8 +56,8 @@ Adcloud.configure do |c|
|
|
56
56
|
c.protocol = 'https'
|
57
57
|
c.host = 'api.adcloud.com'
|
58
58
|
c.api_version = "v2"
|
59
|
-
c.http_open_timeout =
|
60
|
-
c.http_read_timeout =
|
59
|
+
c.http_open_timeout = 120
|
60
|
+
c.http_read_timeout = 1800
|
61
61
|
c.debug = false
|
62
62
|
c.webhooks = Adcloud::WebhookConfig.new
|
63
63
|
c.webhooks.filter_tests = true
|
data/lib/adcloud/campaign.rb
CHANGED
@@ -58,7 +58,7 @@ module Adcloud
|
|
58
58
|
if result && result["_meta"] && result["_meta"]["status"] == 226
|
59
59
|
@errors = self.errors.merge(result["_meta"]["details"])
|
60
60
|
else
|
61
|
-
raise
|
61
|
+
raise AdcloudUnknownAPIError::InvalidApiResponse.new('Empty response for campaign validation')
|
62
62
|
end
|
63
63
|
end
|
64
64
|
|
@@ -83,4 +83,4 @@ module Adcloud
|
|
83
83
|
self.errors.empty?
|
84
84
|
end
|
85
85
|
end
|
86
|
-
end
|
86
|
+
end
|
data/lib/adcloud/entity.rb
CHANGED
@@ -82,6 +82,12 @@ module Adcloud
|
|
82
82
|
self.new(result)
|
83
83
|
end
|
84
84
|
|
85
|
+
# @return [Object] The entity with the unique identifier
|
86
|
+
def find_by_name(name)
|
87
|
+
result = connection.get("campaigns/find_by_name", name: name)
|
88
|
+
result["items"].map { |raw_campaign| self.new(raw_campaign) }
|
89
|
+
end
|
90
|
+
|
85
91
|
# @return [Enitity] Object has errors when creation failed
|
86
92
|
def create(params = {})
|
87
93
|
entity = self.new(params)
|
@@ -8,7 +8,7 @@ module Adcloud
|
|
8
8
|
@app.call(env).on_complete do
|
9
9
|
response = env[:response]
|
10
10
|
# Todo comment in when ready
|
11
|
-
# raise
|
11
|
+
# raise AdcloudUnknownAPIError::InvalidApiResponse unless response.body.has_key?("_meta")
|
12
12
|
if response.success?
|
13
13
|
response.body
|
14
14
|
else
|
data/lib/adcloud/version.rb
CHANGED
@@ -28,7 +28,7 @@ describe Adcloud::Campaign do
|
|
28
28
|
|
29
29
|
it 'raises an exception when the response is not well formatted' do
|
30
30
|
connection.expects(:get).with('campaigns/validate', { campaign: request_attributes })
|
31
|
-
-> { campaign.validate }.must_raise(Adcloud::
|
31
|
+
-> { campaign.validate }.must_raise(Adcloud::AdcloudUnknownAPIError::InvalidApiResponse)
|
32
32
|
end
|
33
33
|
end
|
34
34
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: adcloud
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.7.
|
4
|
+
version: 0.7.6.0
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date:
|
13
|
+
date: 2013-05-06 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: minitest
|
@@ -232,7 +232,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
232
232
|
version: '0'
|
233
233
|
requirements: []
|
234
234
|
rubyforge_project:
|
235
|
-
rubygems_version: 1.8.
|
235
|
+
rubygems_version: 1.8.25
|
236
236
|
signing_key:
|
237
237
|
specification_version: 3
|
238
238
|
summary: Wrapper for adcloud API
|