lawnchair 0.3.0 → 0.3.1
Sign up to get free protection for your applications and to get access to all the features.
- data/README.rdoc +6 -1
- data/VERSION +1 -1
- data/lawnchair.gemspec +1 -1
- data/lib/lawnchair.rb +2 -3
- data/spec/lawnchair_spec.rb +1 -1
- metadata +1 -1
data/README.rdoc
CHANGED
@@ -2,6 +2,11 @@
|
|
2
2
|
|
3
3
|
Very simple caching mechanism for arbitrary pieces of ruby code using Redis as the distributed (or local) cache
|
4
4
|
|
5
|
+
== Prerequisites
|
6
|
+
http://code.google.com/p/redis/
|
7
|
+
and
|
8
|
+
http://github.com/ezmobius/redis-rb/
|
9
|
+
|
5
10
|
== Usage Examples
|
6
11
|
|
7
12
|
|
@@ -32,7 +37,7 @@ The return value is exactly what you think it should be
|
|
32
37
|
|
33
38
|
Now, since it is cached, any time this block method is called (for the next 60 minute) it will return those values. also, you will note it comes back instantly, instead of waiting on those sleeps.
|
34
39
|
|
35
|
-
If an hour is too long, or short for the cache key expiration you can set that to anything you want using the :expires_in hash key and entering a time in
|
40
|
+
If an hour is too long, or short for the cache key expiration you can set that to anything you want using the :expires_in hash key and entering a time in seconds
|
36
41
|
|
37
42
|
Lawnchair::Cache.me(:key => "contrived_example", :expires_in => 1.day) do
|
38
43
|
# expensive code to be cached for 24 hours
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.3.
|
1
|
+
0.3.1
|
data/lawnchair.gemspec
CHANGED
data/lib/lawnchair.rb
CHANGED
data/spec/lawnchair_spec.rb
CHANGED
@@ -46,7 +46,7 @@ describe "Lawnchair::Cache" do
|
|
46
46
|
end
|
47
47
|
|
48
48
|
it "allows you to override the default ttl" do
|
49
|
-
Lawnchair::Cache.me(:key => "pizza", :expires_in =>
|
49
|
+
Lawnchair::Cache.me(:key => "pizza", :expires_in => 1) { "muschroom/onion" }
|
50
50
|
Lawnchair.redis.ttl("Lawnchair:pizza").should == 1 # seconds
|
51
51
|
end
|
52
52
|
end
|