adzerk 0.6 → 0.7

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 2321c22990edc573c0f196b4bd595cfe062e868c
4
- data.tar.gz: 3587892f9b11c5247d9e12fadbcd13e8a6af1597
3
+ metadata.gz: 4f9eeda38a1912464c7c167aed5d8062aa963435
4
+ data.tar.gz: e9bca2b96e673c63b0a04102240c00b344db1c88
5
5
  SHA512:
6
- metadata.gz: 945e89da810227bef4377774ea0381192b745ce63bc63f2faf8604e6c61262a15264f3afe83baa6f95c6f4738b6b07d9d31a94b8f1f62af8a3238545a41dbb6e
7
- data.tar.gz: ce30494b990b2bf3f1c0bdb80b2c67d81f5d31c67ba70812ab427a63c97441ac3ae49ddff83f3dbb41822e2a8cdc2a4a3f5c9bf2900f4f0ce75f4b58f0a7d7b0
6
+ metadata.gz: 1daf84e4c11e7de52c1af713dd37f2d1e7516bdaa17eb7266ae71f0d4809fe449d165e15f8281d1facd4ac3961a5a8923dc5950d639a144eab18eb3756b68beb
7
+ data.tar.gz: 1608cdcb6d58afbf4a957d23747d276aa4709aee2bbd7f9c67f11c9a2dbefc0ed4f54e02f1831b9b946df3dacd80fd0e4763a9e540c01bfa7d16f1b90259a011
@@ -9,7 +9,7 @@ module Adzerk
9
9
  :logins, :geotargetings, :sitezonetargetings, :categories
10
10
 
11
11
  DEFAULTS = {
12
- :host => ENV["ADZERK_API_HOST"] || 'http://api.adzerk.net/v1/',
12
+ :host => ENV["ADZERK_API_HOST"] || 'https://api.adzerk.net/v1/',
13
13
  :header => 'X-Adzerk-ApiKey'
14
14
  }
15
15
 
@@ -60,11 +60,11 @@ module Adzerk
60
60
  send_request(request, uri)
61
61
  end
62
62
 
63
- def create_creative(data={}, image_path='')
63
+ def create_creative(data={}, image_path='')
64
64
  response = RestClient.post(@config[:host] + 'creative',
65
65
  {:creative => camelize_data(data).to_json},
66
66
  :X_Adzerk_ApiKey => @api_key,
67
- :content_type => :json,
67
+ :content_type => :json,
68
68
  :accept => :json)
69
69
  response = upload_creative(JSON.parse(response)["Id"], image_path) unless image_path.empty?
70
70
  response
@@ -80,6 +80,7 @@ module Adzerk
80
80
 
81
81
  def send_request(request, uri)
82
82
  http = Net::HTTP.new(uri.host, uri.port)
83
+ http.use_ssl = uri.scheme == 'https'
83
84
  response = http.request(request)
84
85
  if response.kind_of? Net::HTTPClientError
85
86
  error_response = JSON.parse(response.body)
@@ -1,3 +1,3 @@
1
1
  module Adzerk
2
- VERSION = "0.6"
2
+ VERSION = "0.7"
3
3
  end
@@ -49,6 +49,7 @@ describe "Ad Type API" do
49
49
  end
50
50
 
51
51
  it "should delete ad type for channel" do
52
+ $ad_type_channel_id = @client.channels.list[:items].last[:id].to_s
52
53
  @client.ad_types.delete($ad_type_channel_id, $channel_id)
53
54
  end
54
55
  end
@@ -62,8 +62,9 @@ describe "Advertiser API" do
62
62
  end
63
63
  end
64
64
 
65
- it "should not get individual deleted advertiser" do
66
- expect { @advertisers.get $advertiser_id }.to raise_error("This advertiser is deleted.")
65
+ it "should get individual deleted advertiser" do
66
+ advertiser = @advertisers.get $advertiser_id
67
+ expect(advertiser[:is_deleted]).to eq(true)
67
68
  end
68
69
 
69
70
  it "should not update a deleted advertiser" do
@@ -86,8 +86,8 @@ describe "Category API" do
86
86
  end
87
87
 
