nimble_throttler 0.0.2 → 0.0.3
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/README.md +22 -6
- data/nimble_throttler.gemspec +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: eef8af63d28977c1fabe218bfb3ef8e8540d6077
|
4
|
+
data.tar.gz: f88fdf87edd68648fc19f89e4ff804aa112e3259
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4290b99ac2c6864ee2ed4ac73df1b894a3712a90d5482266274266e93832ab792ffc4cc451f14ac94029513086bf3e9a3e160ce2defe3c4855beb595167d143f
|
7
|
+
data.tar.gz: 069c804c85e28fc4007fd1a7bb4d7952deb1ad118f2eea204f54f8195e75b119d989e091f38ba1ad9bb599919245d3a8ae508aa14ea5d321a6817b48e7b27398
|
data/README.md
CHANGED
@@ -1,8 +1,10 @@
|
|
1
1
|
# NimbleThrottler
|
2
2
|
|
3
|
-
|
3
|
+
[](https://codeclimate.com/github/kimquy/nimble_throttler)
|
4
4
|
|
5
|
-
|
5
|
+
[](https://travis-ci.org/kimquy/nimble_throttler)
|
6
|
+
|
7
|
+
NimbleThrottler is very simple ruby gem which allow throttling an certain endpoints.
|
6
8
|
|
7
9
|
## Installation
|
8
10
|
|
@@ -22,13 +24,27 @@ Or install it yourself as:
|
|
22
24
|
|
23
25
|
## Usage
|
24
26
|
|
25
|
-
|
27
|
+
Add the following code into `application.rb` of your Rails app.
|
28
|
+
|
29
|
+
```ruby
|
30
|
+
require "nimble_throttler"
|
26
31
|
|
27
|
-
|
32
|
+
module YourRailsApp
|
33
|
+
class Application < Rails::Application
|
34
|
+
config.middleware.use Rack::NimbleThrottling
|
35
|
+
end
|
36
|
+
end
|
37
|
+
```
|
28
38
|
|
29
|
-
|
39
|
+
Now you're ready to throttle the endpoints by adding this file `nimble_throttling.rb` into `initializers` folder. Example:
|
30
40
|
|
31
|
-
|
41
|
+
```ruby
|
42
|
+
NimbleThrottler.configure do
|
43
|
+
throttle '/testing', limit: 5, period: 1.hours
|
44
|
+
throttle '/awesome', limit: 100, period: 2.hours
|
45
|
+
throttle '/home/page', limit: 100, period: 3.hours
|
46
|
+
end
|
47
|
+
```
|
32
48
|
|
33
49
|
## Contributing
|
34
50
|
|
data/nimble_throttler.gemspec
CHANGED