prop 0.7.7 → 0.7.8
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/prop.rb +1 -1
- data/lib/prop/rate_limited.rb +1 -1
- data/prop.gemspec +2 -2
- data/test/test_prop.rb +1 -1
- data/test/test_rate_limited.rb +1 -1
- metadata +4 -4
data/lib/prop.rb
CHANGED
data/lib/prop/rate_limited.rb
CHANGED
@@ -8,7 +8,7 @@ module Prop
|
|
8
8
|
interval = options.fetch(:interval).to_i
|
9
9
|
threshold = options.fetch(:threshold).to_i
|
10
10
|
|
11
|
-
super("#{handle} threshold of #{threshold}
|
11
|
+
super("#{handle} threshold of #{threshold} tries per #{interval}s exceeded for key '#{options[:key].inspect}', hash #{cache_key}")
|
12
12
|
|
13
13
|
self.description = options[:description]
|
14
14
|
self.handle = handle
|
data/prop.gemspec
CHANGED
@@ -13,8 +13,8 @@ Gem::Specification.new do |s|
|
|
13
13
|
## If your rubyforge_project name is different, then edit it and comment out
|
14
14
|
## the sub! line in the Rakefile
|
15
15
|
s.name = 'prop'
|
16
|
-
s.version = '0.7.
|
17
|
-
s.date = '2012-04-
|
16
|
+
s.version = '0.7.8'
|
17
|
+
s.date = '2012-04-24'
|
18
18
|
s.rubyforge_project = 'prop'
|
19
19
|
|
20
20
|
## Make sure your summary is short. The description may be as long
|
data/test/test_prop.rb
CHANGED
@@ -167,7 +167,7 @@ class TestProp < Test::Unit::TestCase
|
|
167
167
|
fail
|
168
168
|
rescue Prop::RateLimited => e
|
169
169
|
assert_equal :hello, e.handle
|
170
|
-
assert_match "
|
170
|
+
assert_match "5 tries per 10s exceeded for key", e.message
|
171
171
|
assert_equal "Boom!", e.description
|
172
172
|
assert e.retry_after
|
173
173
|
end
|
data/test/test_rate_limited.rb
CHANGED
@@ -18,7 +18,7 @@ class TestRateLimited < Test::Unit::TestCase
|
|
18
18
|
assert_equal "foo", @error.handle
|
19
19
|
assert_equal "wibble", @error.cache_key
|
20
20
|
assert_equal "Boom!", @error.description
|
21
|
-
assert_equal "foo threshold of 10
|
21
|
+
assert_equal "foo threshold of 10 tries per 60s exceeded for key 'nil', hash wibble", @error.message
|
22
22
|
assert_equal 20, @error.retry_after
|
23
23
|
end
|
24
24
|
end
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: prop
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 19
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 7
|
9
|
-
-
|
10
|
-
version: 0.7.
|
9
|
+
- 8
|
10
|
+
version: 0.7.8
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Morten Primdahl
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2012-04-
|
18
|
+
date: 2012-04-24 00:00:00 Z
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|
21
21
|
name: rake
|