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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 989f5bec7dce426405b687e65c4677fe8b359b355d815df799a048ef1907809f
4
- data.tar.gz: eec2f1236bf285bf00c7d32e1482ae2fadaadeb2db9f0bc0a9beb64cf3ec7072
3
+ metadata.gz: 9b77e82d88e0346785039821e8aef1e5dc14719e36ac939b817903802fc675a6
4
+ data.tar.gz: db657904ecc6bfaf47702c09500028d0e1ed9ebca2c7b6aa482069523dade394
5
5
  SHA512:
6
- metadata.gz: 361ce5ea21116bbc09efb9590d080db5275f35dbc6717ccd318c291eb32e4b122b24d06ad4f78c9c693298d8e6e70fc81f3d7a128b843b7949579a601683bf91
7
- data.tar.gz: 956ad0c6b2b7d1a490dffbf846a4c4415e1323510ac52c0eebdb2b42835f5a2f14354f2e0d16fa19099d0823ed47f09218255e98973735e7ccfa1579f08ccefa
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", "~> 3.0"
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 models to parse payload. Consider using `dry-struct`.
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] rate_limit The delay in seconds before retrying
69
+ # @param [Float] requests_per_second
70
70
  # @return [self]
71
- def meter(rate_limit)
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 / rate_limit
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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Peddler
4
- VERSION = "4.0.0"
4
+ VERSION = "4.0.1"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: peddler
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.0.0
4
+ version: 4.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Hakan Ensari