88
88
  it "should list categories for the current network" do
89
- cat = @category.listAll()[:items].last
90
- expect(cat[:name]).to eq($category_name)
89
+ cats = @category.listAll()[:items].select { |x| x[:name] == $category_name }
90
+ expect(cats.count).to eq(1)
91
91
  end
92
92
 
93
93
  it "should delete a category from a flight" do
@@ -82,8 +82,9 @@ describe "Channel API" do
82
82
  expect(response.body).to eq('"Successfully deleted"')
83
83
  end
84
84
 
85
- it "should not get individual deleted channel" do
86
- expect{ @channels.get($channel_id) }.to raise_error 'This channel has been deleted'
85
+ it "should get individual deleted channel" do
86
+ channel = @channels.get $channel_id
87
+ expect(channel[:is_deleted]).to eq(true)
87
88
  end
88
89
 
89
90
  it "should not update deleted channels" do
@@ -327,8 +327,9 @@ describe "Creative Flight API" do
327
327
  expect{ @creative_maps.get(123, @flight_id) }.to raise_error "This flight is not part of your network"
328
328
  end
329
329
 
330
- it "should not get a map that's been deleted" do
331
- expect{ @creative_maps.get($map_id, @flight_id) }.to raise_error "This creative map has been deleted"
330
+ it "should get a map that's been deleted" do
331
+ map = @creative_maps.get($map_id, @flight_id)
332
+ expect(map[:is_deleted]).to eq(true)
332
333
  end
333
334
 
334
335
  it "should not update a map that's in a different network" do
@@ -154,6 +154,7 @@ describe "Flight API" do
154
154
  :priority_id => $priority_id,
155
155
  :start_date => $flight_StartDate,
156
156
  :goal_type => $flight_GoalType,
157
+ :impressions => $flight_Impressions,
157
158
  :is_companion => false)
158
159
  expect(flight[:name]).to eq("New Flight Name")
159
160
  expect(flight[:is_companion]).to be false
@@ -36,7 +36,7 @@ describe "Report API" do
36
36
  end
37
37
 
38
38
  it "should return a status of 1 if the report isn't ready yet" do
39
- bigger_report = $new_report.update(start_date: "1/1/2010", end_date: "10/1/2014")
39
+ bigger_report = $new_report.update(start_date: "1/1/2014", end_date: "10/1/2018")
40
40
  report_id = @reports.create_queued_report(bigger_report)[:id]
41
41
  # immediately poll for the result
42
42
  response = @reports.retrieve_queued_report(report_id)
@@ -6,6 +6,7 @@ describe "Channel API security" do
6
6
  it "should reject unauthenticated GET requests" do
7
7
  uri = URI.parse(API_HOST + 'channel/')
8
8
  http = Net::HTTP.new(uri.host, uri.port)
9
+ http.use_ssl = uri.scheme == 'https'
9
10
  request = Net::HTTP::Get.new(uri.request_uri)
10
11
  expect(http.request(request).response.code).not_to eq(200)
11
12
  end
@@ -13,6 +14,7 @@ describe "Channel API security" do
13
14
  it "should reject GET requests with null API keys" do
14
15
  uri = URI.parse(API_HOST + 'channel/')
15
16
  http = Net::HTTP.new(uri.host, uri.port)
17
+ http.use_ssl = uri.scheme == 'https'
16
18
  request = Net::HTTP::Get.new(uri.request_uri)
17
19
  request.add_field "X-Adzerk-ApiKey", ""
18
20
  expect(http.request(request).response.code).not_to eq(200)
@@ -7,7 +7,7 @@ require "adzerk"
7
7
  API_KEY = ENV['ADZERK_API_KEY']
8
8
  raise "The ADZERK_API_KEY environment variable must be set." unless API_KEY
9
9
 
10
- API_HOST = ENV['ADZERK_API_HOST'] || 'http://api.adzerk.net/v1/'
10
+ API_HOST = ENV['ADZERK_API_HOST'] || 'https://api.adzerk.net/v1/'
11
11
  # $adzerk = Adzerk.new(API_KEY)
12
12
 
13
13
  RSpec.configure do |config|
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: adzerk
3
3
  version: !ruby/object:Gem::Version
