appnexusapi 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/appnexusapi.gemspec +3 -3
- data/lib/appnexusapi/connection.rb +4 -2
- data/lib/appnexusapi/version.rb +1 -1
- metadata +8 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9d9ae1d9001c109f35bf8c38b541e7722c29e0eb
|
4
|
+
data.tar.gz: 06118d9a917b97273d9792b21382dff20a59d57a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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 = ["
|
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 = "
|
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
|
-
|
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.
|
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
|
data/lib/appnexusapi/version.rb
CHANGED
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.
|
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-
|
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
|
-
-
|
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:
|
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.
|
238
|
+
rubygems_version: 2.2.5
|
236
239
|
signing_key:
|
237
240
|
specification_version: 4
|
238
241
|
summary: Unofficial Ruby API Wrapper for Appnexus
|