ihasa 0.0.1 → 0.0.2

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
  SHA1:
3
- metadata.gz: 46f87a6594af9e83c6ff6d56f7d897d376325993
4
- data.tar.gz: 13437815218c853f71cae4a93b0af469bfaee9bb
3
+ metadata.gz: 9c2f1647dc36aad4a17f01d49748bf40116784c8
4
+ data.tar.gz: 03c3f6c7bd66c3a33ee7b2fde4c9bd579ded3fc3
5
5
  SHA512:
6
- metadata.gz: dd880e51552ae7a23d07b7f6ea93e1cd333e3ee82bdeed6ea207c343deb71e026c9ddb4caa2c24e68e3993f879e37444117523927c887d85f78a2cc7e9e42c5b
7
- data.tar.gz: 9316733742bf6224bc8bf137ab804970530a69e6be3bb66e19361812fdfa21dd5afe3a7de69f2c8b3a91e4e44c3f04ff685675677805e1869311329a3706321d
6
+ metadata.gz: 1cfc9af05559770453ce7e4c8d2d5cacdb35851eebdfaa247477f77839cbf9a137e8a844a3baf6d0606eed7d3491b76cc32ec865e4e7d27f27e1f8803c6d957a
7
+ data.tar.gz: 61ba1b7ef42a2d06a7d15d3ec252fc7042741b01194edfd63b0e5aea2b74e50a787b520f87d42d8028f87ed7e10a99c83f78e6e65f82f9c062188f6db3d75575
data/README.md CHANGED
@@ -5,10 +5,11 @@ Ihasa is a ruby implementation of the [token bucket algorithm](https://en.wikipe
5
5
  It provides a way to share your rate/burst limit across multiple servers, as well as a simple interface.
6
6
 
7
7
  *Why use Ihasa?*
8
+
8
9
  1. It's easy to use ([go check the usage section](#usage)
9
10
  2. It supports rate AND burst
10
11
  3. It does not reset all rate limit consumption each new second/minute/hour
11
- 4. It has [namespaces](namespaces)
12
+ 4. It has [namespaces](#namespaces)
12
13
 
13
14
 
14
15
  - [Installation](#installation)
@@ -111,6 +112,7 @@ class Controller < ActionController::Base
111
112
 
112
113
  By default, all new buckets use the redis instance hosted at localhost:6379. There is
113
114
  however two way to configure the used redis instance:
115
+
114
116
  1. Override the `REDIS_URL` env variable. All new buckets will use that instance
115
117
  2. Override the redis url on a bucket creation basis like follow:
116
118
 
data/lib/ihasa/bucket.rb CHANGED
@@ -90,10 +90,10 @@ module Ihasa
90
90
  #{ALLOWANCE_UPDATE_STATEMENT}
91
91
  local result = #{NOK}
92
92
  if allowance >= 1.0 then
93
- #{redis_set(last, 'now')}
94
93
  allowance = allowance - 1.0
95
94
  result = #{OK}
96
95
  end
96
+ #{redis_set(last, 'now')}
97
97
  #{redis_set(allowance, 'allowance')}
98
98
  return result
99
99
  LUA
data/lib/ihasa/version.rb CHANGED
@@ -3,7 +3,7 @@
3
3
  module Ihasa
4
4
  # This module holds the Ihasa version information.
5
5
  module Version
6
- STRING = '0.0.1'
6
+ STRING = '0.0.2'
7
7
 
8
8
  module_function
9
9
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ihasa
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alexandre Ignjatovic
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-05-15 00:00:00.000000000 Z
11
+ date: 2016-05-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: redis