4
- version: '0.6'
4
+ version: '0.7'
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kacy Fortner
@@ -17,7 +17,7 @@ authors:
17
17
  autorequire:
18
18
  bindir: bin
19
19
  cert_chain: []
20
- date: 2015-06-22 00:00:00.000000000 Z
20
+ date: 2016-03-22 00:00:00.000000000 Z
21
21
  dependencies:
22
22
  - !ruby/object:Gem::Dependency
23
23
  name: rspec
@@ -82,45 +82,45 @@ extensions: []
82
82
  extra_rdoc_files: []
83
83
  files:
84
84
  - lib/adzerk.rb
85
- - lib/adzerk/version.rb
86
- - lib/adzerk/site_zone_targeting.rb
87
- - lib/adzerk/creative.rb
88
- - lib/adzerk/geo_targeting.rb
89
85
  - lib/adzerk/advertiser.rb
90
- - lib/adzerk/invitation.rb
91
- - lib/adzerk/client.rb
92
- - lib/adzerk/flight.rb
93
- - lib/adzerk/util.rb
94
- - lib/adzerk/category.rb
95
86
  - lib/adzerk/api_endpoint.rb
87
+ - lib/adzerk/category.rb
96
88
  - lib/adzerk/channel_site_map.rb
89
+ - lib/adzerk/client.rb
90
+ - lib/adzerk/creative.rb
97
91
  - lib/adzerk/creative_map.rb
98
- - lib/adzerk/reporting.rb
99
- - lib/adzerk/publisher.rb
100
92
  - lib/adzerk/errors.rb
93
+ - lib/adzerk/flight.rb
94
+ - lib/adzerk/geo_targeting.rb
95
+ - lib/adzerk/invitation.rb
101
96
  - lib/adzerk/priority.rb
102
- - test/site_zone_targeting_api_spec.rb
103
- - test/spec_helper.rb
104
- - test/zone_api_spec.rb
105
- - test/channel_site_map_api_spec.rb
106
- - test/creative_api_spec.rb
107
- - test/advertiser_api_spec.rb
97
+ - lib/adzerk/publisher.rb
98
+ - lib/adzerk/reporting.rb
99
+ - lib/adzerk/site_zone_targeting.rb
100
+ - lib/adzerk/util.rb
101
+ - lib/adzerk/version.rb
108
102
  - test/adtype_api_spec.rb
103
+ - test/advertiser_api_spec.rb
109
104
  - test/campaign_api_spec.rb
110
105
  - test/category_api_spec.rb
111
- - test/security_api_spec.rb
112
- - test/login_api_spec.rb
113
- - test/creative_map_api_spec.rb
114
106
  - test/channel_api_spec.rb
115
- - test/rakefile.rb
107
+ - test/channel_site_map_api_spec.rb
108
+ - test/creative_api_spec.rb
109
+ - test/creative_map_api_spec.rb
116
110
  - test/flight_api_spec.rb
117
- - test/site_api_spec.rb
118
- - test/priority_api_spec.rb
111
+ - test/geo_targeting_api_spec.rb
119
112
  - test/invitation_api_spec.rb
113
+ - test/login_api_spec.rb
114
+ - test/priority_api_spec.rb
115
+ - test/publisher_api_spec.rb
116
+ - test/rakefile.rb
120
117
  - test/report_api_spec.rb
118
+ - test/security_api_spec.rb
119
+ - test/site_api_spec.rb
120
+ - test/site_zone_targeting_api_spec.rb
121
+ - test/spec_helper.rb
121
122
  - test/util_spec.rb
122
- - test/geo_targeting_api_spec.rb
123
- - test/publisher_api_spec.rb
123
+ - test/zone_api_spec.rb
124
124
  homepage: http://adzerk.com
125
125
  licenses: []
126
126
  metadata: {}
@@ -140,7 +140,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
140
140
  version: '0'
141
141
  requirements: []
142
142
  rubyforge_project:
143
- rubygems_version: 2.0.14
143
+ rubygems_version: 2.4.6
144
144
  signing_key:
145
145
  specification_version: 4
146
146
  summary: Adzerk API