rails_throttle 0.3.0 → 0.4.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/rails_throttle/throttle.rb +4 -1
- data/lib/rails_throttle/version.rb +1 -1
- metadata +3 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 60bb96e2c1b1c703f8c32fe27b5168e21e1769c750c7b0130e16784abe9b1b3f
|
4
|
+
data.tar.gz: f02b4364be08144b88ba846743317391a86634af6fd7112f00152706c8a3430c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1458f332d86329713eef7b2668a84f3ed3d6e9049682fb95ab1f552339a2567531e04ca3841e43d71eeac2ff04b8e344816238242c18b8b929d27eca130084ca
|
7
|
+
data.tar.gz: 2ae919d1e2320398976f9b910ab2bb44e3469a485efc53fc0cfd8874f71f376aaef7dcf1e588130a69cd3b84f72cc979f1f6f57456cc7c5040b4e27df4091282
|
@@ -30,7 +30,10 @@ module RailsThrottle
|
|
30
30
|
RailsThrottle.backend.write(key, increment, expires_in: period)
|
31
31
|
|
32
32
|
value = increment
|
33
|
-
|
33
|
+
end
|
34
|
+
|
35
|
+
if value > limit
|
36
|
+
RailsThrottle.backend.decrement(key, increment, expires_in: period)
|
34
37
|
raise RailsThrottle::ThrottleError, "Limit exceeded for key `#{key}` with limit of #{limit}"
|
35
38
|
end
|
36
39
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rails_throttle
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Peter Zhu
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-06-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -120,8 +120,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
120
120
|
- !ruby/object:Gem::Version
|
121
121
|
version: '0'
|
122
122
|
requirements: []
|
123
|
-
|
124
|
-
rubygems_version: 2.7.6
|
123
|
+
rubygems_version: 3.0.1
|
125
124
|
signing_key:
|
126
125
|
specification_version: 4
|
127
126
|
summary: Throttle code in your Rails application.
|