bing_ads_ruby_sdk 1.2.0 → 1.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/README.md +6 -2
- data/changelog.md +3 -0
- data/lib/bing_ads_ruby_sdk/configuration.rb +2 -1
- data/lib/bing_ads_ruby_sdk/http_client.rb +19 -9
- data/lib/bing_ads_ruby_sdk/version.rb +1 -1
- metadata +3 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 89dc5300add7a826e0b81dde909dfa4fea569158cbc69262fc88df6aaa3be605
|
4
|
+
data.tar.gz: f6532c9e322b4b3fdf152360f18c372e481dd192a17e3cb0f93832e3a162cfff
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 46ccf557939fcc6310d94e0db8747e9a597e7107f7ce4782892118c2515b8b264612cae449c5c6630df63dccb9308024d0c3b742672fb5731688925c916ee526
|
7
|
+
data.tar.gz: 3edfd79352c1b33cb19e81115287c9b3e19722045660d887591e3b70345e88f831c3baca62fba50bfaaaaf055652996e006dbc7d46179619d5928cbf05ae984c
|
data/README.md
CHANGED
@@ -72,6 +72,10 @@ BingAdsRubySdk.configure do |conf|
|
|
72
72
|
conf.pretty_print_xml = true
|
73
73
|
# to filter sensitive data before logging
|
74
74
|
conf.filters = ["AuthenticationToken", "DeveloperToken"]
|
75
|
+
|
76
|
+
# Optionally allow ActiveSupport::Notifications to be emitted by Excon.
|
77
|
+
# These notifications can then be sent on to your profiling system
|
78
|
+
# conf.instrumentor = ActiveSupport::Notifications
|
75
79
|
end
|
76
80
|
```
|
77
81
|
|
@@ -102,9 +106,9 @@ Here's how to run the tests:
|
|
102
106
|
* Put your Client ID, Developer Token, and Parent Customer ID in the methods
|
103
107
|
with the same names in `spec/examples/examples.rb`
|
104
108
|
* Run the specs in order, for example:
|
105
|
-
* `bundle exec
|
109
|
+
* `bundle exec rspec spec/examples/1_...`, at the end of the spec there will be
|
106
110
|
a message at the end about copying an ID into `spec/examples/examples.rb`
|
107
|
-
* `bundle exec
|
111
|
+
* `bundle exec rspec spec/examples/2_...`
|
108
112
|
* keep repeating until you have run all the specs in `spec/examples`
|
109
113
|
|
110
114
|
## Contributing
|
data/changelog.md
CHANGED
@@ -2,13 +2,14 @@
|
|
2
2
|
|
3
3
|
module BingAdsRubySdk
|
4
4
|
class Configuration
|
5
|
-
attr_accessor :pretty_print_xml, :filters, :log
|
5
|
+
attr_accessor :pretty_print_xml, :filters, :log, :instrumentor
|
6
6
|
attr_writer :logger
|
7
7
|
|
8
8
|
def initialize
|
9
9
|
@log = false
|
10
10
|
@pretty_print_xml = false
|
11
11
|
@filters = []
|
12
|
+
@instrumentor = nil
|
12
13
|
end
|
13
14
|
|
14
15
|
def logger
|
@@ -11,6 +11,17 @@ module BingAdsRubySdk
|
|
11
11
|
HTTP_RETRY_COUNT_ON_TIMEOUT = 2
|
12
12
|
HTTP_INTERVAL_RETRY_COUNT_ON_TIMEOUT = 1
|
13
13
|
HTTP_ERRORS = [ Net::HTTPServerError, Net::HTTPClientError ]
|
14
|
+
CONNECTION_SETTINGS = {
|
15
|
+
persistent: true,
|
16
|
+
tcp_nodelay: true,
|
17
|
+
retry_limit: HTTP_RETRY_COUNT_ON_TIMEOUT,
|
18
|
+
idempotent: true,
|
19
|
+
retry_interval: HTTP_INTERVAL_RETRY_COUNT_ON_TIMEOUT,
|
20
|
+
connect_timeout: HTTP_OPEN_TIMEOUT,
|
21
|
+
read_timeout: HTTP_READ_TIMEOUT,
|
22
|
+
ssl_version: :TLSv1_2,
|
23
|
+
ciphers: "TLSv1.2:!aNULL:!eNULL",
|
24
|
+
}
|
14
25
|
|
15
26
|
class << self
|
16
27
|
def post(request)
|
@@ -46,18 +57,17 @@ module BingAdsRubySdk
|
|
46
57
|
HTTP_ERRORS.any? { |http_error_class| response.class <= http_error_class }
|
47
58
|
end
|
48
59
|
|
60
|
+
def connection_settings
|
61
|
+
CONNECTION_SETTINGS.tap do |args|
|
62
|
+
instrumentor = BingAdsRubySdk.config.instrumentor
|
63
|
+
args[:instrumentor] = instrumentor if instrumentor
|
64
|
+
end
|
65
|
+
end
|
66
|
+
|
49
67
|
def connection(host)
|
50
68
|
self.http_connections[host] ||= Excon.new(
|
51
69
|
host,
|
52
|
-
|
53
|
-
tcp_nodelay: true,
|
54
|
-
retry_limit: HTTP_RETRY_COUNT_ON_TIMEOUT,
|
55
|
-
idempotent: true,
|
56
|
-
retry_interval: HTTP_INTERVAL_RETRY_COUNT_ON_TIMEOUT,
|
57
|
-
connect_timeout: HTTP_OPEN_TIMEOUT,
|
58
|
-
read_timeout: HTTP_READ_TIMEOUT,
|
59
|
-
ssl_version: :TLSv1_2,
|
60
|
-
ciphers: "TLSv1.2:!aNULL:!eNULL",
|
70
|
+
connection_settings
|
61
71
|
)
|
62
72
|
end
|
63
73
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bing_ads_ruby_sdk
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Effilab
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2019-
|
12
|
+
date: 2019-07-15 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: signet
|
@@ -340,8 +340,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
340
340
|
- !ruby/object:Gem::Version
|
341
341
|
version: '0'
|
342
342
|
requirements: []
|
343
|
-
|
344
|
-
rubygems_version: 2.6.11
|
343
|
+
rubygems_version: 3.0.3
|
345
344
|
signing_key:
|
346
345
|
specification_version: 4
|
347
346
|
summary: Bing Ads Ruby SDK
|