cachetastic 1.1.3 → 1.1.8

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.
Files changed (110) hide show
  1. data/README +3 -1
  2. data/doc/classes/ActiveRecord/Base.html +22 -2
  3. data/doc/classes/ActiveRecord/Base.src/M000001.html +1 -1
  4. data/doc/classes/ActiveRecord/Base.src/M000002.html +1 -1
  5. data/doc/classes/ActiveRecord/Base.src/M000003.html +1 -1
  6. data/doc/classes/ActiveRecord/Base.src/M000004.html +1 -1
  7. data/doc/classes/ActiveRecord/Base.src/M000005.html +1 -1
  8. data/doc/classes/{Cachetastic/Stores.html → CGI/Session/CachetasticStore.html} +23 -14
  9. data/doc/classes/Cachetastic/Caches/Base/RegisteredCaches.html +17 -6
  10. data/doc/classes/Cachetastic/Caches/Base/RegisteredCaches.src/{M000044.html → M000043.html} +1 -1
  11. data/doc/classes/Cachetastic/Caches/Base.html +148 -54
  12. data/doc/classes/Cachetastic/Caches/Base.src/{M000043.html → M000032.html} +4 -4
  13. data/doc/classes/Cachetastic/Caches/Base.src/M000033.html +14 -4
  14. data/doc/classes/Cachetastic/Caches/Base.src/M000034.html +9 -6
  15. data/doc/classes/Cachetastic/Caches/Base.src/M000035.html +5 -13
  16. data/doc/classes/Cachetastic/Caches/Base.src/M000036.html +5 -18
  17. data/doc/classes/Cachetastic/Caches/Base.src/M000037.html +4 -6
  18. data/doc/classes/Cachetastic/Caches/Base.src/M000038.html +4 -5
  19. data/doc/classes/Cachetastic/Caches/Base.src/M000039.html +4 -4
  20. data/doc/classes/Cachetastic/Caches/Base.src/M000040.html +4 -4
  21. data/doc/classes/Cachetastic/Caches/Base.src/M000041.html +4 -4
  22. data/doc/classes/Cachetastic/Caches/Base.src/M000042.html +14 -4
  23. data/doc/classes/Cachetastic/Caches/PageCache.html +8 -0
  24. data/doc/classes/Cachetastic/Caches/RailsSessionCache.html +6 -0
  25. data/doc/classes/Cachetastic/Connection.html +14 -14
  26. data/doc/classes/Cachetastic/Connection.src/M000044.html +18 -0
  27. data/doc/classes/Cachetastic/Connection.src/M000045.html +10 -4
  28. data/doc/classes/Cachetastic/Logger.html +5 -5
  29. data/doc/classes/Cachetastic/Stores/Base.html +68 -45
  30. data/doc/classes/Cachetastic/Stores/Base.src/{M000028.html → M000023.html} +1 -1
  31. data/doc/classes/Cachetastic/Stores/Base.src/{M000030.html → M000024.html} +1 -1
  32. data/doc/classes/Cachetastic/Stores/Base.src/{M000032.html → M000025.html} +1 -1
  33. data/doc/classes/Cachetastic/Stores/File.html +265 -0
  34. data/doc/classes/Cachetastic/Stores/File.src/M000026.html +18 -0
  35. data/doc/classes/Cachetastic/Stores/File.src/M000027.html +20 -0
  36. data/doc/classes/Cachetastic/Stores/File.src/M000028.html +19 -0
  37. data/doc/classes/Cachetastic/Stores/File.src/M000029.html +33 -0
  38. data/doc/classes/Cachetastic/Stores/File.src/M000030.html +21 -0
  39. data/doc/classes/Cachetastic/Stores/{LocalMemory.src/M000025.html → File.src/M000031.html} +3 -3
  40. data/doc/classes/Cachetastic/Stores/LocalMemory.html +41 -36
  41. data/doc/classes/Cachetastic/Stores/{Base.src/M000029.html → LocalMemory.src/M000017.html} +3 -3
  42. data/doc/classes/Cachetastic/Stores/LocalMemory.src/M000018.html +18 -0
  43. data/doc/classes/Cachetastic/Stores/LocalMemory.src/M000019.html +18 -0
  44. data/doc/classes/Cachetastic/Stores/LocalMemory.src/M000020.html +12 -4
  45. data/doc/classes/Cachetastic/Stores/LocalMemory.src/M000021.html +4 -4
  46. data/doc/classes/Cachetastic/Stores/LocalMemory.src/M000022.html +11 -4
  47. data/doc/classes/Cachetastic/Stores/Memcache.html +85 -59
  48. data/doc/classes/Cachetastic/Stores/Memcache.src/M000006.html +19 -0
  49. data/doc/classes/Cachetastic/Stores/{LocalMemory.src/M000024.html → Memcache.src/M000007.html} +3 -3
  50. data/doc/classes/Cachetastic/Stores/Memcache.src/M000008.html +18 -0
  51. data/doc/classes/Cachetastic/Stores/Memcache.src/M000009.html +4 -5
  52. data/doc/classes/Cachetastic/Stores/Memcache.src/M000010.html +4 -4
  53. data/doc/classes/Cachetastic/Stores/Memcache.src/M000011.html +4 -4
  54. data/doc/classes/Cachetastic/Stores/Memcache.src/M000012.html +10 -4
  55. data/doc/classes/Cachetastic/Stores/Memcache.src/M000013.html +5 -4
  56. data/doc/classes/Cachetastic/Stores/Memcache.src/M000014.html +6 -4
  57. data/doc/classes/Cachetastic/Stores/Memcache.src/M000015.html +6 -5
  58. data/doc/classes/Cachetastic/Stores/Memcache.src/M000016.html +9 -9
  59. data/doc/created.rid +1 -1
  60. data/doc/files/init_rb.html +111 -1
  61. data/doc/files/lib/caches/cachetastic_caches_base_rb.html +1 -1
  62. data/doc/files/lib/caches/cachetastic_caches_page_cache_rb.html +9 -1
  63. data/doc/files/lib/caches/cachetastic_caches_rails_session_cache_rb.html +7 -1
  64. data/doc/files/lib/cachetastic_connection_rb.html +1 -1
  65. data/doc/files/lib/cachetastic_rb.html +6 -2
  66. data/doc/files/lib/helpers/cachetastic_helpers_active_record_rb.html +1 -1
  67. data/doc/files/lib/rails_extensions/cachetastic_active_record_base_rb.html +1 -1
  68. data/doc/files/lib/rails_extensions/cgi_session_cachetastic_store_rb.html +1 -1
  69. data/doc/files/lib/stores/cachetastic_stores_base_rb.html +39 -1
  70. data/doc/{classes/ActiveRecord.html → files/lib/stores/cachetastic_stores_file_rb.html} +36 -22
  71. data/doc/files/lib/stores/cachetastic_stores_local_memory_rb.html +9 -1
  72. data/doc/files/lib/stores/cachetastic_stores_memcache_rb.html +27 -1
  73. data/doc/{classes/Cachetastic/Caches/ActiveRecord.html → files/lib/stores/cachetastic_stores_store_object_rb.html} +15 -19
  74. data/doc/fr_class_index.html +2 -8
  75. data/doc/fr_file_index.html +2 -0
  76. data/doc/fr_method_index.html +41 -42
  77. data/doc/index.html +2 -2
  78. data/init.rb +1 -0
  79. data/lib/caches/cachetastic_caches_base.rb +81 -18
  80. data/lib/caches/cachetastic_caches_page_cache.rb +4 -0
  81. data/lib/caches/cachetastic_caches_rails_session_cache.rb +1 -0
  82. data/lib/cachetastic.rb +10 -6
  83. data/lib/cachetastic_connection.rb +2 -2
  84. data/lib/helpers/cachetastic_helpers_active_record.rb +12 -1
  85. data/lib/rails_extensions/cachetastic_active_record_base.rb +10 -0
  86. data/lib/rails_extensions/cgi_session_cachetastic_store.rb +15 -10
  87. data/lib/stores/cachetastic_stores_base.rb +33 -13
  88. data/lib/stores/cachetastic_stores_file.rb +101 -0
  89. data/lib/stores/cachetastic_stores_local_memory.rb +6 -27
  90. data/lib/stores/cachetastic_stores_memcache.rb +24 -5
  91. data/lib/stores/cachetastic_stores_store_object.rb +28 -0
  92. data/lib/tasks/rubyforge_config.yml +1 -1
  93. metadata +28 -32
  94. data/doc/classes/Cachetastic/Caches.html +0 -114
  95. data/doc/classes/Cachetastic/Connection.src/M000046.html +0 -24
  96. data/doc/classes/Cachetastic/Helpers/ActiveRecord.html +0 -165
  97. data/doc/classes/Cachetastic/Helpers/ActiveRecord.src/M000006.html +0 -29
  98. data/doc/classes/Cachetastic/Helpers/ActiveRecord.src/M000007.html +0 -23
  99. data/doc/classes/Cachetastic/Helpers/ActiveRecord.src/M000008.html +0 -18
  100. data/doc/classes/Cachetastic/Helpers.html +0 -115
  101. data/doc/classes/Cachetastic/Stores/Base.src/M000031.html +0 -22
  102. data/doc/classes/Cachetastic/Stores/LocalMemory/StoreObject.html +0 -177
  103. data/doc/classes/Cachetastic/Stores/LocalMemory/StoreObject.src/M000026.html +0 -27
  104. data/doc/classes/Cachetastic/Stores/LocalMemory/StoreObject.src/M000027.html +0 -19
  105. data/doc/classes/Cachetastic/Stores/LocalMemory.src/M000023.html +0 -26
  106. data/doc/classes/Cachetastic/Stores/Memcache.src/M000017.html +0 -20
  107. data/doc/classes/Cachetastic/Stores/Memcache.src/M000018.html +0 -20
  108. data/doc/classes/Cachetastic/Stores/Memcache.src/M000019.html +0 -24
  109. data/doc/classes/Cachetastic.html +0 -119
  110. /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>all_registered_caches (Cachetastic::Caches::Base)</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 19</span>
