cache_method 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -33,7 +33,7 @@ module CacheMethod
33
33
  @storage || raise("You need to set CacheMethod.config.storage with a cache storage of your choice")
34
34
  end
35
35
 
36
- # TTL for method caches. Defaults to 60 seconds.
36
+ # TTL for method caches. Defaults to 24 hours or 86,400 seconds.
37
37
  #
38
38
  # Example:
39
39
  # CacheMethod.config.default_ttl = 120 # seconds
@@ -42,7 +42,7 @@ module CacheMethod
42
42
  end
43
43
 
44
44
  def default_ttl #:nodoc:
45
- @default_ttl || 60
45
+ @default_ttl || 86_400
46
46
  end
47
47
  end
48
48
  end
@@ -46,7 +46,8 @@ module CacheMethod
46
46
  cached_v
47
47
  else
48
48
  v = Epoch.random_name
49
- Config.instance.storage.set cache_key, v
49
+ # never expire!
50
+ Config.instance.storage.set cache_key, v, 0
50
51
  v
51
52
  end
52
53
  end
@@ -1,3 +1,3 @@
1
1
  module CacheMethod
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
data/lib/cache_method.rb CHANGED
@@ -40,7 +40,7 @@ module CacheMethod
40
40
  #
41
41
  # Note: Remember to define <tt>#hash</tt> on any object whose instance methods might get cached.
42
42
  #
43
- # Note 2: Check out CacheMethod.config.default_ttl... the default is only 60 seconds.
43
+ # Note 2: Check out CacheMethod.config.default_ttl... the default is 24 hours.
44
44
  #
45
45
  # Example:
46
46
  # class Blog
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cache_method
3
3
  version: !ruby/object:Gem::Version
4
- hash: 27
4
+ hash: 25
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 1
9
- - 0
10
- version: 0.1.0
9
+ - 1
10
+ version: 0.1.1
11
11
  platform: ruby
12
12
  authors:
13
13
  - Seamus Abshere
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-02-21 00:00:00 -06:00
18
+ date: 2011-02-22 00:00:00 -06:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency