peddler 4.0.0 → 4.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +5 -5
- data/lib/peddler/api.rb +6 -6
- data/lib/peddler/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9b77e82d88e0346785039821e8aef1e5dc14719e36ac939b817903802fc675a6
|
4
|
+
data.tar.gz: db657904ecc6bfaf47702c09500028d0e1ed9ebca2c7b6aa482069523dade394
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b6cb81b4ea08ef72b5b4e30dc331872b011688c6af694b4fad67df00cc3076c9832fbc8a57382c07d2adde0669b604f3ef0a8b33cad73a63c87377f061f0e309
|
7
|
+
data.tar.gz: 04e7f28ce2915d764181b5deccfdf9830113ee386adee0dcdef1b7c1c617c2f6f5d85dffef708346b5e3add2907debc3c83fb65a82ed11d581cffc2fe28afe28
|
data/README.md
CHANGED
@@ -22,7 +22,7 @@ To begin using the Amazon SP-API, you must [register as a developer][register-as
|
|
22
22
|
Add this line to your Gemfile.
|
23
23
|
|
24
24
|
```ruby
|
25
|
-
gem "peddler", "~>
|
25
|
+
gem "peddler", "~> 4.0"
|
26
26
|
```
|
27
27
|
|
28
28
|
And then execute:
|
@@ -493,10 +493,10 @@ response.parse
|
|
493
493
|
|
494
494
|
## TODO
|
495
495
|
|
496
|
-
- Code generate
|
497
|
-
- Code generate the APIs section—descriptions and code examples—in this README here.
|
498
|
-
- Schedule code generation with GitHub Actions. Push new gem when models change.
|
499
|
-
- Review and consider applying [these patches][patches].
|
496
|
+
- [ ] Code generate payload parsers.
|
497
|
+
- [ ] Code generate the APIs section—descriptions and code examples—in this README here.
|
498
|
+
- [ ] Schedule code generation with GitHub Actions. Push new gem when models change.
|
499
|
+
- [ ] Review and consider applying [these patches][patches].
|
500
500
|
|
501
501
|
[build]: https://github.com/hakanensari/peddler/actions
|
502
502
|
[maintainability]: https://codeclimate.com/github/hakanensari/peddler/maintainability
|
data/lib/peddler/api.rb
CHANGED
@@ -66,13 +66,13 @@ module Peddler
|
|
66
66
|
|
67
67
|
# Throttles with a rate limit and retries when the API returns a 429
|
68
68
|
#
|
69
|
-
# @param [Float]
|
69
|
+
# @param [Float] requests_per_second
|
70
70
|
# @return [self]
|
71
|
-
def meter(
|
71
|
+
def meter(requests_per_second)
|
72
72
|
# HTTP v6.0 will implement retriable. Until then, point to their GitHub repo, or it's a no-op.
|
73
73
|
# https://github.com/httprb/http/pull/790
|
74
|
-
delay = sandbox? ? 0.2 : 1.0 /
|
75
|
-
retriable(delay: delay, retry_statuses: [429])
|
74
|
+
delay = sandbox? ? 0.2 : 1.0 / requests_per_second
|
75
|
+
retriable(delay: delay, tries: 3, retry_statuses: [429])
|
76
76
|
|
77
77
|
self
|
78
78
|
end
|
@@ -96,8 +96,8 @@ module Peddler
|
|
96
96
|
# @param (see Performer#initialize)
|
97
97
|
# @return [self]
|
98
98
|
[:via, :use, :retriable].each do |method|
|
99
|
-
define_method(method) do |*args, &block|
|
100
|
-
@http = http.send(method, *args, &block) if http.respond_to?(method)
|
99
|
+
define_method(method) do |*args, **kwargs, &block|
|
100
|
+
@http = http.send(method, *args, **kwargs, &block) if http.respond_to?(method)
|
101
101
|
self
|
102
102
|
end
|
103
103
|
end
|
data/lib/peddler/version.rb
CHANGED