soapy_cake 1.24.1 → 1.25.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.ruby-version +1 -1
- data/api.yml +1 -1
- data/lib/soapy_cake/admin_addedit.rb +4 -4
- data/lib/soapy_cake/admin_batched.rb +9 -3
- data/lib/soapy_cake/request.rb +1 -1
- data/lib/soapy_cake/response.rb +1 -1
- data/lib/soapy_cake/version.rb +1 -1
- data/spec/fixtures/vcr_cassettes/SoapyCake_AdminAddedit/geo_targeting/creates_geo_targetings.yml +8 -8
- data/spec/integration/soapy_cake/admin_addedit_spec.rb +1 -1
- data/spec/integration/soapy_cake/admin_spec.rb +1 -1
- data/spec/lib/soapy_cake/admin_batched_spec.rb +2 -2
- data/spec/lib/soapy_cake/admin_spec.rb +1 -1
- data/spec/lib/soapy_cake/affiliate_spec.rb +1 -1
- data/spec/lib/soapy_cake/response_value_spec.rb +1 -1
- data/spec/support/admin_method_example.rb +1 -1
- 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: f34206792cd5e4c12a01f151950c2cdc2fb93842
|
4
|
+
data.tar.gz: 3b001b6ab170294913d412bca3d587aac23284d1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0769d845dc9e1ee7ab2b9e967a828b25fa33273f3b2aca9138d9dd9642417405ae1dfe98f29e3891a2416b8b621546cbccbc8ee7e7de54ee2dbf00ff85e7dc7e
|
7
|
+
data.tar.gz: ee939674e9521deb531591dbf10a4ad48d3e42ad8b008361237d77bdee61bd57a5f36fe5b6ba301af0ec49ab14331ab5b70a07326059b2cd2fb0ff0650385e2b
|
data/.ruby-version
CHANGED
@@ -1 +1 @@
|
|
1
|
-
2.3.
|
1
|
+
2.3.1
|
data/api.yml
CHANGED
@@ -125,19 +125,19 @@ module SoapyCake
|
|
125
125
|
opts = opts.dup
|
126
126
|
countries = Array(opts[:countries])
|
127
127
|
opts[:countries] = countries.join(',')
|
128
|
-
opts[:
|
128
|
+
opts[:redirect_site_offer_contract_ids] = ([-1] * countries.count).join(',')
|
129
129
|
opts
|
130
130
|
end
|
131
131
|
|
132
132
|
def geo_targets_redirect_options(opts)
|
133
133
|
opts = opts.dup
|
134
134
|
redirects = opts.delete(:redirects)
|
135
|
-
unless redirects.is_a?(Hash) && redirects.keys.count
|
135
|
+
unless redirects.is_a?(Hash) && redirects.keys.count.positive?
|
136
136
|
raise Error, "Parameter 'redirects' must be a COUNTRY=>REDIRECT_OFFER_CONTRACT_ID hash!"
|
137
137
|
end
|
138
138
|
|
139
139
|
opts[:countries] = redirects.keys.join(',')
|
140
|
-
opts[:
|
140
|
+
opts[:redirect_site_offer_contract_ids] = redirects.values.join(',')
|
141
141
|
opts
|
142
142
|
end
|
143
143
|
|
@@ -221,7 +221,7 @@ module SoapyCake
|
|
221
221
|
opts[:tags_modification_type] =
|
222
222
|
if opts[:tags].to_s == ''
|
223
223
|
'remove_all'
|
224
|
-
elsif opts.delete(:tags_replace) && opts[:offer_id]
|
224
|
+
elsif opts.delete(:tags_replace) && opts[:offer_id].nonzero?
|
225
225
|
'replace'
|
226
226
|
else
|
227
227
|
'add'
|
@@ -60,10 +60,16 @@ module SoapyCake
|
|
60
60
|
attr_reader :admin, :method, :opts, :offset, :limit
|
61
61
|
end
|
62
62
|
|
63
|
-
def
|
64
|
-
|
63
|
+
def respond_to_missing?(name)
|
64
|
+
ALLOWED_METHODS.include?(name)
|
65
|
+
end
|
65
66
|
|
66
|
-
|
67
|
+
def method_missing(name, method_opts = {}, limit = nil)
|
68
|
+
if respond_to_missing?(name)
|
69
|
+
BatchedRequest.new(admin, name, method_opts, limit).to_enum
|
70
|
+
else
|
71
|
+
super
|
72
|
+
end
|
67
73
|
end
|
68
74
|
|
69
75
|
private
|
data/lib/soapy_cake/request.rb
CHANGED
data/lib/soapy_cake/response.rb
CHANGED
@@ -78,7 +78,7 @@ module SoapyCake
|
|
78
78
|
# for this specific request. Also, this is the only request with a tag depth
|
79
79
|
# of 4, not 3 or 5 like ALL OTHER requests.
|
80
80
|
# BTW: There is a 10$ reward if anyone can find a worse designed API.
|
81
|
-
return true if sax.for_tag(:MediaType).count
|
81
|
+
return true if sax.for_tag(:MediaType).count.positive?
|
82
82
|
|
83
83
|
false
|
84
84
|
end
|
data/lib/soapy_cake/version.rb
CHANGED
data/spec/fixtures/vcr_cassettes/SoapyCake_AdminAddedit/geo_targeting/creates_geo_targetings.yml
CHANGED
@@ -2,12 +2,12 @@
|
|
2
2
|
http_interactions:
|
3
3
|
- request:
|
4
4
|
method: post
|
5
|
-
uri: https://cake-partner-domain.com/api/
|
5
|
+
uri: https://cake-partner-domain.com/api/3/addedit.asmx
|
6
6
|
body:
|
7
7
|
encoding: UTF-8
|
8
8
|
string: |
|
9
9
|
<?xml version="1.0"?>
|
10
|
-
<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope" xmlns:cake="http://cakemarketing.com/api/
|
10
|
+
<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope" xmlns:cake="http://cakemarketing.com/api/3/">
|
11
11
|
<env:Header/>
|
12
12
|
<env:Body>
|
13
13
|
<cake:GeoTargets>
|
@@ -15,7 +15,7 @@ http_interactions:
|
|
15
15
|
<cake:offer_contract_id>1456</cake:offer_contract_id>
|
16
16
|
<cake:countries>DE,FR</cake:countries>
|
17
17
|
<cake:allow_countries>true</cake:allow_countries>
|
18
|
-
<cake:
|
18
|
+
<cake:redirect_site_offer_contract_ids>-1,-1</cake:redirect_site_offer_contract_ids>
|
19
19
|
<cake:add_edit_option>add</cake:add_edit_option>
|
20
20
|
<cake:set_targeting_to_geo>true</cake:set_targeting_to_geo>
|
21
21
|
</cake:GeoTargets>
|
@@ -47,18 +47,18 @@ http_interactions:
|
|
47
47
|
encoding: UTF-8
|
48
48
|
string: <?xml version="1.0" encoding="utf-8"?><soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope"
|
49
49
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"><soap:Body><GeoTargetsResponse
|
50
|
-
xmlns="http://cakemarketing.com/api/
|
50
|
+
xmlns="http://cakemarketing.com/api/3/"><GeoTargetsResult><success>true</success><message>Geotarget(s)
|
51
51
|
Added</message><row_count>2</row_count></GeoTargetsResult></GeoTargetsResponse></soap:Body></soap:Envelope>
|
52
52
|
http_version:
|
53
53
|
recorded_at: Tue, 17 Feb 2015 12:00:00 GMT
|
54
54
|
- request:
|
55
55
|
method: post
|
56
|
-
uri: https://cake-partner-domain.com/api/
|
56
|
+
uri: https://cake-partner-domain.com/api/3/addedit.asmx
|
57
57
|
body:
|
58
58
|
encoding: UTF-8
|
59
59
|
string: |
|
60
60
|
<?xml version="1.0"?>
|
61
|
-
<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope" xmlns:cake="http://cakemarketing.com/api/
|
61
|
+
<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope" xmlns:cake="http://cakemarketing.com/api/3/">
|
62
62
|
<env:Header/>
|
63
63
|
<env:Body>
|
64
64
|
<cake:GeoTargets>
|
@@ -66,7 +66,7 @@ http_interactions:
|
|
66
66
|
<cake:offer_contract_id>1456</cake:offer_contract_id>
|
67
67
|
<cake:countries>AT,CH</cake:countries>
|
68
68
|
<cake:allow_countries>false</cake:allow_countries>
|
69
|
-
<cake:
|
69
|
+
<cake:redirect_site_offer_contract_ids>1392,1392</cake:redirect_site_offer_contract_ids>
|
70
70
|
<cake:add_edit_option>add</cake:add_edit_option>
|
71
71
|
<cake:set_targeting_to_geo>true</cake:set_targeting_to_geo>
|
72
72
|
</cake:GeoTargets>
|
@@ -98,7 +98,7 @@ http_interactions:
|
|
98
98
|
encoding: UTF-8
|
99
99
|
string: <?xml version="1.0" encoding="utf-8"?><soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope"
|
100
100
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"><soap:Body><GeoTargetsResponse
|
101
|
-
xmlns="http://cakemarketing.com/api/
|
101
|
+
xmlns="http://cakemarketing.com/api/3/"><GeoTargetsResult><success>true</success><message>Geotarget(s)
|
102
102
|
Added</message><row_count>2</row_count></GeoTargetsResult></GeoTargetsResponse></soap:Body></soap:Envelope>
|
103
103
|
http_version:
|
104
104
|
recorded_at: Tue, 17 Feb 2015 12:00:00 GMT
|
@@ -2,7 +2,7 @@
|
|
2
2
|
RSpec.describe SoapyCake::Admin do
|
3
3
|
around { |example| Timecop.freeze(Time.utc(2015, 6, 15, 12), &example) }
|
4
4
|
|
5
|
-
let(:logger) {
|
5
|
+
let(:logger) { instance_double(Logger) }
|
6
6
|
before { allow(logger).to receive(:info) }
|
7
7
|
|
8
8
|
subject { described_class.new(logger: logger) }
|
@@ -1,6 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
RSpec.describe SoapyCake::AdminBatched do
|
3
|
-
let(:admin) {
|
3
|
+
let(:admin) { instance_double(SoapyCake::Admin, xml_response?: false) }
|
4
4
|
|
5
5
|
before :each do
|
6
6
|
allow(SoapyCake::Admin).to receive(:new).and_return(admin)
|
@@ -51,7 +51,7 @@ RSpec.describe SoapyCake::AdminBatched do
|
|
51
51
|
|
52
52
|
context 'errors' do
|
53
53
|
it 'fails with an invalid method' do
|
54
|
-
expect { subject.something }.to raise_error(
|
54
|
+
expect { subject.something }.to raise_error(NoMethodError)
|
55
55
|
end
|
56
56
|
|
57
57
|
it 'fails when row_limit is set' do
|
@@ -178,7 +178,7 @@ RSpec.describe SoapyCake::Admin do
|
|
178
178
|
|
179
179
|
let(:method) { :add_blacklist }
|
180
180
|
let(:cake_method) { :blacklist }
|
181
|
-
let(:request) {
|
181
|
+
let(:request) { instance_double(SoapyCake::Request) }
|
182
182
|
let(:opts) { { blacklist_date: date } }
|
183
183
|
|
184
184
|
context 'immediate blacklisting for current date' do
|
@@ -8,7 +8,7 @@ RSpec.describe SoapyCake::Affiliate do
|
|
8
8
|
|
9
9
|
shared_examples_for 'a cake affiliate method' do
|
10
10
|
it 'runs the request' do
|
11
|
-
request =
|
11
|
+
request = instance_double(SoapyCake::Request)
|
12
12
|
expect(SoapyCake::Request).to receive(:new)
|
13
13
|
.with(:affiliate, service, method, cake_opts).and_return(request)
|
14
14
|
expect(subject).to receive(:run).with(request)
|
@@ -1,6 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
RSpec.describe SoapyCake::ResponseValue do
|
3
|
-
let(:time_converter) {
|
3
|
+
let(:time_converter) { instance_double(SoapyCake::TimeConverter) }
|
4
4
|
|
5
5
|
def parse(key, value)
|
6
6
|
described_class.new(key, value, time_converter).parse
|
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.25.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- ad2games GmbH
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-08-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|