rate-limit 0.2.0 → 0.2.1

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b0f1786c2b5fde684e916bcc8733929b7d0d35cdc2807d8f511190f179019611
4
- data.tar.gz: c216ce4a4f8e2e479854b61b895c87d226cceba9f8a3d6fb476852709a308ed2
3
+ metadata.gz: 11a836041207b190f37ebc39fc5f3dad8f550fee8193c4a1bb7a0ec1add638f1
4
+ data.tar.gz: a213f8f17a0630f7a8f4d43ec8c7072e4f0f1ecbc015723aa06aeb1ea802883d
5
5
  SHA512:
6
- metadata.gz: 25bbef68dd61abd1cb2353367af910ee5d61d2ce9f1408c66a36a2741abab62bc9b3c212552e01187c5a95121c611eeb9b16232b1b1bdcc4e486fcdc780b85e0
7
- data.tar.gz: 5232a6c6f559c5161576b1f54d27a17b590c3b2d25376f8b6f0011d725dbf029bbc7b75e78d4afc6babeaea3a0acac4b9c3b643738f4e9730fbc5105241f208c
6
+ metadata.gz: 77dd6eefc19f5af422efd9f1d31db21a0697c0325cf6d39bc02798112fef5706604c6ee15418df49ef75ee7f6801dcd576f6a8ebfaa306c01defaf7f378f8017
7
+ data.tar.gz: 5580d905fcbf812e925ea22a4b203043ee12d68996cbe4bb0589cbd74ecaf85a04cb2d6ea1a37cf3f23b5861e0bae76f921269de3fe24ce5dcfc405325b74bea
data/CHANGELOG.md CHANGED
@@ -7,6 +7,17 @@ and this project adheres to [Semantic Versioning].
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [v0.2.1] - 2022-11-09
11
+
12
+ ### Added
13
+
14
+ - https://github.com/catawiki/rate-limit/pull/28 added Integration Tests
15
+
16
+ ### Fixed
17
+
18
+ - https://github.com/catawiki/rate-limit/issues/29 Calling throttle with only_failures: true does not call success callback
19
+
20
+
10
21
  ## [v0.2.0] - 2022-10-05
11
22
 
12
23
  ### Added
@@ -65,6 +76,7 @@ and this project adheres to [Semantic Versioning].
65
76
 
66
77
  <!-- versions -->
67
78
 
68
- [Unreleased]: https://github.com/catawiki/rate-limit/compare/v0.1.0...HEAD
79
+ [Unreleased]: https://github.com/catawiki/rate-limit/compare/v0.2.1...HEAD
80
+ [v0.2.1]: https://github.com/catawiki/rate-limit/compare/v0.2.0...v0.2.1
69
81
  [v0.2.0]: https://github.com/catawiki/rate-limit/compare/v0.1.0...v0.2.0
70
82
  [v0.1.0]: https://github.com/catawiki/rate-limit/compare/v0.0.1...v0.1.0
@@ -7,7 +7,7 @@ module RateLimit
7
7
 
8
8
  yield if block_given?
9
9
 
10
- return success! unless only_failures
10
+ success!(skip_increment_cache: only_failures)
11
11
  rescue StandardError => e
12
12
  success! unless e.is_a?(Errors::LimitExceededError)
13
13
  raise e
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module RateLimit
4
- VERSION = '0.2.0'
4
+ VERSION = '0.2.1'
5
5
  end
@@ -33,8 +33,8 @@ module RateLimit
33
33
  exceeded_window.present?
34
34
  end
35
35
 
36
- def success!
37
- increment_cache_counter
36
+ def success!(skip_increment_cache: false)
37
+ increment_cache_counter unless skip_increment_cache
38
38
  result.success!
39
39
  RateLimit.config.success_callback(result)
40
40
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rate-limit
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mohamed Motaweh
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-10-05 00:00:00.000000000 Z
11
+ date: 2022-11-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport