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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA256:
3
- metadata.gz: e68b78d1cd83deb5f5dd82e946812022c14fcca737ca996ddc67169ea7884a0e
4
- data.tar.gz: f472cddb0576d5f92aee366c0363d94b3026e04ea7eadd0ba86c5f1d1d0ab92e
2
+ SHA1:
3
+ metadata.gz: 953dd9b0f1dc63b14b79c9e5fd3f9d390b0f03e9
4
+ data.tar.gz: cd955b16080477bdc12f748bffce621d4108ed9d
5
5
  SHA512:
6
- metadata.gz: 996d8239727ffe11ecaeb99cccc3be179238b605cb8cb0ae51c3979088ec05a1a425bfa1c555116dc6a80c16834701199e61acee3a07d44e52c19b54cbd30267
7
- data.tar.gz: d7eebab7f6fac303043c767d486559fa2b78e2e7dbd876234e5f49469d71f039c5e56cf3e4501d5fe6c6e6b32a0d07bca1f1ffbb269cffa841877f23992446c2
6
+ metadata.gz: 419d4e237106893693e51d155c607985a031bcc5f2b35e0622cce8bf5c0ba153126d44df7a44443653a488320416f178d925ce7ca64c9717441743cd106b44ec
7
+ data.tar.gz: 582cffa8a8232fa853f16f2cfea646a22a69ef0d248d0a812a54d9acebee54c760d7f645d6b695e8cda72c0235cdffc60fc13ab28aaec93dba7383594e35b7f0
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- paul_walker (0.1.0)
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.0.2)
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)
@@ -0,0 +1,11 @@
1
+ #! /usr/bin/env groovy
2
+ pipeline {
3
+ agent { label 'docker' }
4
+ stages {
5
+ stage('Test') {
6
+ steps {
7
+ sh './build.sh'
8
+ }
9
+ }
10
+ }
11
+ }
@@ -0,0 +1,5 @@
1
+ set -e
2
+
3
+ docker-compose build
4
+ docker-compose up -d
5
+ docker-compose run -T web bin/jenkins
@@ -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
- current: current,
10
- max: max,
11
- timestamp: Time.now.utc
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
@@ -1,3 +1,3 @@
1
1
  module PaulWalker
2
- VERSION = '0.1.1'.freeze
2
+ VERSION = '0.1.2'.freeze
3
3
  end
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.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: 2018-11-05 00:00:00.000000000 Z
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.7.3
141
+ rubygems_version: 2.6.11
140
142
  signing_key:
141
143
  specification_version: 4
142
144
  summary: Rate limit management using redis