spos-client 0.0.1 → 0.0.2
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/spos-client.rb +7 -3
- metadata +4 -4
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: bed9590de16d8c9ff49633f06268329397f64e0f
|
|
4
|
+
data.tar.gz: 0acd95f963b0606ea28323deb31f602cd8e11f59
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 8c34afb69fdbcaedcbc287b3810e99408b86ef7553e71c438e1e618f6d619d8bbafec7b42a4e368eeb3d97a15f63d268d6cd3c5590d5f9dc1c51ae308cfb7fa8
|
|
7
|
+
data.tar.gz: 3f6db284c0f8bb0593f73bf936a9503767eec991767c3db2e232b86048798fb1507c23b800b4cd3821ba34d089276860acbec6de039442d5aebecfc4109bbfe0
|
data/lib/spos-client.rb
CHANGED
|
@@ -97,10 +97,14 @@ class SPOSClient
|
|
|
97
97
|
|
|
98
98
|
body = JSON.parse(JSON.parse(response.body).to_json, object_class: OpenStruct)
|
|
99
99
|
|
|
100
|
-
if body.status_code === 429
|
|
101
|
-
retrytime =
|
|
100
|
+
if body.status_code === 429
|
|
102
101
|
time = Time.now.time_until(Time.parse(response['Retry-After']))
|
|
103
|
-
|
|
102
|
+
sleeptime = (time/1000)
|
|
103
|
+
|
|
104
|
+
if(sleeptime > 0)
|
|
105
|
+
sleep sleeptime
|
|
106
|
+
end
|
|
107
|
+
|
|
104
108
|
body = request(path)
|
|
105
109
|
end
|
|
106
110
|
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: spos-client
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.0.
|
|
4
|
+
version: 0.0.2
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Shayne Martin
|
|
@@ -29,17 +29,17 @@ require_paths:
|
|
|
29
29
|
- lib
|
|
30
30
|
required_ruby_version: !ruby/object:Gem::Requirement
|
|
31
31
|
requirements:
|
|
32
|
-
- -
|
|
32
|
+
- - ">="
|
|
33
33
|
- !ruby/object:Gem::Version
|
|
34
34
|
version: '0'
|
|
35
35
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
36
36
|
requirements:
|
|
37
|
-
- -
|
|
37
|
+
- - ">="
|
|
38
38
|
- !ruby/object:Gem::Version
|
|
39
39
|
version: '0'
|
|
40
40
|
requirements: []
|
|
41
41
|
rubyforge_project:
|
|
42
|
-
rubygems_version: 2.
|
|
42
|
+
rubygems_version: 2.5.1
|
|
43
43
|
signing_key:
|
|
44
44
|
specification_version: 4
|
|
45
45
|
summary: Simple Ruby bindings for your Spark Pay Online Store REST API
|