appnexusapi 0.1.1 → 0.1.2

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 8b63b8d101eca2cb66dc080d7c5ef7b3f9e1e9d4
4
- data.tar.gz: 7ff8db291e71dc36607b0a44b69b9ab3feb90703
3
+ metadata.gz: 9d9ae1d9001c109f35bf8c38b541e7722c29e0eb
4
+ data.tar.gz: 06118d9a917b97273d9792b21382dff20a59d57a
5
5
  SHA512:
6
- metadata.gz: d86ce4b73c88990700087390f737fc5e76c8112127221dd0fd904743ad6692c822ff343fb973267c165dbd2d35db1e79219fc79f4ca29284d39a52f443c5bfa2
7
- data.tar.gz: 5889df3927d2e16cc88c1a21b023c59f11e63da0f19131cde60dc47c451f0c5f6c149c82eef13f2f6c5d416219ab3dc8a7082d5a15e2f283c88264a8130b1319
6
+ metadata.gz: 3950effbec5221fc83cffeae274f3944f374b58387d03eef207b0eea06bc6a4634a16ab6e681ba358e2962d4fddc578252ac072e99aea14280b53f7307f2d4c3
7
+ data.tar.gz: 031d5bc3343a53d2c4e64935940fef7a97607c68a3d343f632ebd0a040f13a694f145bfdcbf3c3887ef271e89935097c264bb2cd2dc6687e678ad1275d55bcf7
data/appnexusapi.gemspec CHANGED
@@ -2,11 +2,11 @@
2
2
  require File.expand_path('../lib/appnexusapi/version', __FILE__)
3
3
 
4
4
  Gem::Specification.new do |gem|
5
- gem.authors = ["Brandon Aaron"]
6
- gem.email = ["brandon.aaron@gmail.com"]
5
+ gem.authors = ["Marlon Moyer", "Josh Scott", "Brandon Aaron"]
6
+ gem.email = ["marlon@simpli.fi", "josh@simpli.fi"]
7
7
  gem.description = %q{}
8
8
  gem.summary = %q{Unofficial Ruby API Wrapper for Appnexus}
9
- gem.homepage = "http://simpli.fi"
9
+ gem.homepage = "https://github.com/simplifi/appnexusapi"
10
10
 
11
11
  gem.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
12
12
  gem.files = `git ls-files`.split("\n")
@@ -4,7 +4,9 @@ require 'null_logger'
4
4
 
5
5
  class AppnexusApi::Connection
6
6
  RATE_EXCEEDED_DEFAULT_TIMEOUT = 15
7
- RATE_EXCEEDED_HTTP_CODE = 429
7
+ # Inexplicably, sandbox uses the correct code of 429, while production uses 405? so
8
+ # we just rely on the error message
9
+ RATE_EXCEEDED_ERROR = "RATE_EXCEEDED".freeze
8
10
 
9
11
  def initialize(config)
10
12
  @config = config
@@ -68,7 +70,7 @@ class AppnexusApi::Connection
68
70
  body,
69
71
  { 'Authorization' => @token }.merge(headers)
70
72
  )
71
- break unless response.status == RATE_EXCEEDED_HTTP_CODE
73
+ break unless response.body.fetch('response', {})['error_code'] == RATE_EXCEEDED_ERROR
72
74
  wait_time = response.headers['retry-after'] || RATE_EXCEEDED_DEFAULT_TIMEOUT
73
75
  log.info("received rate exceeded. wait time: #{wait_time}s")
74
76
  sleep wait_time.to_i
@@ -1,3 +1,3 @@
1
1
  module AppnexusApi
2
- VERSION = '0.1.1'.freeze
2
+ VERSION = '0.1.2'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,16 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: appnexusapi
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
+ - Marlon Moyer
8
+ - Josh Scott
7
9
  - Brandon Aaron
8
10
  autorequire:
9
11
  bindir: bin
10
12
  cert_chain: []
11
- date: 2016-08-24 00:00:00.000000000 Z
13
+ date: 2016-08-25 00:00:00.000000000 Z
12
14
  dependencies:
13
15
  - !ruby/object:Gem::Dependency
14
16
  name: faraday
@@ -138,7 +140,8 @@ dependencies:
138
140
  version: '0'
139
141
  description: ''
140
142
  email:
141
- - brandon.aaron@gmail.com
143
+ - marlon@simpli.fi
144
+ - josh@simpli.fi
142
145
  executables: []
143
146
  extensions: []
144
147
  extra_rdoc_files: []
@@ -213,7 +216,7 @@ files:
213
216
  - spec/connection_spec.rb
214
217
  - spec/creative_service_spec.rb
215
218
  - spec/spec_helper.rb
216
- homepage: http://simpli.fi
219
+ homepage: https://github.com/simplifi/appnexusapi
217
220
  licenses: []
218
221
  metadata: {}
219
222
  post_install_message:
@@ -232,7 +235,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
232
235
  version: '0'
233
236
  requirements: []
234
237
  rubyforge_project:
235
- rubygems_version: 2.4.5
238
+ rubygems_version: 2.2.5
236
239
  signing_key:
237
240
  specification_version: 4
238
241
  summary: Unofficial Ruby API Wrapper for Appnexus