volatile_hash 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- data/.ruby-gemset +1 -0
- data/.ruby-version +1 -0
- data/Gemfile.lock +1 -1
- data/README +2 -0
- data/lib/volatile_hash.rb +1 -1
- data/spec/volatile_hash_spec.rb +9 -0
- data/volatile_hash.gemspec +1 -1
- metadata +3 -2
- data/.rvmrc +0 -2
data/.ruby-gemset
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
volatile_hash
|
data/.ruby-version
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
default
|
data/Gemfile.lock
CHANGED
data/README
CHANGED
data/lib/volatile_hash.rb
CHANGED
data/spec/volatile_hash_spec.rb
CHANGED
@@ -29,6 +29,15 @@ describe VolatileHash do
|
|
29
29
|
@cache[:x].should be_nil
|
30
30
|
end
|
31
31
|
|
32
|
+
it "should continue returning nil for cached values after the TTL expires" do
|
33
|
+
@cache[:x].should == @x.to_s
|
34
|
+
|
35
|
+
sleep(0.8)
|
36
|
+
|
37
|
+
@cache[:x].should be_nil
|
38
|
+
@cache[:x].should be_nil
|
39
|
+
end
|
40
|
+
|
32
41
|
it "should not throw out least-recently used value" do
|
33
42
|
@cache[:y] = 1
|
34
43
|
|
data/volatile_hash.gemspec
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
Gem::Specification.new do |s|
|
2
2
|
s.name = 'volatile_hash'
|
3
|
-
s.version = '0.0.
|
3
|
+
s.version = '0.0.3'
|
4
4
|
s.date = '2012-02-22'
|
5
5
|
s.summary = "Implements LRU and TTL caches"
|
6
6
|
s.description = "Implements key-based cache that can have a least-recently-used or time-to-live expiration strategy"
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: volatile_hash
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -66,7 +66,8 @@ executables: []
|
|
66
66
|
extensions: []
|
67
67
|
extra_rdoc_files: []
|
68
68
|
files:
|
69
|
-
- .
|
69
|
+
- .ruby-gemset
|
70
|
+
- .ruby-version
|
70
71
|
- Gemfile
|
71
72
|
- Gemfile.lock
|
72
73
|
- LICENSE
|
data/.rvmrc
DELETED