lawnchair 0.5.7 → 0.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/VERSION +1 -1
- data/lawnchair.gemspec +2 -2
- data/lib/storage_engine/abstract.rb +1 -1
- data/lib/storage_engine/redis.rb +5 -6
- data/spec/storage_engine/abstract_spec.rb +2 -4
- metadata +2 -2
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.
|
1
|
+
0.6.0
|
data/lawnchair.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{lawnchair}
|
8
|
-
s.version = "0.
|
8
|
+
s.version = "0.6.0"
|
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"]
|
12
|
-
s.date = %q{2010-
|
12
|
+
s.date = %q{2010-05-19}
|
13
13
|
s.description = %q{Fully featured caching mechanism for arbitrary pieces of resource expensive ruby code using Redis while being able to optionally store data in the Ruby process itself for maximum efficiency.}
|
14
14
|
s.email = %q{shanewolf@gmail.com}
|
15
15
|
s.extra_rdoc_files = [
|
data/lib/storage_engine/redis.rb
CHANGED
@@ -9,12 +9,11 @@ module Lawnchair
|
|
9
9
|
end
|
10
10
|
|
11
11
|
def set(key, value, options={})
|
12
|
-
ttl
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
end
|
12
|
+
ttl = options[:expires_in] || 3600
|
13
|
+
value = Marshal.dump(value) unless options[:raw]
|
14
|
+
|
15
|
+
data_store.set(computed_key(key), value)
|
16
|
+
data_store.expireat(computed_key(key), Time.now.to_i + ttl)
|
18
17
|
end
|
19
18
|
|
20
19
|
def exists?(key)
|
@@ -91,10 +91,8 @@ describe "Lawnchair::StorageEngine::Abstract" do
|
|
91
91
|
abstract_store.computed_key("hooo").should == "Lawnchair:hooo"
|
92
92
|
end
|
93
93
|
|
94
|
-
it "
|
95
|
-
|
96
|
-
abstract_store.computed_key("hooo tyyyyy")
|
97
|
-
end.should raise_error
|
94
|
+
it "removes whitespace that might exist in a key" do
|
95
|
+
abstract_store.computed_key("hooo tyyyyy").should == "Lawnchair:hoootyyyyy"
|
98
96
|
end
|
99
97
|
|
100
98
|
it "raises an exception if no key is given" do
|
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.
|
4
|
+
version: 0.6.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Shane Wolf
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2010-
|
12
|
+
date: 2010-05-19 00:00:00 -07:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|