cache-store-api 0.0.1 → 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -2,11 +2,13 @@ module CacheStoreApi
2
2
  module CommonMethods
3
3
  def lazy_cache(key, expiration=3600)
4
4
  if block_given?
5
- unless output = cache.read(key)
5
+ if cache.exist?(key)
6
+ cache.read(key)
7
+ else
6
8
  output = yield
7
9
  cache.write(key, output, :expires_in => expiration)
10
+ output
8
11
  end
9
- output
10
12
  else
11
13
  cache.read(key)
12
14
  end
@@ -1,3 +1,3 @@
1
1
  module CacheStoreApi
2
- VERSION = "0.0.1"
2
+ VERSION = "0.1.0"
3
3
  end
metadata CHANGED
@@ -4,9 +4,9 @@ version: !ruby/object:Gem::Version
4
4
  prerelease: false
5
5
  segments:
6
6
  - 0
7
- - 0
8
7
  - 1
9
- version: 0.0.1
8
+ - 0
9
+ version: 0.1.0
10
10
  platform: ruby
11
11
  authors:
12
12
  - Brian Takita
@@ -14,7 +14,7 @@ autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
16
 
17
- date: 2010-12-21 00:00:00 -08:00
17
+ date: 2011-01-18 00:00:00 -08:00
18
18
  default_executable:
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency