adcloud 0.7.5.2 → 0.7.6.0

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.
@@ -1,4 +1,4 @@
1
- Copyright (c) 2012 Jan Kus
1
+ Copyright (c) 2012 Adcloud GmbH
2
2
 
3
3
  Permission is hereby granted, free of charge, to any person obtaining
4
4
  a copy of this software and associated documentation files (the
data/README.md CHANGED
@@ -190,7 +190,6 @@ Create a new product
190
190
  puts product.errors.inspect
191
191
  end
192
192
 
193
-
194
193
  Topic
195
194
  -----
196
195
 
@@ -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
@@ -31,7 +31,7 @@ module Adcloud
31
31
  autoload :WebhookConfig, "adcloud/webhook_config"
32
32
  autoload :WebhookEvent, "adcloud/webhook_event"
33
33
 
34
- module AdcloudSucks; class InvalidApiResponse < StandardError; end; end
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 = 5
60
- c.http_read_timeout = 10
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
@@ -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 AdcloudSucks::InvalidApiResponse.new('Empty response for campaign validation')
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
@@ -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 AdcloudSucks::InvalidApiResponse unless response.body.has_key?("_meta")
11
+ # raise AdcloudUnknownAPIError::InvalidApiResponse unless response.body.has_key?("_meta")
12
12
  if response.success?
13
13
  response.body
14
14
  else
@@ -1,3 +1,3 @@
1
1
  module Adcloud
2
- VERSION = '0.7.5.2'
2
+ VERSION = '0.7.6.0'
3
3
  end
@@ -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::AdcloudSucks::InvalidApiResponse)
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.5.2
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: 2012-12-18 00:00:00.000000000 Z
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.24
235
+ rubygems_version: 1.8.25
236
236
  signing_key:
237
237
  specification_version: 3
238
238
  summary: Wrapper for adcloud API