14
- <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">all_registered_caches</span>
15
- <span class="ruby-constant">RegisteredCaches</span>.<span class="ruby-identifier">instance</span>.<span class="ruby-identifier">list</span>
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>inherited (Cachetastic::Caches::Base)</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 23</span>
14
- <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">inherited</span>(<span class="ruby-identifier">child</span>)
15
- <span class="ruby-comment cmt"># puts &quot;child: #{child.inspect}&quot;</span>
16
- <span class="ruby-identifier">all_registered_caches</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">child</span>.<span class="ruby-identifier">to_s</span>
17
- <span class="ruby-comment cmt"># puts &quot;all_registered_caches: #{all_registered_caches.inspect}&quot;</span>
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">&quot;default_expiry&quot;</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>get (Cachetastic::Caches::Base)</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 29</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-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>set (Cachetastic::Caches::Base)</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 43</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">&quot;default_expiry&quot;</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">exp_swing</span> = <span class="ruby-identifier">store</span>.<span class="ruby-identifier">all_options</span>[<span class="ruby-value str">&quot;expiry_swing&quot;</span>]
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>delete (Cachetastic::Caches::Base)</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 63</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>)
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">&quot;populate_all&quot;</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>expire_all (Cachetastic::Caches::Base)</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 69</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>)
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>populate_all (Cachetastic::Caches::Base)</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 74</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">&quot;populate_all&quot;</span>)
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>stats (Cachetastic::Caches::Base)</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 78</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>
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>cache_name (Cachetastic::Caches::Base)</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 82</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>
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>store (Cachetastic::Caches::Base)</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 86</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>)
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">&quot;expiry_swing&quot;</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&#8230;
88
+ </p>
89
+
90
+ </div>
83
91
 
