grosser-cachy 0.1.1 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
data/README.markdown CHANGED
@@ -74,8 +74,9 @@ The cache server does not need to be restarted and session data(Rails) is saved.
74
74
 
75
75
 
76
76
  #### Does not cache nil
77
- If you want to cache a falsy result, use false
77
+ If you want to cache a falsy result, use false (same goes for :while_running)
78
78
  Cachy.cache(:x){ expensive || false }
79
+ Cachy.cache(:x, :while_running=>false){ expensive }
79
80
 
80
81
  ###Cachy.expire / .expire_view
81
82
  Expires all locales of a key
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.1
1
+ 0.1.2
data/cachy.gemspec CHANGED
@@ -2,11 +2,11 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = %q{cachy}
5
- s.version = "0.1.1"
5
+ s.version = "0.1.2"
6
6
 
7
7
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
8
8
  s.authors = ["Michael Grosser"]
9
- s.date = %q{2009-09-08}
9
+ s.date = %q{2009-09-09}
10
10
  s.email = %q{grosser.michael@gmail.com}
11
11
  s.extra_rdoc_files = [
12
12
  "README.markdown"
data/lib/cachy.rb CHANGED
@@ -142,7 +142,7 @@ class Cachy
142
142
  # multiple processes in parallel
143
143
  def self.set_while_running(key, options)
144
144
  return unless options.key? :while_running
145
- warn "You cannot set while_running to nil or false" unless options[:while_running]
145
+ warn "You cannot set while_running to nil" if options[:while_running] == nil
146
146
  cache_store.write key, options[:while_running], :expires_in=>WHILE_RUNNING_TMEOUT
147
147
  end
148
148
 
data/spec/cachy_spec.rb CHANGED
@@ -28,6 +28,12 @@ describe Cachy do
28
28
  end
29
29
  end
30
30
 
31
+ it "can set while_running to false" do
32
+ Cachy.cache(:my_key, :while_running=>false) do
33
+ Cachy.cache(:my_key){ 'X' }.should == false
34
+ end
35
+ end
36
+
31
37
  it "can not set while_running to nil" do
32
38
  Cachy.should_receive(:warn)
33
39
  Cachy.cache(:my_key, :while_running=>nil) do
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: grosser-cachy
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michael Grosser
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-09-08 00:00:00 -07:00
12
+ date: 2009-09-09 00:00:00 -07:00
13
13
  default_executable:
14
14
  dependencies: []
15
15