soapy_cake 1.18.1 → 1.19.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/soapy_cake.rb +1 -0
- data/lib/soapy_cake/client.rb +7 -1
- data/lib/soapy_cake/request.rb +4 -0
- data/lib/soapy_cake/version.rb +1 -1
- data/spec/integration/soapy_cake/admin_spec.rb +12 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1b885bb4fe2f48d057406017f66cb421de417619
|
4
|
+
data.tar.gz: c1d0e66a52f0b4acff03760ddcf9f94ef0da7f37
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 39f8963dd4d26fc38edec8478ce6b5e17af70d3c62a724fc4eb6814625f0fb5ed386e0e3f30793b64dafc18db6cf42bc4cdf6a7b8767f894f2345ea42cbbf65e
|
7
|
+
data.tar.gz: 8f2f6de99f031f2b5869ec82cbf02426996ea1047b1f17e6aa309579dba615a894bb3d0e2504e3d8e517cd9fae72559e9ab35b95ccb6f80d9c2ba580a4de9910
|
data/lib/soapy_cake.rb
CHANGED
data/lib/soapy_cake/client.rb
CHANGED
@@ -19,7 +19,7 @@ module SoapyCake
|
|
19
19
|
|
20
20
|
protected
|
21
21
|
|
22
|
-
attr_reader :domain, :api_key, :time_converter, :opts
|
22
|
+
attr_reader :domain, :api_key, :time_converter, :opts, :logger
|
23
23
|
|
24
24
|
def run(request)
|
25
25
|
request.api_key = api_key
|
@@ -31,11 +31,17 @@ module SoapyCake
|
|
31
31
|
|
32
32
|
private
|
33
33
|
|
34
|
+
def logger
|
35
|
+
@logger ||= opts[:logger] || (defined?(::Rails) && ::Rails.logger)
|
36
|
+
end
|
37
|
+
|
34
38
|
def response_body(request)
|
35
39
|
request.opts[:response].presence || http_response(request)
|
36
40
|
end
|
37
41
|
|
38
42
|
def http_response(request)
|
43
|
+
logger.info("soapy_cake:request #{request}") if logger
|
44
|
+
|
39
45
|
url = "https://#{domain}#{request.path}"
|
40
46
|
http_response = HTTParty.post(url, headers: HEADERS, body: request.xml, timeout: NET_TIMEOUT)
|
41
47
|
|
data/lib/soapy_cake/request.rb
CHANGED
data/lib/soapy_cake/version.rb
CHANGED
@@ -1,7 +1,15 @@
|
|
1
1
|
RSpec.describe SoapyCake::Admin do
|
2
2
|
around { |example| Timecop.freeze(Time.utc(2015, 6, 15, 12), &example) }
|
3
3
|
|
4
|
+
let(:logger) { double('logger') }
|
5
|
+
before { allow(logger).to receive(:info) }
|
6
|
+
|
7
|
+
subject { described_class.new(logger: logger) }
|
8
|
+
|
4
9
|
it 'returns an affiliate with correct data types', :vcr do
|
10
|
+
expect(logger).to receive(:info)
|
11
|
+
.with('soapy_cake:request admin:export:affiliates:5 {"affiliate_id":16027}')
|
12
|
+
|
5
13
|
result = subject.affiliates(affiliate_id: 16027)
|
6
14
|
expect(result.count).to eq(1)
|
7
15
|
expect(result.first).to include(
|
@@ -125,8 +133,10 @@ RSpec.describe SoapyCake::Admin do
|
|
125
133
|
advertiser: { advertiser_id: 15882, advertiser_name: ' NetDragon Websoft Inc. ' },
|
126
134
|
affiliate: { affiliate_id: 16187, affiliate_name: 'Illuminati Corp.' },
|
127
135
|
blacklist_id: 202,
|
128
|
-
blacklist_reason: {
|
129
|
-
|
136
|
+
blacklist_reason: {
|
137
|
+
blacklist_reason_id: 5,
|
138
|
+
blacklist_reason_name: 'Fraud - suspicious user-data'
|
139
|
+
},
|
130
140
|
blacklist_type: { blacklist_type_id: 1, blacklist_type_name: 'Global Redirect' },
|
131
141
|
date_created: Time.utc(2015, 9, 22, 22),
|
132
142
|
offer: { offer_id: 10551, offer_name: 'DO NOT USE: Foxy Test 42 (AD DOI)' },
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: soapy_cake
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.19.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- ad2games GmbH
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-11-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|