84
92
 
85
93
  </div>
@@ -80,6 +80,12 @@
80
80
 
81
81
  <div id="contextContent">
82
82
 
83
+ <div id="description">
84
+ <p>
85
+ Used for storing Rails sessions.
86
+ </p>
87
+
88
+ </div>
83
89
 
84
90
 
85
91
  </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="#M000046">get</a>&nbsp;&nbsp;
96
- <a href="#M000045">new</a>&nbsp;&nbsp;
95
+ <a href="#M000045">get</a>&nbsp;&nbsp;
96
+ <a href="#M000044">new</a>&nbsp;&nbsp;
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-M000045" class="method-detail">
139
- <a name="M000045"></a>
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/M000045.html" target="Code" class="method-signature"
143
- onclick="popupCode('Connection.src/M000045.html');return false;">
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-M000046" class="method-detail">
155
- <a name="M000046"></a>
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/M000046.html" target="Code" class="method-signature"
159
- onclick="popupCode('Connection.src/M000046.html');return false;">
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 the store object associated
167
- with the cache. If the store object doesn&#8216;t exist of the the store is
168
- no longer valid a <a href="Connection.html#M000045">new</a> one is created
169
- and returned.
166
+ Takes the name of the cache, that&#8216;s been methodized, and returns back
167
+ the store object associated with the cache. If the store object
168
+ doesn&#8216;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>new (Cachetastic::Connection)</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 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> = {}
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">&amp;&amp;</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">&quot;store&quot;</span>].<span class="ruby-identifier">camelcase</span>
19
+ <span class="ruby-identifier">conn</span> = <span class="ruby-node">&quot;Cachetastic::Stores::#{store}&quot;</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="#M000047">new</a>&nbsp;&nbsp;
95
+ <a href="#M000046">new</a>&nbsp;&nbsp;
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-M000047" class="method-detail">
149
- <a name="M000047"></a>
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/M000047.html" target="Code" class="method-signature"
153
- onclick="popupCode('Logger.src/M000047.html');return false;">
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&#8230; 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="#M000031">configure</a>&nbsp;&nbsp;
90
- <a href="#M000030">debug?</a>&nbsp;&nbsp;
91
- <a href="#M000032">get_options</a>&nbsp;&nbsp;
92
- <a href="#M000028">new</a>&nbsp;&nbsp;
93
- <a href="#M000029">valid?</a>&nbsp;&nbsp;
127
+ <a href="#M000024">debug?</a>&nbsp;&nbsp;
128
+ <a href="#M000025">get_options</a>&nbsp;&nbsp;
129
+ <a href="#M000023">new</a>&nbsp;&nbsp;
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-M000032" class="method-detail">
154
- <a name="M000032"></a>
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/M000032.html" target="Code" class="method-signature"
158
- onclick="popupCode('Base.src/M000032.html');return false;">
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 # =&gt; cachetastic_caches_page_cache_options
208
+ MyAwesomeCache # =&gt; my_awesome_cache_options
209
+ </pre>
164
210
  </div>
165
211
  </div>
166
212
 
167
- <div id="method-M000028" class="method-detail">
168
- <a name="M000028"></a>
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/M000028.html" target="Code" class="method-signature"
172
- onclick="popupCode('Base.src/M000028.html');return false;">
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-M000031" class="method-detail">
184
- <a name="M000031"></a>
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/M000030.html" target="Code" class="method-signature"
202
- onclick="popupCode('Base.src/M000030.html');return false;">
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
- </div>
209
- </div>
210
-
211
- <div id="method-M000029" class="method-detail">
212
- <a name="M000029"></a>
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 10</span>
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>