cachetastic 1.1.3 → 1.1.8
Sign up to get free protection for your applications and to get access to all the features.
- data/README +3 -1
- data/doc/classes/ActiveRecord/Base.html +22 -2
- data/doc/classes/ActiveRecord/Base.src/M000001.html +1 -1
- data/doc/classes/ActiveRecord/Base.src/M000002.html +1 -1
- data/doc/classes/ActiveRecord/Base.src/M000003.html +1 -1
- data/doc/classes/ActiveRecord/Base.src/M000004.html +1 -1
- data/doc/classes/ActiveRecord/Base.src/M000005.html +1 -1
- data/doc/classes/{Cachetastic/Stores.html → CGI/Session/CachetasticStore.html} +23 -14
- data/doc/classes/Cachetastic/Caches/Base/RegisteredCaches.html +17 -6
- data/doc/classes/Cachetastic/Caches/Base/RegisteredCaches.src/{M000044.html → M000043.html} +1 -1
- data/doc/classes/Cachetastic/Caches/Base.html +148 -54
- data/doc/classes/Cachetastic/Caches/Base.src/{M000043.html → M000032.html} +4 -4
- data/doc/classes/Cachetastic/Caches/Base.src/M000033.html +14 -4
- data/doc/classes/Cachetastic/Caches/Base.src/M000034.html +9 -6
- data/doc/classes/Cachetastic/Caches/Base.src/M000035.html +5 -13
- data/doc/classes/Cachetastic/Caches/Base.src/M000036.html +5 -18
- data/doc/classes/Cachetastic/Caches/Base.src/M000037.html +4 -6
- data/doc/classes/Cachetastic/Caches/Base.src/M000038.html +4 -5
- data/doc/classes/Cachetastic/Caches/Base.src/M000039.html +4 -4
- data/doc/classes/Cachetastic/Caches/Base.src/M000040.html +4 -4
- data/doc/classes/Cachetastic/Caches/Base.src/M000041.html +4 -4
- data/doc/classes/Cachetastic/Caches/Base.src/M000042.html +14 -4
- data/doc/classes/Cachetastic/Caches/PageCache.html +8 -0
- data/doc/classes/Cachetastic/Caches/RailsSessionCache.html +6 -0
- data/doc/classes/Cachetastic/Connection.html +14 -14
- data/doc/classes/Cachetastic/Connection.src/M000044.html +18 -0
- data/doc/classes/Cachetastic/Connection.src/M000045.html +10 -4
- data/doc/classes/Cachetastic/Logger.html +5 -5
- data/doc/classes/Cachetastic/Stores/Base.html +68 -45
- data/doc/classes/Cachetastic/Stores/Base.src/{M000028.html → M000023.html} +1 -1
- data/doc/classes/Cachetastic/Stores/Base.src/{M000030.html → M000024.html} +1 -1
- data/doc/classes/Cachetastic/Stores/Base.src/{M000032.html → M000025.html} +1 -1
- data/doc/classes/Cachetastic/Stores/File.html +265 -0
- data/doc/classes/Cachetastic/Stores/File.src/M000026.html +18 -0
- data/doc/classes/Cachetastic/Stores/File.src/M000027.html +20 -0
- data/doc/classes/Cachetastic/Stores/File.src/M000028.html +19 -0
- data/doc/classes/Cachetastic/Stores/File.src/M000029.html +33 -0
- data/doc/classes/Cachetastic/Stores/File.src/M000030.html +21 -0
- data/doc/classes/Cachetastic/Stores/{LocalMemory.src/M000025.html → File.src/M000031.html} +3 -3
- data/doc/classes/Cachetastic/Stores/LocalMemory.html +41 -36
- data/doc/classes/Cachetastic/Stores/{Base.src/M000029.html → LocalMemory.src/M000017.html} +3 -3
- data/doc/classes/Cachetastic/Stores/LocalMemory.src/M000018.html +18 -0
- data/doc/classes/Cachetastic/Stores/LocalMemory.src/M000019.html +18 -0
- data/doc/classes/Cachetastic/Stores/LocalMemory.src/M000020.html +12 -4
- data/doc/classes/Cachetastic/Stores/LocalMemory.src/M000021.html +4 -4
- data/doc/classes/Cachetastic/Stores/LocalMemory.src/M000022.html +11 -4
- data/doc/classes/Cachetastic/Stores/Memcache.html +85 -59
- data/doc/classes/Cachetastic/Stores/Memcache.src/M000006.html +19 -0
- data/doc/classes/Cachetastic/Stores/{LocalMemory.src/M000024.html → Memcache.src/M000007.html} +3 -3
- data/doc/classes/Cachetastic/Stores/Memcache.src/M000008.html +18 -0
- data/doc/classes/Cachetastic/Stores/Memcache.src/M000009.html +4 -5
- data/doc/classes/Cachetastic/Stores/Memcache.src/M000010.html +4 -4
- data/doc/classes/Cachetastic/Stores/Memcache.src/M000011.html +4 -4
- data/doc/classes/Cachetastic/Stores/Memcache.src/M000012.html +10 -4
- data/doc/classes/Cachetastic/Stores/Memcache.src/M000013.html +5 -4
- data/doc/classes/Cachetastic/Stores/Memcache.src/M000014.html +6 -4
- data/doc/classes/Cachetastic/Stores/Memcache.src/M000015.html +6 -5
- data/doc/classes/Cachetastic/Stores/Memcache.src/M000016.html +9 -9
- data/doc/created.rid +1 -1
- data/doc/files/init_rb.html +111 -1
- data/doc/files/lib/caches/cachetastic_caches_base_rb.html +1 -1
- data/doc/files/lib/caches/cachetastic_caches_page_cache_rb.html +9 -1
- data/doc/files/lib/caches/cachetastic_caches_rails_session_cache_rb.html +7 -1
- data/doc/files/lib/cachetastic_connection_rb.html +1 -1
- data/doc/files/lib/cachetastic_rb.html +6 -2
- data/doc/files/lib/helpers/cachetastic_helpers_active_record_rb.html +1 -1
- data/doc/files/lib/rails_extensions/cachetastic_active_record_base_rb.html +1 -1
- data/doc/files/lib/rails_extensions/cgi_session_cachetastic_store_rb.html +1 -1
- data/doc/files/lib/stores/cachetastic_stores_base_rb.html +39 -1
- data/doc/{classes/ActiveRecord.html → files/lib/stores/cachetastic_stores_file_rb.html} +36 -22
- data/doc/files/lib/stores/cachetastic_stores_local_memory_rb.html +9 -1
- data/doc/files/lib/stores/cachetastic_stores_memcache_rb.html +27 -1
- data/doc/{classes/Cachetastic/Caches/ActiveRecord.html → files/lib/stores/cachetastic_stores_store_object_rb.html} +15 -19
- data/doc/fr_class_index.html +2 -8
- data/doc/fr_file_index.html +2 -0
- data/doc/fr_method_index.html +41 -42
- data/doc/index.html +2 -2
- data/init.rb +1 -0
- data/lib/caches/cachetastic_caches_base.rb +81 -18
- data/lib/caches/cachetastic_caches_page_cache.rb +4 -0
- data/lib/caches/cachetastic_caches_rails_session_cache.rb +1 -0
- data/lib/cachetastic.rb +10 -6
- data/lib/cachetastic_connection.rb +2 -2
- data/lib/helpers/cachetastic_helpers_active_record.rb +12 -1
- data/lib/rails_extensions/cachetastic_active_record_base.rb +10 -0
- data/lib/rails_extensions/cgi_session_cachetastic_store.rb +15 -10
- data/lib/stores/cachetastic_stores_base.rb +33 -13
- data/lib/stores/cachetastic_stores_file.rb +101 -0
- data/lib/stores/cachetastic_stores_local_memory.rb +6 -27
- data/lib/stores/cachetastic_stores_memcache.rb +24 -5
- data/lib/stores/cachetastic_stores_store_object.rb +28 -0
- data/lib/tasks/rubyforge_config.yml +1 -1
- metadata +28 -32
- data/doc/classes/Cachetastic/Caches.html +0 -114
- data/doc/classes/Cachetastic/Connection.src/M000046.html +0 -24
- data/doc/classes/Cachetastic/Helpers/ActiveRecord.html +0 -165
- data/doc/classes/Cachetastic/Helpers/ActiveRecord.src/M000006.html +0 -29
- data/doc/classes/Cachetastic/Helpers/ActiveRecord.src/M000007.html +0 -23
- data/doc/classes/Cachetastic/Helpers/ActiveRecord.src/M000008.html +0 -18
- data/doc/classes/Cachetastic/Helpers.html +0 -115
- data/doc/classes/Cachetastic/Stores/Base.src/M000031.html +0 -22
- data/doc/classes/Cachetastic/Stores/LocalMemory/StoreObject.html +0 -177
- data/doc/classes/Cachetastic/Stores/LocalMemory/StoreObject.src/M000026.html +0 -27
- data/doc/classes/Cachetastic/Stores/LocalMemory/StoreObject.src/M000027.html +0 -19
- data/doc/classes/Cachetastic/Stores/LocalMemory.src/M000023.html +0 -26
- data/doc/classes/Cachetastic/Stores/Memcache.src/M000017.html +0 -20
- data/doc/classes/Cachetastic/Stores/Memcache.src/M000018.html +0 -20
- data/doc/classes/Cachetastic/Stores/Memcache.src/M000019.html +0 -24
- data/doc/classes/Cachetastic.html +0 -119
- /data/doc/classes/Cachetastic/Logger.src/{M000047.html → M000046.html} +0 -0
@@ -0,0 +1,101 @@
|
|
1
|
+
# This store uses the file system as it's backing.
|
2
|
+
# The configuration for this should look something like this:
|
3
|
+
# my_awesome_cache_options:
|
4
|
+
# debug: false
|
5
|
+
# store: file
|
6
|
+
# marshall_method: none
|
7
|
+
# default_expiry: <%= 24.hours %>
|
8
|
+
# store_options:
|
9
|
+
# dir: /usr/local/caches/
|
10
|
+
# logging:
|
11
|
+
# logger_1:
|
12
|
+
# type: file
|
13
|
+
# file: log/file_store_cache.log
|
14
|
+
class Cachetastic::Stores::File < Cachetastic::Stores::Base
|
15
|
+
|
16
|
+
attr_reader :directory
|
17
|
+
attr_reader :hashed_keys
|
18
|
+
|
19
|
+
def valid?
|
20
|
+
File.exists?(self.directory)
|
21
|
+
end
|
22
|
+
|
23
|
+
def setup
|
24
|
+
@directory = File.join(self.store_options["dir"], self.name.to_s)
|
25
|
+
FileUtils.mkdir_p(self.directory, :verbose => self.debug?)
|
26
|
+
@hashed_keys = {}
|
27
|
+
end
|
28
|
+
|
29
|
+
def expire_all
|
30
|
+
FileUtils.rm_rf(self.directory, :verbose => self.debug?)
|
31
|
+
setup
|
32
|
+
end
|
33
|
+
|
34
|
+
def get(key)
|
35
|
+
full_path = full_path_from_dir(get_key_directoy(key, false))
|
36
|
+
return nil unless File.exists?(full_path)
|
37
|
+
so = YAML::load(File.open(full_path).read)
|
38
|
+
if so
|
39
|
+
if so.invalid?
|
40
|
+
self.delete(key)
|
41
|
+
return nil
|
42
|
+
end
|
43
|
+
if so.value.is_a?(YAML::Object)
|
44
|
+
puts "require #{so.value.class.underscore}"
|
45
|
+
require so.value.class.underscore
|
46
|
+
so = YAML::load(File.open(full_path).read)
|
47
|
+
end
|
48
|
+
return so.value
|
49
|
+
end
|
50
|
+
return nil
|
51
|
+
end
|
52
|
+
|
53
|
+
def set(key, value, expiry = 0)
|
54
|
+
so = Cachetastic::Stores::StoreObject.new(key.to_s, value, expiry)
|
55
|
+
File.open(full_path_from_key(key), "w") do |f|
|
56
|
+
f.puts YAML.dump(so)
|
57
|
+
end
|
58
|
+
end
|
59
|
+
|
60
|
+
def delete(key, delay = 0)
|
61
|
+
if delay <= 0
|
62
|
+
FileUtils.rm_rf(get_key_directoy(key), :verbose => self.debug?)
|
63
|
+
else
|
64
|
+
so = self.get(key)
|
65
|
+
if so
|
66
|
+
self.set(so.key, so.value, delay)
|
67
|
+
end
|
68
|
+
end
|
69
|
+
end
|
70
|
+
|
71
|
+
private
|
72
|
+
def get_key_directoy(key, mkdir = true)
|
73
|
+
hkey = self.hashed_keys[key.to_sym]
|
74
|
+
if hkey.nil?
|
75
|
+
hkey = key.to_s.hexdigest.hash
|
76
|
+
hkey = hkey * -1 if hkey < 0
|
77
|
+
hkey = hkey.to_s
|
78
|
+
i = 0
|
79
|
+
path = self.directory
|
80
|
+
until i == hkey.length do
|
81
|
+
path = File.join(path, hkey[i..i])
|
82
|
+
i += 1
|
83
|
+
end
|
84
|
+
self.hashed_keys[key.to_sym] = path
|
85
|
+
hkey = path
|
86
|
+
end
|
87
|
+
FileUtils.mkdir_p(hkey, :verbose => self.debug?) if mkdir
|
88
|
+
hkey
|
89
|
+
end
|
90
|
+
|
91
|
+
def full_path_from_key(key)
|
92
|
+
full_path_from_dir(get_key_directoy(key))
|
93
|
+
end
|
94
|
+
|
95
|
+
def full_path_from_dir(dir)
|
96
|
+
File.join(dir, STORE_FILE_NAME)
|
97
|
+
end
|
98
|
+
|
99
|
+
STORE_FILE_NAME = "cache.yml"
|
100
|
+
|
101
|
+
end
|
@@ -1,3 +1,6 @@
|
|
1
|
+
# A store that keeps objects in local memory. This is great for development/testing,
|
2
|
+
# but probably shouldn't be put into production.
|
3
|
+
# It's also a very good example of how to write a store.
|
1
4
|
class Cachetastic::Stores::LocalMemory < Cachetastic::Stores::Base
|
2
5
|
|
3
6
|
attr_accessor :local_store
|
@@ -14,10 +17,11 @@ class Cachetastic::Stores::LocalMemory < Cachetastic::Stores::Base
|
|
14
17
|
self.local_store = {}
|
15
18
|
end
|
16
19
|
|
20
|
+
# See Cachetastic::Stores::Base
|
17
21
|
def get(key)
|
18
22
|
so = self.local_store[key.to_s]
|
19
23
|
if so
|
20
|
-
if
|
24
|
+
if so.invalid?
|
21
25
|
self.delete(key)
|
22
26
|
return nil
|
23
27
|
end
|
@@ -27,7 +31,7 @@ class Cachetastic::Stores::LocalMemory < Cachetastic::Stores::Base
|
|
27
31
|
end
|
28
32
|
|
29
33
|
def set(key, value, expiry = 0)
|
30
|
-
self.local_store[key.to_s] = StoreObject.new(key.to_s, value, expiry)
|
34
|
+
self.local_store[key.to_s] = Cachetastic::Stores::StoreObject.new(key.to_s, value, expiry)
|
31
35
|
end
|
32
36
|
|
33
37
|
def delete(key, delay = 0)
|
@@ -41,30 +45,5 @@ class Cachetastic::Stores::LocalMemory < Cachetastic::Stores::Base
|
|
41
45
|
end
|
42
46
|
end
|
43
47
|
|
44
|
-
private
|
45
|
-
class StoreObject
|
46
|
-
attr_accessor :key
|
47
|
-
attr_accessor :value
|
48
|
-
attr_accessor :expires_at
|
49
|
-
|
50
|
-
def initialize(key, value, expiry)
|
51
|
-
self.key = key
|
52
|
-
self.value = value
|
53
|
-
begin
|
54
|
-
self.expires_at = (Time.now + (expiry == 0 ? (31536000) : expiry)) # 31536000 = one year
|
55
|
-
rescue RangeError => e
|
56
|
-
self.expires_at = Time.at(expiry)
|
57
|
-
end
|
58
|
-
# puts "now: #{Time.now}"
|
59
|
-
# puts "expiry: #{expiry}"
|
60
|
-
# puts "expires_at: #{self.expires_at}"
|
61
|
-
end
|
62
|
-
|
63
|
-
def size
|
64
|
-
return self.value.size if self.value.respond_to?(:size)
|
65
|
-
-1
|
66
|
-
end
|
67
|
-
|
68
|
-
end
|
69
48
|
|
70
49
|
end
|
@@ -1,3 +1,22 @@
|
|
1
|
+
# This store uses Memcache as it's backing.
|
2
|
+
# The configuration for this should look something like this:
|
3
|
+
# my_awesome_cache_options:
|
4
|
+
# debug: false
|
5
|
+
# store: memcache
|
6
|
+
# marshall_method: none
|
7
|
+
# default_expiry: <%= 24.hours %>
|
8
|
+
# store_options:
|
9
|
+
# c_threshold: 10_000
|
10
|
+
# compression: true
|
11
|
+
# debug: false
|
12
|
+
# readonly: false
|
13
|
+
# urlencode: false
|
14
|
+
# logging:
|
15
|
+
# logger_1:
|
16
|
+
# type: file
|
17
|
+
# file: log/memcached.log
|
18
|
+
# servers:
|
19
|
+
# - 127.0.0.1:11211
|
1
20
|
class Cachetastic::Stores::Memcache < Cachetastic::Stores::Base
|
2
21
|
|
3
22
|
def setup
|
@@ -25,11 +44,6 @@ class Cachetastic::Stores::Memcache < Cachetastic::Stores::Base
|
|
25
44
|
self.conn.inspect + " <version: #{self.version}> #{self.conn.stats.inspect}"
|
26
45
|
end
|
27
46
|
|
28
|
-
def namespace
|
29
|
-
v = self.get_version(self.name)
|
30
|
-
return "#{name}.#{v}"
|
31
|
-
end
|
32
|
-
|
33
47
|
def valid?
|
34
48
|
begin
|
35
49
|
return (self.conn.active? && self.version == self.get_version(self.name))
|
@@ -44,6 +58,11 @@ class Cachetastic::Stores::Memcache < Cachetastic::Stores::Base
|
|
44
58
|
attr_accessor :conn
|
45
59
|
attr_accessor :version
|
46
60
|
|
61
|
+
def namespace
|
62
|
+
v = self.get_version(self.name)
|
63
|
+
return "#{name}.#{v}"
|
64
|
+
end
|
65
|
+
|
47
66
|
def ns_versions
|
48
67
|
ivar_cache do
|
49
68
|
ns_conn = MemCache.new(self.servers, self.store_options.merge({:namespace => :namespace_versions}))
|
@@ -0,0 +1,28 @@
|
|
1
|
+
class Cachetastic::Stores::StoreObject #:nodoc:#
|
2
|
+
attr_accessor :key
|
3
|
+
attr_accessor :value
|
4
|
+
attr_accessor :expires_at
|
5
|
+
|
6
|
+
def initialize(key, value, expiry)
|
7
|
+
self.key = key
|
8
|
+
self.value = value
|
9
|
+
begin
|
10
|
+
self.expires_at = (Time.now + (expiry == 0 ? (31536000) : expiry)) # 31536000 = one year
|
11
|
+
rescue RangeError => e
|
12
|
+
self.expires_at = Time.at(expiry)
|
13
|
+
end
|
14
|
+
# puts "now: #{Time.now}"
|
15
|
+
# puts "expiry: #{expiry}"
|
16
|
+
# puts "expires_at: #{self.expires_at}"
|
17
|
+
end
|
18
|
+
|
19
|
+
def size
|
20
|
+
return self.value.size if self.value.respond_to?(:size)
|
21
|
+
-1
|
22
|
+
end
|
23
|
+
|
24
|
+
def invalid?
|
25
|
+
Time.now >= self.expires_at
|
26
|
+
end
|
27
|
+
|
28
|
+
end
|
metadata
CHANGED
@@ -3,8 +3,8 @@ rubygems_version: 0.9.2
|
|
3
3
|
specification_version: 1
|
4
4
|
name: cachetastic
|
5
5
|
version: !ruby/object:Gem::Version
|
6
|
-
version: 1.1.
|
7
|
-
date: 2008-01-
|
6
|
+
version: 1.1.8
|
7
|
+
date: 2008-01-16 00:00:00 -05:00
|
8
8
|
summary: cachetastic
|
9
9
|
require_paths:
|
10
10
|
- lib
|
@@ -38,13 +38,12 @@ files:
|
|
38
38
|
- doc/classes/ActiveRecord/Base.src/M000003.html
|
39
39
|
- doc/classes/ActiveRecord/Base.src/M000004.html
|
40
40
|
- doc/classes/ActiveRecord/Base.src/M000005.html
|
41
|
-
- doc/classes/ActiveRecord.html
|
42
|
-
- doc/classes/Cachetastic/Caches/ActiveRecord.html
|
43
41
|
- doc/classes/Cachetastic/Caches/Base/RegisteredCaches.html
|
44
42
|
- doc/classes/Cachetastic/Caches/Base/RegisteredCaches.src
|
45
|
-
- doc/classes/Cachetastic/Caches/Base/RegisteredCaches.src/
|
43
|
+
- doc/classes/Cachetastic/Caches/Base/RegisteredCaches.src/M000043.html
|
46
44
|
- doc/classes/Cachetastic/Caches/Base.html
|
47
45
|
- doc/classes/Cachetastic/Caches/Base.src
|
46
|
+
- doc/classes/Cachetastic/Caches/Base.src/M000032.html
|
48
47
|
- doc/classes/Cachetastic/Caches/Base.src/M000033.html
|
49
48
|
- doc/classes/Cachetastic/Caches/Base.src/M000034.html
|
50
49
|
- doc/classes/Cachetastic/Caches/Base.src/M000035.html
|
@@ -55,44 +54,41 @@ files:
|
|
55
54
|
- doc/classes/Cachetastic/Caches/Base.src/M000040.html
|
56
55
|
- doc/classes/Cachetastic/Caches/Base.src/M000041.html
|
57
56
|
- doc/classes/Cachetastic/Caches/Base.src/M000042.html
|
58
|
-
- doc/classes/Cachetastic/Caches/Base.src/M000043.html
|
59
57
|
- doc/classes/Cachetastic/Caches/PageCache.html
|
60
58
|
- doc/classes/Cachetastic/Caches/RailsSessionCache.html
|
61
|
-
- doc/classes/Cachetastic/Caches.html
|
62
59
|
- doc/classes/Cachetastic/Connection.html
|
63
60
|
- doc/classes/Cachetastic/Connection.src
|
61
|
+
- doc/classes/Cachetastic/Connection.src/M000044.html
|
64
62
|
- doc/classes/Cachetastic/Connection.src/M000045.html
|
65
|
-
- doc/classes/Cachetastic/Connection.src/M000046.html
|
66
|
-
- doc/classes/Cachetastic/Helpers/ActiveRecord.html
|
67
|
-
- doc/classes/Cachetastic/Helpers/ActiveRecord.src
|
68
|
-
- doc/classes/Cachetastic/Helpers/ActiveRecord.src/M000006.html
|
69
|
-
- doc/classes/Cachetastic/Helpers/ActiveRecord.src/M000007.html
|
70
|
-
- doc/classes/Cachetastic/Helpers/ActiveRecord.src/M000008.html
|
71
|
-
- doc/classes/Cachetastic/Helpers.html
|
72
63
|
- doc/classes/Cachetastic/Logger.html
|
73
64
|
- doc/classes/Cachetastic/Logger.src
|
74
|
-
- doc/classes/Cachetastic/Logger.src/
|
65
|
+
- doc/classes/Cachetastic/Logger.src/M000046.html
|
75
66
|
- doc/classes/Cachetastic/Stores/Base.html
|
76
67
|
- doc/classes/Cachetastic/Stores/Base.src
|
77
|
-
- doc/classes/Cachetastic/Stores/Base.src/
|
78
|
-
- doc/classes/Cachetastic/Stores/Base.src/
|
79
|
-
- doc/classes/Cachetastic/Stores/Base.src/
|
80
|
-
- doc/classes/Cachetastic/Stores/
|
81
|
-
- doc/classes/Cachetastic/Stores/
|
82
|
-
- doc/classes/Cachetastic/Stores/
|
83
|
-
- doc/classes/Cachetastic/Stores/
|
84
|
-
- doc/classes/Cachetastic/Stores/
|
85
|
-
- doc/classes/Cachetastic/Stores/
|
68
|
+
- doc/classes/Cachetastic/Stores/Base.src/M000023.html
|
69
|
+
- doc/classes/Cachetastic/Stores/Base.src/M000024.html
|
70
|
+
- doc/classes/Cachetastic/Stores/Base.src/M000025.html
|
71
|
+
- doc/classes/Cachetastic/Stores/File.html
|
72
|
+
- doc/classes/Cachetastic/Stores/File.src
|
73
|
+
- doc/classes/Cachetastic/Stores/File.src/M000026.html
|
74
|
+
- doc/classes/Cachetastic/Stores/File.src/M000027.html
|
75
|
+
- doc/classes/Cachetastic/Stores/File.src/M000028.html
|
76
|
+
- doc/classes/Cachetastic/Stores/File.src/M000029.html
|
77
|
+
- doc/classes/Cachetastic/Stores/File.src/M000030.html
|
78
|
+
- doc/classes/Cachetastic/Stores/File.src/M000031.html
|
86
79
|
- doc/classes/Cachetastic/Stores/LocalMemory.html
|
87
80
|
- doc/classes/Cachetastic/Stores/LocalMemory.src
|
81
|
+
- doc/classes/Cachetastic/Stores/LocalMemory.src/M000017.html
|
82
|
+
- doc/classes/Cachetastic/Stores/LocalMemory.src/M000018.html
|
83
|
+
- doc/classes/Cachetastic/Stores/LocalMemory.src/M000019.html
|
88
84
|
- doc/classes/Cachetastic/Stores/LocalMemory.src/M000020.html
|
89
85
|
- doc/classes/Cachetastic/Stores/LocalMemory.src/M000021.html
|
90
86
|
- doc/classes/Cachetastic/Stores/LocalMemory.src/M000022.html
|
91
|
-
- doc/classes/Cachetastic/Stores/LocalMemory.src/M000023.html
|
92
|
-
- doc/classes/Cachetastic/Stores/LocalMemory.src/M000024.html
|
93
|
-
- doc/classes/Cachetastic/Stores/LocalMemory.src/M000025.html
|
94
87
|
- doc/classes/Cachetastic/Stores/Memcache.html
|
95
88
|
- doc/classes/Cachetastic/Stores/Memcache.src
|
89
|
+
- doc/classes/Cachetastic/Stores/Memcache.src/M000006.html
|
90
|
+
- doc/classes/Cachetastic/Stores/Memcache.src/M000007.html
|
91
|
+
- doc/classes/Cachetastic/Stores/Memcache.src/M000008.html
|
96
92
|
- doc/classes/Cachetastic/Stores/Memcache.src/M000009.html
|
97
93
|
- doc/classes/Cachetastic/Stores/Memcache.src/M000010.html
|
98
94
|
- doc/classes/Cachetastic/Stores/Memcache.src/M000011.html
|
@@ -101,11 +97,7 @@ files:
|
|
101
97
|
- doc/classes/Cachetastic/Stores/Memcache.src/M000014.html
|
102
98
|
- doc/classes/Cachetastic/Stores/Memcache.src/M000015.html
|
103
99
|
- doc/classes/Cachetastic/Stores/Memcache.src/M000016.html
|
104
|
-
- doc/classes/
|
105
|
-
- doc/classes/Cachetastic/Stores/Memcache.src/M000018.html
|
106
|
-
- doc/classes/Cachetastic/Stores/Memcache.src/M000019.html
|
107
|
-
- doc/classes/Cachetastic/Stores.html
|
108
|
-
- doc/classes/Cachetastic.html
|
100
|
+
- doc/classes/CGI/Session/CachetasticStore.html
|
109
101
|
- doc/created.rid
|
110
102
|
- doc/files/init_rb.html
|
111
103
|
- doc/files/lib/caches/cachetastic_caches_base_rb.html
|
@@ -118,8 +110,10 @@ files:
|
|
118
110
|
- doc/files/lib/rails_extensions/cachetastic_active_record_base_rb.html
|
119
111
|
- doc/files/lib/rails_extensions/cgi_session_cachetastic_store_rb.html
|
120
112
|
- doc/files/lib/stores/cachetastic_stores_base_rb.html
|
113
|
+
- doc/files/lib/stores/cachetastic_stores_file_rb.html
|
121
114
|
- doc/files/lib/stores/cachetastic_stores_local_memory_rb.html
|
122
115
|
- doc/files/lib/stores/cachetastic_stores_memcache_rb.html
|
116
|
+
- doc/files/lib/stores/cachetastic_stores_store_object_rb.html
|
123
117
|
- doc/fr_class_index.html
|
124
118
|
- doc/fr_file_index.html
|
125
119
|
- doc/fr_method_index.html
|
@@ -136,8 +130,10 @@ files:
|
|
136
130
|
- lib/rails_extensions/cachetastic_active_record_base.rb
|
137
131
|
- lib/rails_extensions/cgi_session_cachetastic_store.rb
|
138
132
|
- lib/stores/cachetastic_stores_base.rb
|
133
|
+
- lib/stores/cachetastic_stores_file.rb
|
139
134
|
- lib/stores/cachetastic_stores_local_memory.rb
|
140
135
|
- lib/stores/cachetastic_stores_memcache.rb
|
136
|
+
- lib/stores/cachetastic_stores_store_object.rb
|
141
137
|
- lib/tasks/rubyforge_config.yml
|
142
138
|
- README
|
143
139
|
test_files: []
|
@@ -1,114 +0,0 @@
|
|
1
|
-
<?xml version="1.0" encoding="iso-8859-1"?>
|
2
|
-
<!DOCTYPE html
|
3
|
-
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
4
|
-
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
5
|
-
|
6
|
-
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
7
|
-
<head>
|
8
|
-
<title>Module: Cachetastic::Caches</title>
|
9
|
-
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
10
|
-
<meta http-equiv="Content-Script-Type" content="text/javascript" />
|
11
|
-
<link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
|
12
|
-
<script type="text/javascript">
|
13
|
-
// <![CDATA[
|
14
|
-
|
15
|
-
function popupCode( url ) {
|
16
|
-
window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
|
17
|
-
}
|
18
|
-
|
19
|
-
function toggleCode( id ) {
|
20
|
-
if ( document.getElementById )
|
21
|
-
elem = document.getElementById( id );
|
22
|
-
else if ( document.all )
|
23
|
-
elem = eval( "document.all." + id );
|
24
|
-
else
|
25
|
-
return false;
|
26
|
-
|
27
|
-
elemStyle = elem.style;
|
28
|
-
|
29
|
-
if ( elemStyle.display != "block" ) {
|
30
|
-
elemStyle.display = "block"
|
31
|
-
} else {
|
32
|
-
elemStyle.display = "none"
|
33
|
-
}
|
34
|
-
|
35
|
-
return true;
|
36
|
-
}
|
37
|
-
|
38
|
-
// Make codeblocks hidden by default
|
39
|
-
document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
|
40
|
-
|
41
|
-
// ]]>
|
42
|
-
</script>
|
43
|
-
|
44
|
-
</head>
|
45
|
-
<body>
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
<div id="classHeader">
|
50
|
-
<table class="header-table">
|
51
|
-
<tr class="top-aligned-row">
|
52
|
-
<td><strong>Module</strong></td>
|
53
|
-
<td class="class-name-in-header">Cachetastic::Caches</td>
|
54
|
-
</tr>
|
55
|
-
<tr class="top-aligned-row">
|
56
|
-
<td><strong>In:</strong></td>
|
57
|
-
<td>
|
58
|
-
<a href="../../files/lib/cachetastic_rb.html">
|
59
|
-
lib/cachetastic.rb
|
60
|
-
</a>
|
61
|
-
<br />
|
62
|
-
</td>
|
63
|
-
</tr>
|
64
|
-
|
65
|
-
</table>
|
66
|
-
</div>
|
67
|
-
<!-- banner header -->
|
68
|
-
|
69
|
-
<div id="bodyContent">
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
<div id="contextContent">
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
</div>
|
78
|
-
|
79
|
-
|
80
|
-
</div>
|
81
|
-
|
82
|
-
|
83
|
-
<!-- if includes -->
|
84
|
-
|
85
|
-
<div id="section">
|
86
|
-
|
87
|
-
<div id="class-list">
|
88
|
-
<h3 class="section-bar">Classes and Modules</h3>
|
89
|
-
|
90
|
-
Module <a href="Caches/ActiveRecord.html" class="link">Cachetastic::Caches::ActiveRecord</a><br />
|
91
|
-
Class <a href="Caches/Base.html" class="link">Cachetastic::Caches::Base</a><br />
|
92
|
-
Class <a href="Caches/PageCache.html" class="link">Cachetastic::Caches::PageCache</a><br />
|
93
|
-
Class <a href="Caches/RailsSessionCache.html" class="link">Cachetastic::Caches::RailsSessionCache</a><br />
|
94
|
-
|
95
|
-
</div>
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
<!-- if method_list -->
|
104
|
-
|
105
|
-
|
106
|
-
</div>
|
107
|
-
|
108
|
-
|
109
|
-
<div id="validator-badges">
|
110
|
-
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
111
|
-
</div>
|
112
|
-
|
113
|
-
</body>
|
114
|
-
</html>
|
@@ -1,24 +0,0 @@
|
|
1
|
-
<?xml version="1.0" encoding="iso-8859-1"?>
|
2
|
-
<!DOCTYPE html
|
3
|
-
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
4
|
-
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
5
|
-
|
6
|
-
<html>
|
7
|
-
<head>
|
8
|
-
<title>get (Cachetastic::Connection)</title>
|
9
|
-
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
10
|
-
<link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
|
11
|
-
</head>
|
12
|
-
<body class="standalone-code">
|
13
|
-
<pre><span class="ruby-comment cmt"># File lib/cachetastic_connection.rb, line 14</span>
|
14
|
-
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">get</span>(<span class="ruby-identifier">name</span>)
|
15
|
-
<span class="ruby-identifier">name</span> = <span class="ruby-identifier">name</span>.<span class="ruby-identifier">to_sym</span>
|
16
|
-
<span class="ruby-identifier">conn</span> = <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">connections</span>[<span class="ruby-identifier">name</span>]
|
17
|
-
<span class="ruby-keyword kw">return</span> <span class="ruby-identifier">conn</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">conn</span> <span class="ruby-operator">&&</span> <span class="ruby-identifier">conn</span>.<span class="ruby-identifier">valid?</span>
|
18
|
-
<span class="ruby-identifier">store</span> = <span class="ruby-constant">Cachetastic</span><span class="ruby-operator">::</span><span class="ruby-constant">Stores</span><span class="ruby-operator">::</span><span class="ruby-constant">Base</span>.<span class="ruby-identifier">get_options</span>(<span class="ruby-identifier">name</span>)[<span class="ruby-value str">"store"</span>].<span class="ruby-identifier">camelcase</span>
|
19
|
-
<span class="ruby-identifier">conn</span> = <span class="ruby-node">"Cachetastic::Stores::#{store}"</span>.<span class="ruby-identifier">constantize</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">name</span>)
|
20
|
-
<span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">connections</span>[<span class="ruby-identifier">name</span>.<span class="ruby-identifier">to_sym</span>] = <span class="ruby-identifier">conn</span>
|
21
|
-
<span class="ruby-keyword kw">return</span> <span class="ruby-identifier">conn</span>
|
22
|
-
<span class="ruby-keyword kw">end</span></pre>
|
23
|
-
</body>
|
24
|
-
</html>
|
@@ -1,165 +0,0 @@
|
|
1
|
-
<?xml version="1.0" encoding="iso-8859-1"?>
|
2
|
-
<!DOCTYPE html
|
3
|
-
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
4
|
-
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
5
|
-
|
6
|
-
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
7
|
-
<head>
|
8
|
-
<title>Module: Cachetastic::Helpers::ActiveRecord</title>
|
9
|
-
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
10
|
-
<meta http-equiv="Content-Script-Type" content="text/javascript" />
|
11
|
-
<link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
|
12
|
-
<script type="text/javascript">
|
13
|
-
// <![CDATA[
|
14
|
-
|
15
|
-
function popupCode( url ) {
|
16
|
-
window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
|
17
|
-
}
|
18
|
-
|
19
|
-
function toggleCode( id ) {
|
20
|
-
if ( document.getElementById )
|
21
|
-
elem = document.getElementById( id );
|
22
|
-
else if ( document.all )
|
23
|
-
elem = eval( "document.all." + id );
|
24
|
-
else
|
25
|
-
return false;
|
26
|
-
|
27
|
-
elemStyle = elem.style;
|
28
|
-
|
29
|
-
if ( elemStyle.display != "block" ) {
|
30
|
-
elemStyle.display = "block"
|
31
|
-
} else {
|
32
|
-
elemStyle.display = "none"
|
33
|
-
}
|
34
|
-
|
35
|
-
return true;
|
36
|
-
}
|
37
|
-
|
38
|
-
// Make codeblocks hidden by default
|
39
|
-
document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
|
40
|
-
|
41
|
-
// ]]>
|
42
|
-
</script>
|
43
|
-
|
44
|
-
</head>
|
45
|
-
<body>
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
<div id="classHeader">
|
50
|
-
<table class="header-table">
|
51
|
-
<tr class="top-aligned-row">
|
52
|
-
<td><strong>Module</strong></td>
|
53
|
-
<td class="class-name-in-header">Cachetastic::Helpers::ActiveRecord</td>
|
54
|
-
</tr>
|
55
|
-
<tr class="top-aligned-row">
|
56
|
-
<td><strong>In:</strong></td>
|
57
|
-
<td>
|
58
|
-
<a href="../../../files/lib/cachetastic_rb.html">
|
59
|
-
lib/cachetastic.rb
|
60
|
-
</a>
|
61
|
-
<br />
|
62
|
-
<a href="../../../files/lib/helpers/cachetastic_helpers_active_record_rb.html">
|
63
|
-
lib/helpers/cachetastic_helpers_active_record.rb
|
64
|
-
</a>
|
65
|
-
<br />
|
66
|
-
</td>
|
67
|
-
</tr>
|
68
|
-
|
69
|
-
</table>
|
70
|
-
</div>
|
71
|
-
<!-- banner header -->
|
72
|
-
|
73
|
-
<div id="bodyContent">
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
<div id="contextContent">
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
</div>
|
82
|
-
|
83
|
-
<div id="method-list">
|
84
|
-
<h3 class="section-bar">Methods</h3>
|
85
|
-
|
86
|
-
<div class="name-list">
|
87
|
-
<a href="#M000007">cache</a>
|
88
|
-
<a href="#M000006">cache_class</a>
|
89
|
-
<a href="#M000008">expire_all</a>
|
90
|
-
</div>
|
91
|
-
</div>
|
92
|
-
|
93
|
-
</div>
|
94
|
-
|
95
|
-
|
96
|
-
<!-- if includes -->
|
97
|
-
|
98
|
-
<div id="section">
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
<!-- if method_list -->
|
108
|
-
<div id="methods">
|
109
|
-
<h3 class="section-bar">Public Instance methods</h3>
|
110
|
-
|
111
|
-
<div id="method-M000007" class="method-detail">
|
112
|
-
<a name="M000007"></a>
|
113
|
-
|
114
|
-
<div class="method-heading">
|
115
|
-
<a href="ActiveRecord.src/M000007.html" target="Code" class="method-signature"
|
116
|
-
onclick="popupCode('ActiveRecord.src/M000007.html');return false;">
|
117
|
-
<span class="method-name">cache</span><span class="method-args">(key, expiry = 0) {|| ...}</span>
|
118
|
-
</a>
|
119
|
-
</div>
|
120
|
-
|
121
|
-
<div class="method-description">
|
122
|
-
</div>
|
123
|
-
</div>
|
124
|
-
|
125
|
-
<div id="method-M000006" class="method-detail">
|
126
|
-
<a name="M000006"></a>
|
127
|
-
|
128
|
-
<div class="method-heading">
|
129
|
-
<a href="ActiveRecord.src/M000006.html" target="Code" class="method-signature"
|
130
|
-
onclick="popupCode('ActiveRecord.src/M000006.html');return false;">
|
131
|
-
<span class="method-name">cache_class</span><span class="method-args">()</span>
|
132
|
-
</a>
|
133
|
-
</div>
|
134
|
-
|
135
|
-
<div class="method-description">
|
136
|
-
</div>
|
137
|
-
</div>
|
138
|
-
|
139
|
-
<div id="method-M000008" class="method-detail">
|
140
|
-
<a name="M000008"></a>
|
141
|
-
|
142
|
-
<div class="method-heading">
|
143
|
-
<a href="ActiveRecord.src/M000008.html" target="Code" class="method-signature"
|
144
|
-
onclick="popupCode('ActiveRecord.src/M000008.html');return false;">
|
145
|
-
<span class="method-name">expire_all</span><span class="method-args">()</span>
|
146
|
-
</a>
|
147
|
-
</div>
|
148
|
-
|
149
|
-
<div class="method-description">
|
150
|
-
</div>
|
151
|
-
</div>
|
152
|
-
|
153
|
-
|
154
|
-
</div>
|
155
|
-
|
156
|
-
|
157
|
-
</div>
|
158
|
-
|
159
|
-
|
160
|
-
<div id="validator-badges">
|
161
|
-
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
162
|
-
</div>
|
163
|
-
|
164
|
-
</body>
|
165
|
-
</html>
|