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
@@ -5,14 +5,24 @@
|
|
5
5
|
|
6
6
|
<html>
|
7
7
|
<head>
|
8
|
-
<title>
|
8
|
+
<title>get (Cachetastic::Caches::Base)</title>
|
9
9
|
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
10
10
|
<link rel="stylesheet" href="../../../.././rdoc-style.css" type="text/css" media="screen" />
|
11
11
|
</head>
|
12
12
|
<body class="standalone-code">
|
13
|
-
<pre><span class="ruby-comment cmt"># File lib/caches/cachetastic_caches_base.rb, line
|
14
|
-
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">
|
15
|
-
<span class="ruby-
|
13
|
+
<pre><span class="ruby-comment cmt"># File lib/caches/cachetastic_caches_base.rb, line 58</span>
|
14
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">get</span>(<span class="ruby-identifier">key</span>)
|
15
|
+
<span class="ruby-identifier">res</span> = <span class="ruby-keyword kw">nil</span>
|
16
|
+
<span class="ruby-identifier">do_with_logging</span>(<span class="ruby-identifier">:get</span>, <span class="ruby-identifier">key</span>) <span class="ruby-keyword kw">do</span>
|
17
|
+
<span class="ruby-identifier">res</span> = <span class="ruby-identifier">store</span>.<span class="ruby-identifier">get</span>(<span class="ruby-identifier">key</span>.<span class="ruby-identifier">to_s</span>)
|
18
|
+
<span class="ruby-keyword kw">if</span> <span class="ruby-identifier">res</span>.<span class="ruby-identifier">nil?</span>
|
19
|
+
<span class="ruby-identifier">res</span> = <span class="ruby-keyword kw">yield</span> <span class="ruby-identifier">key</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">block_given?</span>
|
20
|
+
<span class="ruby-keyword kw">else</span>
|
21
|
+
<span class="ruby-identifier">res</span> = <span class="ruby-identifier">unmarshall</span>(<span class="ruby-identifier">res</span>)
|
22
|
+
<span class="ruby-keyword kw">end</span>
|
23
|
+
<span class="ruby-identifier">res</span>
|
24
|
+
<span class="ruby-keyword kw">end</span>
|
25
|
+
<span class="ruby-identifier">res</span>
|
16
26
|
<span class="ruby-keyword kw">end</span></pre>
|
17
27
|
</body>
|
18
28
|
</html>
|
@@ -5,16 +5,19 @@
|
|
5
5
|
|
6
6
|
<html>
|
7
7
|
<head>
|
8
|
-
<title>
|
8
|
+
<title>set (Cachetastic::Caches::Base)</title>
|
9
9
|
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
10
10
|
<link rel="stylesheet" href="../../../.././rdoc-style.css" type="text/css" media="screen" />
|
11
11
|
</head>
|
12
12
|
<body class="standalone-code">
|
13
|
-
<pre><span class="ruby-comment cmt"># File lib/caches/cachetastic_caches_base.rb, line
|
14
|
-
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">
|
15
|
-
<span class="ruby-
|
16
|
-
|
17
|
-
|
13
|
+
<pre><span class="ruby-comment cmt"># File lib/caches/cachetastic_caches_base.rb, line 79</span>
|
14
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">set</span>(<span class="ruby-identifier">key</span>, <span class="ruby-identifier">value</span>, <span class="ruby-identifier">expiry</span> = (<span class="ruby-identifier">store</span>.<span class="ruby-identifier">all_options</span>[<span class="ruby-value str">"default_expiry"</span>] <span class="ruby-operator">||</span> <span class="ruby-value">0</span>))
|
15
|
+
<span class="ruby-identifier">do_with_logging</span>(<span class="ruby-identifier">:set</span>, <span class="ruby-identifier">key</span>) <span class="ruby-keyword kw">do</span>
|
16
|
+
<span class="ruby-identifier">expiry</span> = <span class="ruby-identifier">calculate_expiry_time</span>(<span class="ruby-identifier">expiry</span>)
|
17
|
+
<span class="ruby-identifier">store</span>.<span class="ruby-identifier">set</span>(<span class="ruby-identifier">key</span>.<span class="ruby-identifier">to_s</span>, <span class="ruby-identifier">marshall</span>(<span class="ruby-identifier">value</span>), <span class="ruby-identifier">expiry</span>.<span class="ruby-identifier">to_i</span>)
|
18
|
+
<span class="ruby-identifier">logger</span>.<span class="ruby-identifier">info</span>(<span class="ruby-value str">''</span>, <span class="ruby-value str">''</span>, <span class="ruby-identifier">:expiry</span>, <span class="ruby-identifier">cache_name</span>, <span class="ruby-identifier">key</span>, <span class="ruby-identifier">expiry</span>.<span class="ruby-identifier">to_i</span>)
|
19
|
+
<span class="ruby-identifier">value</span>
|
20
|
+
<span class="ruby-keyword kw">end</span>
|
18
21
|
<span class="ruby-keyword kw">end</span></pre>
|
19
22
|
</body>
|
20
23
|
</html>
|
@@ -5,24 +5,16 @@
|
|
5
5
|
|
6
6
|
<html>
|
7
7
|
<head>
|
8
|
-
<title>
|
8
|
+
<title>delete (Cachetastic::Caches::Base)</title>
|
9
9
|
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
10
10
|
<link rel="stylesheet" href="../../../.././rdoc-style.css" type="text/css" media="screen" />
|
11
11
|
</head>
|
12
12
|
<body class="standalone-code">
|
13
|
-
<pre><span class="ruby-comment cmt"># File lib/caches/cachetastic_caches_base.rb, line
|
14
|
-
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">
|
15
|
-
<span class="ruby-identifier">
|
16
|
-
|
17
|
-
<span class="ruby-identifier">res</span> = <span class="ruby-identifier">store</span>.<span class="ruby-identifier">get</span>(<span class="ruby-identifier">key</span>.<span class="ruby-identifier">to_s</span>)
|
18
|
-
<span class="ruby-keyword kw">if</span> <span class="ruby-identifier">res</span>.<span class="ruby-identifier">nil?</span>
|
19
|
-
<span class="ruby-identifier">res</span> = <span class="ruby-keyword kw">yield</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">block_given?</span>
|
20
|
-
<span class="ruby-keyword kw">else</span>
|
21
|
-
<span class="ruby-identifier">res</span> = <span class="ruby-identifier">unmarshall</span>(<span class="ruby-identifier">res</span>)
|
22
|
-
<span class="ruby-keyword kw">end</span>
|
23
|
-
<span class="ruby-identifier">res</span>
|
13
|
+
<pre><span class="ruby-comment cmt"># File lib/caches/cachetastic_caches_base.rb, line 93</span>
|
14
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">delete</span>(<span class="ruby-identifier">key</span>, <span class="ruby-identifier">delay</span> = <span class="ruby-value">0</span>)
|
15
|
+
<span class="ruby-identifier">do_with_logging</span>(<span class="ruby-identifier">:delete</span>, <span class="ruby-identifier">key</span>) <span class="ruby-keyword kw">do</span>
|
16
|
+
<span class="ruby-identifier">store</span>.<span class="ruby-identifier">delete</span>(<span class="ruby-identifier">key</span>.<span class="ruby-identifier">to_s</span>, <span class="ruby-identifier">delay</span>)
|
24
17
|
<span class="ruby-keyword kw">end</span>
|
25
|
-
<span class="ruby-identifier">res</span>
|
26
18
|
<span class="ruby-keyword kw">end</span></pre>
|
27
19
|
</body>
|
28
20
|
</html>
|
@@ -5,28 +5,15 @@
|
|
5
5
|
|
6
6
|
<html>
|
7
7
|
<head>
|
8
|
-
<title>
|
8
|
+
<title>expire_all (Cachetastic::Caches::Base)</title>
|
9
9
|
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
10
10
|
<link rel="stylesheet" href="../../../.././rdoc-style.css" type="text/css" media="screen" />
|
11
11
|
</head>
|
12
12
|
<body class="standalone-code">
|
13
|
-
<pre><span class="ruby-comment cmt"># File lib/caches/cachetastic_caches_base.rb, line
|
14
|
-
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">
|
15
|
-
<span class="ruby-identifier">
|
16
|
-
|
17
|
-
<span class="ruby-keyword kw">if</span> <span class="ruby-identifier">exp_swing</span>
|
18
|
-
<span class="ruby-identifier">swing</span> = <span class="ruby-identifier">rand</span>(<span class="ruby-identifier">exp_swing</span>.<span class="ruby-identifier">to_i</span>)
|
19
|
-
<span class="ruby-keyword kw">case</span> <span class="ruby-identifier">rand</span>(<span class="ruby-value">2</span>)
|
20
|
-
<span class="ruby-keyword kw">when</span> <span class="ruby-value">0</span>
|
21
|
-
<span class="ruby-identifier">expiry</span> = (<span class="ruby-identifier">expiry</span>.<span class="ruby-identifier">to_i</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">swing</span>)
|
22
|
-
<span class="ruby-keyword kw">when</span> <span class="ruby-value">1</span>
|
23
|
-
<span class="ruby-identifier">expiry</span> = (<span class="ruby-identifier">expiry</span>.<span class="ruby-identifier">to_i</span> <span class="ruby-operator">-</span> <span class="ruby-identifier">swing</span>)
|
24
|
-
<span class="ruby-keyword kw">end</span>
|
25
|
-
<span class="ruby-keyword kw">end</span>
|
26
|
-
<span class="ruby-identifier">store</span>.<span class="ruby-identifier">set</span>(<span class="ruby-identifier">key</span>.<span class="ruby-identifier">to_s</span>, <span class="ruby-identifier">marshall</span>(<span class="ruby-identifier">value</span>), <span class="ruby-identifier">expiry</span>.<span class="ruby-identifier">to_i</span>)
|
27
|
-
<span class="ruby-identifier">logger</span>.<span class="ruby-identifier">info</span>(<span class="ruby-value str">''</span>, <span class="ruby-value str">''</span>, <span class="ruby-identifier">:expiry</span>, <span class="ruby-identifier">cache_name</span>, <span class="ruby-identifier">key</span>, <span class="ruby-identifier">expiry</span>.<span class="ruby-identifier">to_i</span>)
|
28
|
-
<span class="ruby-identifier">value</span>
|
29
|
-
<span class="ruby-keyword kw">end</span>
|
13
|
+
<pre><span class="ruby-comment cmt"># File lib/caches/cachetastic_caches_base.rb, line 100</span>
|
14
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">expire_all</span>
|
15
|
+
<span class="ruby-identifier">store</span>.<span class="ruby-identifier">expire_all</span>
|
16
|
+
<span class="ruby-identifier">logger</span>.<span class="ruby-identifier">info</span>(<span class="ruby-value str">''</span>, <span class="ruby-value str">''</span>, <span class="ruby-identifier">:expired</span>, <span class="ruby-identifier">cache_name</span>)
|
30
17
|
<span class="ruby-keyword kw">end</span></pre>
|
31
18
|
</body>
|
32
19
|
</html>
|
@@ -5,16 +5,14 @@
|
|
5
5
|
|
6
6
|
<html>
|
7
7
|
<head>
|
8
|
-
<title>
|
8
|
+
<title>populate_all (Cachetastic::Caches::Base)</title>
|
9
9
|
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
10
10
|
<link rel="stylesheet" href="../../../.././rdoc-style.css" type="text/css" media="screen" />
|
11
11
|
</head>
|
12
12
|
<body class="standalone-code">
|
13
|
-
<pre><span class="ruby-comment cmt"># File lib/caches/cachetastic_caches_base.rb, line
|
14
|
-
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">
|
15
|
-
<span class="ruby-identifier">
|
16
|
-
<span class="ruby-identifier">store</span>.<span class="ruby-identifier">delete</span>(<span class="ruby-identifier">key</span>.<span class="ruby-identifier">to_s</span>, <span class="ruby-identifier">delay</span>)
|
17
|
-
<span class="ruby-keyword kw">end</span>
|
13
|
+
<pre><span class="ruby-comment cmt"># File lib/caches/cachetastic_caches_base.rb, line 108</span>
|
14
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">populate_all</span>
|
15
|
+
<span class="ruby-identifier">raise</span> <span class="ruby-constant">MethodNotImplemented</span>.<span class="ruby-identifier">new</span>(<span class="ruby-value str">"populate_all"</span>)
|
18
16
|
<span class="ruby-keyword kw">end</span></pre>
|
19
17
|
</body>
|
20
18
|
</html>
|
@@ -5,15 +5,14 @@
|
|
5
5
|
|
6
6
|
<html>
|
7
7
|
<head>
|
8
|
-
<title>
|
8
|
+
<title>stats (Cachetastic::Caches::Base)</title>
|
9
9
|
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
10
10
|
<link rel="stylesheet" href="../../../.././rdoc-style.css" type="text/css" media="screen" />
|
11
11
|
</head>
|
12
12
|
<body class="standalone-code">
|
13
|
-
<pre><span class="ruby-comment cmt"># File lib/caches/cachetastic_caches_base.rb, line
|
14
|
-
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">
|
15
|
-
<span class="ruby-identifier">store</span>.<span class="ruby-identifier">
|
16
|
-
<span class="ruby-identifier">logger</span>.<span class="ruby-identifier">info</span>(<span class="ruby-value str">''</span>, <span class="ruby-value str">''</span>, <span class="ruby-identifier">:expired</span>, <span class="ruby-identifier">cache_name</span>)
|
13
|
+
<pre><span class="ruby-comment cmt"># File lib/caches/cachetastic_caches_base.rb, line 113</span>
|
14
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">stats</span>
|
15
|
+
<span class="ruby-identifier">store</span>.<span class="ruby-identifier">stats</span>
|
17
16
|
<span class="ruby-keyword kw">end</span></pre>
|
18
17
|
</body>
|
19
18
|
</html>
|
@@ -5,14 +5,14 @@
|
|
5
5
|
|
6
6
|
<html>
|
7
7
|
<head>
|
8
|
-
<title>
|
8
|
+
<title>cache_name (Cachetastic::Caches::Base)</title>
|
9
9
|
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
10
10
|
<link rel="stylesheet" href="../../../.././rdoc-style.css" type="text/css" media="screen" />
|
11
11
|
</head>
|
12
12
|
<body class="standalone-code">
|
13
|
-
<pre><span class="ruby-comment cmt"># File lib/caches/cachetastic_caches_base.rb, line
|
14
|
-
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">
|
15
|
-
<span class="ruby-
|
13
|
+
<pre><span class="ruby-comment cmt"># File lib/caches/cachetastic_caches_base.rb, line 121</span>
|
14
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">cache_name</span>
|
15
|
+
<span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">name</span>.<span class="ruby-identifier">methodize</span>
|
16
16
|
<span class="ruby-keyword kw">end</span></pre>
|
17
17
|
</body>
|
18
18
|
</html>
|
@@ -5,14 +5,14 @@
|
|
5
5
|
|
6
6
|
<html>
|
7
7
|
<head>
|
8
|
-
<title>
|
8
|
+
<title>store (Cachetastic::Caches::Base)</title>
|
9
9
|
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
10
10
|
<link rel="stylesheet" href="../../../.././rdoc-style.css" type="text/css" media="screen" />
|
11
11
|
</head>
|
12
12
|
<body class="standalone-code">
|
13
|
-
<pre><span class="ruby-comment cmt"># File lib/caches/cachetastic_caches_base.rb, line
|
14
|
-
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">
|
15
|
-
<span class="ruby-identifier">
|
13
|
+
<pre><span class="ruby-comment cmt"># File lib/caches/cachetastic_caches_base.rb, line 126</span>
|
14
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">store</span>
|
15
|
+
<span class="ruby-identifier">cache_conn_instance</span>.<span class="ruby-identifier">get</span>(<span class="ruby-identifier">cache_name</span>)
|
16
16
|
<span class="ruby-keyword kw">end</span></pre>
|
17
17
|
</body>
|
18
18
|
</html>
|
@@ -5,14 +5,14 @@
|
|
5
5
|
|
6
6
|
<html>
|
7
7
|
<head>
|
8
|
-
<title>
|
8
|
+
<title>logger (Cachetastic::Caches::Base)</title>
|
9
9
|
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
10
10
|
<link rel="stylesheet" href="../../../.././rdoc-style.css" type="text/css" media="screen" />
|
11
11
|
</head>
|
12
12
|
<body class="standalone-code">
|
13
|
-
<pre><span class="ruby-comment cmt"># File lib/caches/cachetastic_caches_base.rb, line
|
14
|
-
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">
|
15
|
-
<span class="ruby-
|
13
|
+
<pre><span class="ruby-comment cmt"># File lib/caches/cachetastic_caches_base.rb, line 131</span>
|
14
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">logger</span>
|
15
|
+
<span class="ruby-identifier">store</span>.<span class="ruby-identifier">logger</span>
|
16
16
|
<span class="ruby-keyword kw">end</span></pre>
|
17
17
|
</body>
|
18
18
|
</html>
|
@@ -5,14 +5,24 @@
|
|
5
5
|
|
6
6
|
<html>
|
7
7
|
<head>
|
8
|
-
<title>
|
8
|
+
<title>calculate_expiry_time (Cachetastic::Caches::Base)</title>
|
9
9
|
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
10
10
|
<link rel="stylesheet" href="../../../.././rdoc-style.css" type="text/css" media="screen" />
|
11
11
|
</head>
|
12
12
|
<body class="standalone-code">
|
13
|
-
<pre><span class="ruby-comment cmt"># File lib/caches/cachetastic_caches_base.rb, line
|
14
|
-
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">
|
15
|
-
<span class="ruby-identifier">
|
13
|
+
<pre><span class="ruby-comment cmt"># File lib/caches/cachetastic_caches_base.rb, line 138</span>
|
14
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">calculate_expiry_time</span>(<span class="ruby-identifier">expiry</span>) <span class="ruby-comment cmt"># :doc:</span>
|
15
|
+
<span class="ruby-identifier">exp_swing</span> = <span class="ruby-identifier">store</span>.<span class="ruby-identifier">all_options</span>[<span class="ruby-value str">"expiry_swing"</span>]
|
16
|
+
<span class="ruby-keyword kw">if</span> <span class="ruby-identifier">exp_swing</span>
|
17
|
+
<span class="ruby-identifier">swing</span> = <span class="ruby-identifier">rand</span>(<span class="ruby-identifier">exp_swing</span>.<span class="ruby-identifier">to_i</span>)
|
18
|
+
<span class="ruby-keyword kw">case</span> <span class="ruby-identifier">rand</span>(<span class="ruby-value">2</span>)
|
19
|
+
<span class="ruby-keyword kw">when</span> <span class="ruby-value">0</span>
|
20
|
+
<span class="ruby-identifier">expiry</span> = (<span class="ruby-identifier">expiry</span>.<span class="ruby-identifier">to_i</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">swing</span>)
|
21
|
+
<span class="ruby-keyword kw">when</span> <span class="ruby-value">1</span>
|
22
|
+
<span class="ruby-identifier">expiry</span> = (<span class="ruby-identifier">expiry</span>.<span class="ruby-identifier">to_i</span> <span class="ruby-operator">-</span> <span class="ruby-identifier">swing</span>)
|
23
|
+
<span class="ruby-keyword kw">end</span>
|
24
|
+
<span class="ruby-keyword kw">end</span>
|
25
|
+
<span class="ruby-identifier">expiry</span>
|
16
26
|
<span class="ruby-keyword kw">end</span></pre>
|
17
27
|
</body>
|
18
28
|
</html>
|
@@ -80,6 +80,14 @@
|
|
80
80
|
|
81
81
|
<div id="contextContent">
|
82
82
|
|
83
|
+
<div id="description">
|
84
|
+
<p>
|
85
|
+
Used by the Mongrel Page Cache Handler gem for page caching. Future
|
86
|
+
functionality may be added to this class to allow for things such as
|
87
|
+
deleting a certain page/set of pages based on regex, etc…
|
88
|
+
</p>
|
89
|
+
|
90
|
+
</div>
|
83
91
|
|
84
92
|
|
85
93
|
</div>
|
@@ -92,8 +92,8 @@ This class caches store objects for each cache in the system.
|
|
92
92
|
<h3 class="section-bar">Methods</h3>
|
93
93
|
|
94
94
|
<div class="name-list">
|
95
|
-
<a href="#
|
96
|
-
<a href="#
|
95
|
+
<a href="#M000045">get</a>
|
96
|
+
<a href="#M000044">new</a>
|
97
97
|
</div>
|
98
98
|
</div>
|
99
99
|
|
@@ -135,12 +135,12 @@ This class caches store objects for each cache in the system.
|
|
135
135
|
<div id="methods">
|
136
136
|
<h3 class="section-bar">Public Class methods</h3>
|
137
137
|
|
138
|
-
<div id="method-
|
139
|
-
<a name="
|
138
|
+
<div id="method-M000044" class="method-detail">
|
139
|
+
<a name="M000044"></a>
|
140
140
|
|
141
141
|
<div class="method-heading">
|
142
|
-
<a href="Connection.src/
|
143
|
-
onclick="popupCode('Connection.src/
|
142
|
+
<a href="Connection.src/M000044.html" target="Code" class="method-signature"
|
143
|
+
onclick="popupCode('Connection.src/M000044.html');return false;">
|
144
144
|
<span class="method-name">new</span><span class="method-args">()</span>
|
145
145
|
</a>
|
146
146
|
</div>
|
@@ -151,22 +151,22 @@ This class caches store objects for each cache in the system.
|
|
151
151
|
|
152
152
|
<h3 class="section-bar">Public Instance methods</h3>
|
153
153
|
|
154
|
-
<div id="method-
|
155
|
-
<a name="
|
154
|
+
<div id="method-M000045" class="method-detail">
|
155
|
+
<a name="M000045"></a>
|
156
156
|
|
157
157
|
<div class="method-heading">
|
158
|
-
<a href="Connection.src/
|
159
|
-
onclick="popupCode('Connection.src/
|
158
|
+
<a href="Connection.src/M000045.html" target="Code" class="method-signature"
|
159
|
+
onclick="popupCode('Connection.src/M000045.html');return false;">
|
160
160
|
<span class="method-name">get</span><span class="method-args">(name)</span>
|
161
161
|
</a>
|
162
162
|
</div>
|
163
163
|
|
164
164
|
<div class="method-description">
|
165
165
|
<p>
|
166
|
-
Takes the name of the cache and returns back
|
167
|
-
with the cache. If the store object
|
168
|
-
no longer valid a <a
|
169
|
-
and returned.
|
166
|
+
Takes the name of the cache, that‘s been methodized, and returns back
|
167
|
+
the store object associated with the cache. If the store object
|
168
|
+
doesn‘t exist or if the store is no longer valid (store.valid?) a <a
|
169
|
+
href="Connection.html#M000044">new</a> one is created and returned.
|
170
170
|
</p>
|
171
171
|
</div>
|
172
172
|
</div>
|
@@ -0,0 +1,18 @@
|
|
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>new (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 7</span>
|
14
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>
|
15
|
+
<span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">connections</span> = {}
|
16
|
+
<span class="ruby-keyword kw">end</span></pre>
|
17
|
+
</body>
|
18
|
+
</html>
|
@@ -5,14 +5,20 @@
|
|
5
5
|
|
6
6
|
<html>
|
7
7
|
<head>
|
8
|
-
<title>
|
8
|
+
<title>get (Cachetastic::Connection)</title>
|
9
9
|
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
10
10
|
<link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
|
11
11
|
</head>
|
12
12
|
<body class="standalone-code">
|
13
|
-
<pre><span class="ruby-comment cmt"># File lib/cachetastic_connection.rb, line
|
14
|
-
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">
|
15
|
-
<span class="ruby-
|
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>
|
16
22
|
<span class="ruby-keyword kw">end</span></pre>
|
17
23
|
</body>
|
18
24
|
</html>
|
@@ -92,7 +92,7 @@ This class handles logging for the caches and their stores.
|
|
92
92
|
<h3 class="section-bar">Methods</h3>
|
93
93
|
|
94
94
|
<div class="name-list">
|
95
|
-
<a href="#
|
95
|
+
<a href="#M000046">new</a>
|
96
96
|
</div>
|
97
97
|
</div>
|
98
98
|
|
@@ -145,12 +145,12 @@ This class handles logging for the caches and their stores.
|
|
145
145
|
<div id="methods">
|
146
146
|
<h3 class="section-bar">Public Class methods</h3>
|
147
147
|
|
148
|
-
<div id="method-
|
149
|
-
<a name="
|
148
|
+
<div id="method-M000046" class="method-detail">
|
149
|
+
<a name="M000046"></a>
|
150
150
|
|
151
151
|
<div class="method-heading">
|
152
|
-
<a href="Logger.src/
|
153
|
-
onclick="popupCode('Logger.src/
|
152
|
+
<a href="Logger.src/M000046.html" target="Code" class="method-signature"
|
153
|
+
onclick="popupCode('Logger.src/M000046.html');return false;">
|
154
154
|
<span class="method-name">new</span><span class="method-args">(options, cache_name)</span>
|
155
155
|
</a>
|
156
156
|
</div>
|
@@ -78,6 +78,44 @@
|
|
78
78
|
|
79
79
|
<div id="contextContent">
|
80
80
|
|
81
|
+
<div id="description">
|
82
|
+
<p>
|
83
|
+
This class is the interface used to develop stores for caches. Stores are
|
84
|
+
where the data is actually held. These could be local memory, memcached, a
|
85
|
+
database, the file system, etc… If you implement this API, then you
|
86
|
+
should be able to plug in different stores for your caches without having
|
87
|
+
to change any of your code.
|
88
|
+
</p>
|
89
|
+
<h3>Methods that need to be implemented:</h3>
|
90
|
+
<ul>
|
91
|
+
<li>setup - used to setup the implementation of the store.
|
92
|
+
|
93
|
+
</li>
|
94
|
+
<li>set(key, object, expiry) - sets an object into the store using the given
|
95
|
+
key and the expiry time.
|
96
|
+
|
97
|
+
</li>
|
98
|
+
<li>get(key) - returns an object from the store for a given key.
|
99
|
+
|
100
|
+
</li>
|
101
|
+
<li>delete(key, delay) - deletes an object from the store for a given key. If
|
102
|
+
the store supports it, a delay can be used.
|
103
|
+
|
104
|
+
</li>
|
105
|
+
<li>expire_all - expires all objects in the store for a given cache.
|
106
|
+
|
107
|
+
</li>
|
108
|
+
<li>stats - returns statistics for the store.
|
109
|
+
|
110
|
+
</li>
|
111
|
+
<li>valid? - used to test whether or not the store is still valid. If this
|
112
|
+
returns false a <a href="Base.html#M000023">new</a> instance of the store
|
113
|
+
is created by <a href="../Connection.html">Cachetastic::Connection</a>
|
114
|
+
|
115
|
+
</li>
|
116
|
+
</ul>
|
117
|
+
|
118
|
+
</div>
|
81
119
|
|
82
120
|
|
83
121
|
</div>
|
@@ -86,11 +124,9 @@
|
|
86
124
|
<h3 class="section-bar">Methods</h3>
|
87
125
|
|
88
126
|
<div class="name-list">
|
89
|
-
<a href="#
|
90
|
-
<a href="#
|
91
|
-
<a href="#
|
92
|
-
<a href="#M000028">new</a>
|
93
|
-
<a href="#M000029">valid?</a>
|
127
|
+
<a href="#M000024">debug?</a>
|
128
|
+
<a href="#M000025">get_options</a>
|
129
|
+
<a href="#M000023">new</a>
|
94
130
|
</div>
|
95
131
|
</div>
|
96
132
|
|
@@ -150,26 +186,36 @@
|
|
150
186
|
<div id="methods">
|
151
187
|
<h3 class="section-bar">Public Class methods</h3>
|
152
188
|
|
153
|
-
<div id="method-
|
154
|
-
<a name="
|
189
|
+
<div id="method-M000025" class="method-detail">
|
190
|
+
<a name="M000025"></a>
|
155
191
|
|
156
192
|
<div class="method-heading">
|
157
|
-
<a href="Base.src/
|
158
|
-
onclick="popupCode('Base.src/
|
193
|
+
<a href="Base.src/M000025.html" target="Code" class="method-signature"
|
194
|
+
onclick="popupCode('Base.src/M000025.html');return false;">
|
159
195
|
<span class="method-name">get_options</span><span class="method-args">(name)</span>
|
160
196
|
</a>
|
161
197
|
</div>
|
162
198
|
|
163
199
|
<div class="method-description">
|
200
|
+
<p>
|
201
|
+
Merges options for the store in the configuration file with the
|
202
|
+
cachetastic_default_options found in the configuration file, and returns
|
203
|
+
the results. Options need to be specified in the configuration file as the
|
204
|
+
methodized name of the store with _options attached at the end. Examples:
|
205
|
+
</p>
|
206
|
+
<pre>
|
207
|
+
Cachetastic::Caches::PageCache # => cachetastic_caches_page_cache_options
|
208
|
+
MyAwesomeCache # => my_awesome_cache_options
|
209
|
+
</pre>
|
164
210
|
</div>
|
165
211
|
</div>
|
166
212
|
|
167
|
-
<div id="method-
|
168
|
-
<a name="
|
213
|
+
<div id="method-M000023" class="method-detail">
|
214
|
+
<a name="M000023"></a>
|
169
215
|
|
170
216
|
<div class="method-heading">
|
171
|
-
<a href="Base.src/
|
172
|
-
onclick="popupCode('Base.src/
|
217
|
+
<a href="Base.src/M000023.html" target="Code" class="method-signature"
|
218
|
+
onclick="popupCode('Base.src/M000023.html');return false;">
|
173
219
|
<span class="method-name">new</span><span class="method-args">(name)</span>
|
174
220
|
</a>
|
175
221
|
</div>
|
@@ -180,45 +226,22 @@
|
|
180
226
|
|
181
227
|
<h3 class="section-bar">Public Instance methods</h3>
|
182
228
|
|
183
|
-
<div id="method-
|
184
|
-
<a name="
|
185
|
-
|
186
|
-
<div class="method-heading">
|
187
|
-
<a href="Base.src/M000031.html" target="Code" class="method-signature"
|
188
|
-
onclick="popupCode('Base.src/M000031.html');return false;">
|
189
|
-
<span class="method-name">configure</span><span class="method-args">()</span>
|
190
|
-
</a>
|
191
|
-
</div>
|
192
|
-
|
193
|
-
<div class="method-description">
|
194
|
-
</div>
|
195
|
-
</div>
|
196
|
-
|
197
|
-
<div id="method-M000030" class="method-detail">
|
198
|
-
<a name="M000030"></a>
|
229
|
+
<div id="method-M000024" class="method-detail">
|
230
|
+
<a name="M000024"></a>
|
199
231
|
|
200
232
|
<div class="method-heading">
|
201
|
-
<a href="Base.src/
|
202
|
-
onclick="popupCode('Base.src/
|
233
|
+
<a href="Base.src/M000024.html" target="Code" class="method-signature"
|
234
|
+
onclick="popupCode('Base.src/M000024.html');return false;">
|
203
235
|
<span class="method-name">debug?</span><span class="method-args">()</span>
|
204
236
|
</a>
|
205
237
|
</div>
|
206
238
|
|
207
239
|
<div class="method-description">
|
208
|
-
|
209
|
-
|
210
|
-
|
211
|
-
|
212
|
-
|
213
|
-
|
214
|
-
<div class="method-heading">
|
215
|
-
<a href="Base.src/M000029.html" target="Code" class="method-signature"
|
216
|
-
onclick="popupCode('Base.src/M000029.html');return false;">
|
217
|
-
<span class="method-name">valid?</span><span class="method-args">()</span>
|
218
|
-
</a>
|
219
|
-
</div>
|
220
|
-
|
221
|
-
<div class="method-description">
|
240
|
+
<p>
|
241
|
+
Returns true/or falsed based on whether or not the debug setting is set to
|
242
|
+
true in the configuration file. If the config setting is set, then false is
|
243
|
+
returned.
|
244
|
+
</p>
|
222
245
|
</div>
|
223
246
|
</div>
|
224
247
|
|
@@ -10,7 +10,7 @@
|
|
10
10
|
<link rel="stylesheet" href="../../../.././rdoc-style.css" type="text/css" media="screen" />
|
11
11
|
</head>
|
12
12
|
<body class="standalone-code">
|
13
|
-
<pre><span class="ruby-comment cmt"># File lib/stores/cachetastic_stores_base.rb, line
|
13
|
+
<pre><span class="ruby-comment cmt"># File lib/stores/cachetastic_stores_base.rb, line 24</span>
|
14
14
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">name</span>)
|
15
15
|
<span class="ruby-ivar">@name</span> = <span class="ruby-identifier">name</span>
|
16
16
|
<span class="ruby-identifier">configure</span>
|