soapy_cake 1.19.0 → 1.20.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/soapy_cake.rb +1 -0
- data/lib/soapy_cake/client.rb +4 -2
- data/lib/soapy_cake/error.rb +1 -0
- data/lib/soapy_cake/response.rb +2 -1
- data/lib/soapy_cake/version.rb +1 -1
- data/soapy_cake.gemspec +1 -0
- data/spec/fixtures/vcr_cassettes/SoapyCake_Admin/XML_responses/fails_on_error.yml +2 -2
- metadata +15 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b83f34c1746ec07e1eb0eb47ddbb50c9fea4796c
|
4
|
+
data.tar.gz: f0dd1db1eaa1ba6550669564ea3a0c6984021a8c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ce98500805287cef4ed338947ca7f556e707c6143941ba02a9a9b2ce71d1ddd340347d742a69cccb277d4ce2bcf03c6e1c80d7572fe36b82185376710cc6e555
|
7
|
+
data.tar.gz: 082ec9d5cd54283ca0857bad5cf246bd43faf03bf27ac4314e8ebf3267b79ae593333668d1b06a9b2cccb2bc6bc6e60c4ed1f729dd512ef2c92585a7a4847365
|
data/lib/soapy_cake.rb
CHANGED
data/lib/soapy_cake/client.rb
CHANGED
@@ -25,8 +25,10 @@ module SoapyCake
|
|
25
25
|
request.api_key = api_key
|
26
26
|
request.time_converter = time_converter
|
27
27
|
|
28
|
-
|
29
|
-
|
28
|
+
Retryable.retryable(tries: 5, on: RateLimitError, sleep: -> (n) { 3**n }) do
|
29
|
+
response = Response.new(response_body(request), request.short_response?, time_converter)
|
30
|
+
xml_response? ? response.to_xml : response.to_enum
|
31
|
+
end
|
30
32
|
end
|
31
33
|
|
32
34
|
private
|
data/lib/soapy_cake/error.rb
CHANGED
data/lib/soapy_cake/response.rb
CHANGED
@@ -67,6 +67,7 @@ module SoapyCake
|
|
67
67
|
|
68
68
|
def error_check_success!
|
69
69
|
return if sax.for_tag(:success).first == 'true'.freeze
|
70
|
+
fail RateLimitError if error_message == 'Restricted'.freeze
|
70
71
|
fail RequestFailed, error_message
|
71
72
|
end
|
72
73
|
|
@@ -82,7 +83,7 @@ module SoapyCake
|
|
82
83
|
end
|
83
84
|
|
84
85
|
def error_message
|
85
|
-
sax.for_tag(:message).first || sax.for_tag(:Text).first || 'Unknown error'
|
86
|
+
@error_message ||= sax.for_tag(:message).first || sax.for_tag(:Text).first || 'Unknown error'
|
86
87
|
end
|
87
88
|
end
|
88
89
|
end
|
data/lib/soapy_cake/version.rb
CHANGED
data/soapy_cake.gemspec
CHANGED
@@ -42,7 +42,7 @@ http_interactions:
|
|
42
42
|
encoding: UTF-8
|
43
43
|
string: <?xml version="1.0" encoding="utf-8"?><soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope"
|
44
44
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"><soap:Body><AffiliatesResponse
|
45
|
-
xmlns="http://cakemarketing.com/api/5/"><AffiliatesResult><success>false</success><message>
|
46
|
-
http_version:
|
45
|
+
xmlns="http://cakemarketing.com/api/5/"><AffiliatesResult><success>false</success><message>Something Broken</message><row_count>0</row_count></AffiliatesResult></AffiliatesResponse></soap:Body></soap:Envelope>
|
46
|
+
http_version:
|
47
47
|
recorded_at: Mon, 15 Jun 2015 12:00:00 GMT
|
48
48
|
recorded_with: VCR 2.9.3
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: soapy_cake
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.20.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- ad2games GmbH
|
@@ -66,6 +66,20 @@ dependencies:
|
|
66
66
|
- - ">="
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: '0'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: retryable
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - ">="
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '0'
|
76
|
+
type: :runtime
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - ">="
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '0'
|
69
83
|
- !ruby/object:Gem::Dependency
|
70
84
|
name: bundler
|
71
85
|
requirement: !ruby/object:Gem::Requirement
|