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 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 milliseconds
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.0
1
+ 0.3.1
data/lawnchair.gemspec CHANGED
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{lawnchair}
8
- s.version = "0.3.0"
8
+ s.version = "0.3.1"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Shane Wolf"]
data/lib/lawnchair.rb CHANGED
@@ -41,9 +41,8 @@ module Lawnchair
41
41
  return !!Lawnchair.redis[compute_key(key)]
42
42
  end
43
43
 
44
- def self.compute_expiry(ms)
45
- ms ||= 3600000
46
- ms/1000
44
+ def self.compute_expiry(seconds)
45
+ seconds || 3600
47
46
  end
48
47
  end
49
48
  end
@@ -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 => 1000) { "muschroom/onion" }
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
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lawnchair
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Shane Wolf