appnexusapi 0.1.0 → 0.1.1

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: d0d8a696916d00cb33332f0c9f959536f321838b
4
- data.tar.gz: b6bc7bc92daf371d2f9c6141ee9f174d3f9a35f2
3
+ metadata.gz: 8b63b8d101eca2cb66dc080d7c5ef7b3f9e1e9d4
4
+ data.tar.gz: 7ff8db291e71dc36607b0a44b69b9ab3feb90703
5
5
  SHA512:
6
- metadata.gz: d3c91ef186f3236070d03cbec6780cae75a7b5a8d7631da21fc4187411e3039fe4364aca15e5b6f5f3e6548896b58e95975d3df69339b45dc8f64ab8d3bbf3b2
7
- data.tar.gz: 310fc055c9f7f0e6ff8c4a2094070bcc03b19f3b4be789078b25877237cf3f24484f745e9b74787092aa4929a8936813f7ed83b8ac99297c2dcaebfae1805e4f
6
+ metadata.gz: d86ce4b73c88990700087390f737fc5e76c8112127221dd0fd904743ad6692c822ff343fb973267c165dbd2d35db1e79219fc79f4ca29284d39a52f443c5bfa2
7
+ data.tar.gz: 5889df3927d2e16cc88c1a21b023c59f11e63da0f19131cde60dc47c451f0c5f6c149c82eef13f2f6c5d416219ab3dc8a7082d5a15e2f283c88264a8130b1319
@@ -1,5 +1,6 @@
1
1
  require 'faraday_middleware'
2
2
  require 'appnexusapi/faraday/raise_http_error'
3
+ require 'null_logger'
3
4
 
4
5
  class AppnexusApi::Connection
5
6
  RATE_EXCEEDED_DEFAULT_TIMEOUT = 15
@@ -8,7 +9,7 @@ class AppnexusApi::Connection
8
9
  def initialize(config)
9
10
  @config = config
10
11
  @config['uri'] ||= 'https://api.appnexus.com/'
11
- @logger = @config['logger'] || NullLogger.new
12
+ @logger = @config['logger'] || NullLogger.instance
12
13
  @connection = Faraday.new(@config['uri']) do |conn|
13
14
  conn.response :logger, @logger, bodies: true
14
15
  conn.request :json
@@ -1,3 +1,3 @@
1
1
  module AppnexusApi
2
- VERSION = '0.1.0'.freeze
2
+ VERSION = '0.1.1'.freeze
3
3
  end
@@ -0,0 +1,11 @@
1
+ require 'spec_helper'
2
+
3
+ describe AppnexusApi::Connection do
4
+
5
+ it 'allows no logger to be specified' do
6
+ expect do
7
+ AppnexusApi::CreativeService.new(connection_with_null_logger, ENV['APPNEXUS_MEMBER_ID'])
8
+ end.to_not raise_error
9
+ end
10
+
11
+ end
data/spec/spec_helper.rb CHANGED
@@ -1,7 +1,6 @@
1
1
  require 'dotenv'
2
2
  Dotenv.load
3
3
 
4
- Bundler.require
5
4
  require 'pry'
6
5
  require 'logger'
7
6
  require_relative '../lib/appnexusapi'
@@ -26,3 +25,12 @@ def connection
26
25
  'logger' => test_logger
27
26
  )
28
27
  end
28
+
29
+ def connection_with_null_logger
30
+ AppnexusApi::Connection.new(
31
+ 'username' => ENV['APPNEXUS_USERNAME'],
32
+ 'password' => ENV['APPNEXUS_PASSWORD'],
33
+ 'uri' => ENV['APPNEXUS_URI']
34
+ )
35
+ end
36
+
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: appnexusapi
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brandon Aaron
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-08-23 00:00:00.000000000 Z
11
+ date: 2016-08-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday
@@ -210,6 +210,7 @@ files:
210
210
  - lib/appnexusapi/user_resource.rb
211
211
  - lib/appnexusapi/user_service.rb
212
212
  - lib/appnexusapi/version.rb
213
+ - spec/connection_spec.rb
213
214
  - spec/creative_service_spec.rb
214
215
  - spec/spec_helper.rb
215
216
  homepage: http://simpli.fi
@@ -231,10 +232,11 @@ required_rubygems_version: !ruby/object:Gem::Requirement
231
232
  version: '0'
232
233
  requirements: []
233
234
  rubyforge_project:
234
- rubygems_version: 2.2.5
235
+ rubygems_version: 2.4.5
235
236
  signing_key:
236
237
  specification_version: 4
237
238
  summary: Unofficial Ruby API Wrapper for Appnexus
238
239
  test_files:
240
+ - spec/connection_spec.rb
239
241
  - spec/creative_service_spec.rb
240
242
  - spec/spec_helper.rb