paul_walker 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/Gemfile.lock +2 -2
- data/build.groovy +11 -0
- data/build.sh +5 -0
- data/lib/paul_walker/rate_limit.rb +12 -3
- data/lib/paul_walker/version.rb +1 -1
- metadata +5 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 953dd9b0f1dc63b14b79c9e5fd3f9d390b0f03e9
|
4
|
+
data.tar.gz: cd955b16080477bdc12f748bffce621d4108ed9d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 419d4e237106893693e51d155c607985a031bcc5f2b35e0622cce8bf5c0ba153126d44df7a44443653a488320416f178d925ce7ca64c9717441743cd106b44ec
|
7
|
+
data.tar.gz: 582cffa8a8232fa853f16f2cfea646a22a69ef0d248d0a812a54d9acebee54c760d7f645d6b695e8cda72c0235cdffc60fc13ab28aaec93dba7383594e35b7f0
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
paul_walker (0.1.
|
4
|
+
paul_walker (0.1.1)
|
5
5
|
redis (>= 4.0)
|
6
6
|
|
7
7
|
GEM
|
@@ -11,7 +11,7 @@ GEM
|
|
11
11
|
diff-lcs (1.3)
|
12
12
|
mock_redis (0.19.0)
|
13
13
|
rake (10.5.0)
|
14
|
-
redis (4.
|
14
|
+
redis (4.1.1)
|
15
15
|
rspec (3.8.0)
|
16
16
|
rspec-core (~> 3.8.0)
|
17
17
|
rspec-expectations (~> 3.8.0)
|
data/build.groovy
ADDED
data/build.sh
ADDED
@@ -6,10 +6,11 @@ module PaulWalker
|
|
6
6
|
def self.add(namespace, key, current, max)
|
7
7
|
store.set(composite_key(namespace, key),
|
8
8
|
{
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
current: current,
|
10
|
+
max: max,
|
11
|
+
timestamp: Time.now.utc
|
12
12
|
}.to_json)
|
13
|
+
set_last_used(namespace, key)
|
13
14
|
end
|
14
15
|
|
15
16
|
def self.get(namespace, key)
|
@@ -26,6 +27,14 @@ module PaulWalker
|
|
26
27
|
"#{namespace}:#{key}"
|
27
28
|
end
|
28
29
|
|
30
|
+
def self.set_last_used(namespace, key)
|
31
|
+
store.set(composite_key(namespace, 'last_used'), key)
|
32
|
+
end
|
33
|
+
|
34
|
+
def self.last_used(namespace)
|
35
|
+
store.get(composite_key(namespace, 'last_used'))
|
36
|
+
end
|
37
|
+
|
29
38
|
def self.store
|
30
39
|
store = Store.new
|
31
40
|
store.provider
|
data/lib/paul_walker/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: paul_walker
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- jshaffer
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2019-05-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: redis
|
@@ -111,6 +111,8 @@ files:
|
|
111
111
|
- Rakefile
|
112
112
|
- bin/console
|
113
113
|
- bin/setup
|
114
|
+
- build.groovy
|
115
|
+
- build.sh
|
114
116
|
- lib/paul_walker.rb
|
115
117
|
- lib/paul_walker/rate_limit.rb
|
116
118
|
- lib/paul_walker/store.rb
|
@@ -136,7 +138,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
136
138
|
version: '0'
|
137
139
|
requirements: []
|
138
140
|
rubyforge_project:
|
139
|
-
rubygems_version: 2.
|
141
|
+
rubygems_version: 2.6.11
|
140
142
|
signing_key:
|
141
143
|
specification_version: 4
|
142
144
|
summary: Rate limit management using redis
|