cachetastic 1.1.8 → 1.2.1
Sign up to get free protection for your applications and to get access to all the features.
- data/README +3 -3
- data/doc/classes/Cachetastic/{Stores → Adapters}/Base.html +8 -8
- data/doc/classes/Cachetastic/{Stores → Adapters}/Base.src/M000023.html +2 -2
- data/doc/classes/Cachetastic/{Stores → Adapters}/Base.src/M000024.html +2 -2
- data/doc/classes/Cachetastic/{Stores → Adapters}/Base.src/M000025.html +4 -4
- data/doc/classes/Cachetastic/{Stores → Adapters}/File.html +7 -7
- data/doc/classes/Cachetastic/{Stores → Adapters}/File.src/M000026.html +2 -2
- data/doc/classes/Cachetastic/{Stores → Adapters}/File.src/M000027.html +2 -2
- data/doc/classes/Cachetastic/{Stores → Adapters}/File.src/M000028.html +2 -2
- data/doc/classes/Cachetastic/{Stores → Adapters}/File.src/M000029.html +2 -2
- data/doc/classes/Cachetastic/{Stores → Adapters}/File.src/M000030.html +3 -3
- data/doc/classes/Cachetastic/{Stores → Adapters}/File.src/M000031.html +2 -2
- data/doc/classes/Cachetastic/{Stores → Adapters}/LocalMemory.html +8 -8
- data/doc/classes/Cachetastic/{Stores → Adapters}/LocalMemory.src/M000017.html +2 -2
- data/doc/classes/Cachetastic/{Stores → Adapters}/LocalMemory.src/M000018.html +2 -2
- data/doc/classes/Cachetastic/{Stores → Adapters}/LocalMemory.src/M000019.html +2 -2
- data/doc/classes/Cachetastic/{Stores → Adapters}/LocalMemory.src/M000020.html +2 -2
- data/doc/classes/Cachetastic/{Stores → Adapters}/LocalMemory.src/M000021.html +3 -3
- data/doc/classes/Cachetastic/{Stores → Adapters}/LocalMemory.src/M000022.html +2 -2
- data/doc/classes/Cachetastic/{Stores → Adapters}/Memcache.html +8 -8
- data/doc/classes/Cachetastic/{Stores → Adapters}/Memcache.src/M000006.html +2 -2
- data/doc/classes/Cachetastic/{Stores → Adapters}/Memcache.src/M000007.html +2 -2
- data/doc/classes/Cachetastic/{Stores → Adapters}/Memcache.src/M000008.html +2 -2
- data/doc/classes/Cachetastic/{Stores → Adapters}/Memcache.src/M000009.html +2 -2
- data/doc/classes/Cachetastic/{Stores → Adapters}/Memcache.src/M000010.html +2 -2
- data/doc/classes/Cachetastic/{Stores → Adapters}/Memcache.src/M000011.html +2 -2
- data/doc/classes/Cachetastic/{Stores → Adapters}/Memcache.src/M000012.html +2 -2
- data/doc/classes/Cachetastic/{Stores → Adapters}/Memcache.src/M000013.html +2 -2
- data/doc/classes/Cachetastic/{Stores → Adapters}/Memcache.src/M000014.html +2 -2
- data/doc/classes/Cachetastic/{Stores → Adapters}/Memcache.src/M000015.html +2 -2
- data/doc/classes/Cachetastic/{Stores → Adapters}/Memcache.src/M000016.html +2 -2
- data/doc/classes/Cachetastic/Caches/Base.html +23 -22
- data/doc/classes/Cachetastic/Caches/Base.src/M000033.html +21 -6
- data/doc/classes/Cachetastic/Caches/Base.src/M000034.html +3 -3
- data/doc/classes/Cachetastic/Caches/Base.src/M000035.html +2 -2
- data/doc/classes/Cachetastic/Caches/Base.src/M000036.html +2 -2
- data/doc/classes/Cachetastic/Caches/Base.src/M000037.html +1 -1
- data/doc/classes/Cachetastic/Caches/Base.src/M000038.html +2 -2
- data/doc/classes/Cachetastic/Caches/Base.src/M000039.html +1 -1
- data/doc/classes/Cachetastic/Caches/Base.src/M000040.html +3 -3
- data/doc/classes/Cachetastic/Caches/Base.src/M000041.html +2 -2
- data/doc/classes/Cachetastic/Caches/Base.src/M000042.html +2 -2
- data/doc/classes/Cachetastic/Connection.html +4 -4
- data/doc/classes/Cachetastic/Connection.src/M000045.html +2 -2
- data/doc/classes/Cachetastic/Logger.html +1 -1
- data/doc/created.rid +1 -1
- data/doc/files/init_rb.html +3 -3
- data/doc/files/lib/{stores/cachetastic_stores_base_rb.html → adapters/cachetastic_adapters_base_rb.html} +7 -7
- data/doc/files/lib/{stores/cachetastic_stores_file_rb.html → adapters/cachetastic_adapters_file_rb.html} +6 -6
- data/doc/files/lib/{stores/cachetastic_stores_local_memory_rb.html → adapters/cachetastic_adapters_local_memory_rb.html} +6 -6
- data/doc/files/lib/{stores/cachetastic_stores_memcache_rb.html → adapters/cachetastic_adapters_memcache_rb.html} +7 -7
- data/doc/files/lib/{stores/cachetastic_stores_store_object_rb.html → adapters/cachetastic_adapters_store_object_rb.html} +4 -4
- data/doc/files/lib/caches/cachetastic_caches_base_rb.html +1 -1
- data/doc/files/lib/cachetastic_connection_rb.html +2 -2
- data/doc/files/lib/cachetastic_logger_rb.html +2 -2
- data/doc/files/lib/cachetastic_rb.html +9 -9
- data/doc/fr_class_index.html +4 -4
- data/doc/fr_file_index.html +5 -5
- data/doc/fr_method_index.html +29 -29
- data/lib/{stores/cachetastic_stores_base.rb → adapters/cachetastic_adapters_base.rb} +8 -8
- data/lib/{stores/cachetastic_stores_file.rb → adapters/cachetastic_adapters_file.rb} +4 -4
- data/lib/{stores/cachetastic_stores_local_memory.rb → adapters/cachetastic_adapters_local_memory.rb} +5 -5
- data/lib/{stores/cachetastic_stores_memcache.rb → adapters/cachetastic_adapters_memcache.rb} +3 -3
- data/lib/{stores/cachetastic_stores_store_object.rb → adapters/cachetastic_adapters_store_object.rb} +1 -1
- data/lib/caches/cachetastic_caches_base.rb +35 -20
- data/lib/cachetastic.rb +6 -6
- data/lib/cachetastic_connection.rb +5 -5
- data/lib/cachetastic_logger.rb +1 -1
- data/lib/tasks/rubyforge_config.yml +1 -1
- metadata +86 -79
data/README
CHANGED
@@ -10,8 +10,8 @@
|
|
10
10
|
# for each object returned from the cache
|
11
11
|
debug: true # true | false (default: false)
|
12
12
|
# this is the type of file store to be used for this cache.
|
13
|
-
# more
|
14
|
-
|
13
|
+
# more adapters can be developed and plugged in as desired
|
14
|
+
adapter: local_memory # local_memory | memcache | file (default: local_memory)
|
15
15
|
# this will marshall objects into and out of the store.
|
16
16
|
# so far yaml is the only supported marshall format.
|
17
17
|
marshall_method: none # none | yaml (default: none)
|
@@ -22,7 +22,7 @@
|
|
22
22
|
# objects will go into the cache with an expiry time sometime between 45 mins and 75 mins.
|
23
23
|
expiry_swing: <%= 15.minutes %> # time in seconds (default: 0)
|
24
24
|
# these options get passed on directly to the store.
|
25
|
-
# only the memcache
|
25
|
+
# only the memcache and file stores uses these options currently.
|
26
26
|
store_options: # listed below are options for memcache
|
27
27
|
c_threshold: 10_000
|
28
28
|
compression: true
|
@@ -5,7 +5,7 @@
|
|
5
5
|
|
6
6
|
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
7
7
|
<head>
|
8
|
-
<title>Class: Cachetastic::
|
8
|
+
<title>Class: Cachetastic::Adapters::Base</title>
|
9
9
|
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
10
10
|
<meta http-equiv="Content-Script-Type" content="text/javascript" />
|
11
11
|
<link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
|
@@ -50,13 +50,13 @@
|
|
50
50
|
<table class="header-table">
|
51
51
|
<tr class="top-aligned-row">
|
52
52
|
<td><strong>Class</strong></td>
|
53
|
-
<td class="class-name-in-header">Cachetastic::
|
53
|
+
<td class="class-name-in-header">Cachetastic::Adapters::Base</td>
|
54
54
|
</tr>
|
55
55
|
<tr class="top-aligned-row">
|
56
56
|
<td><strong>In:</strong></td>
|
57
57
|
<td>
|
58
|
-
<a href="../../../files/lib/
|
59
|
-
lib/
|
58
|
+
<a href="../../../files/lib/adapters/cachetastic_adapters_base_rb.html">
|
59
|
+
lib/adapters/cachetastic_adapters_base.rb
|
60
60
|
</a>
|
61
61
|
<br />
|
62
62
|
</td>
|
@@ -80,7 +80,7 @@
|
|
80
80
|
|
81
81
|
<div id="description">
|
82
82
|
<p>
|
83
|
-
This class is the interface used to develop
|
83
|
+
This class is the interface used to develop adapters for stores. Stores are
|
84
84
|
where the data is actually held. These could be local memory, memcached, a
|
85
85
|
database, the file system, etc… If you implement this API, then you
|
86
86
|
should be able to plug in different stores for your caches without having
|
@@ -88,7 +88,7 @@ to change any of your code.
|
|
88
88
|
</p>
|
89
89
|
<h3>Methods that need to be implemented:</h3>
|
90
90
|
<ul>
|
91
|
-
<li>setup - used to setup the implementation of the
|
91
|
+
<li>setup - used to setup the implementation of the adapter.
|
92
92
|
|
93
93
|
</li>
|
94
94
|
<li>set(key, object, expiry) - sets an object into the store using the given
|
@@ -109,7 +109,7 @@ the store supports it, a delay can be used.
|
|
109
109
|
|
110
110
|
</li>
|
111
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
|
112
|
+
returns false a <a href="Base.html#M000023">new</a> instance of the adapter
|
113
113
|
is created by <a href="../Connection.html">Cachetastic::Connection</a>
|
114
114
|
|
115
115
|
</li>
|
@@ -201,7 +201,7 @@ is created by <a href="../Connection.html">Cachetastic::Connection</a>
|
|
201
201
|
Merges options for the store in the configuration file with the
|
202
202
|
cachetastic_default_options found in the configuration file, and returns
|
203
203
|
the results. Options need to be specified in the configuration file as the
|
204
|
-
methodized name of the
|
204
|
+
methodized name of the cache with _options attached at the end. Examples:
|
205
205
|
</p>
|
206
206
|
<pre>
|
207
207
|
Cachetastic::Caches::PageCache # => cachetastic_caches_page_cache_options
|
@@ -5,12 +5,12 @@
|
|
5
5
|
|
6
6
|
<html>
|
7
7
|
<head>
|
8
|
-
<title>new (Cachetastic::
|
8
|
+
<title>new (Cachetastic::Adapters::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/
|
13
|
+
<pre><span class="ruby-comment cmt"># File lib/adapters/cachetastic_adapters_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>
|
@@ -5,12 +5,12 @@
|
|
5
5
|
|
6
6
|
<html>
|
7
7
|
<head>
|
8
|
-
<title>debug? (Cachetastic::
|
8
|
+
<title>debug? (Cachetastic::Adapters::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/
|
13
|
+
<pre><span class="ruby-comment cmt"># File lib/adapters/cachetastic_adapters_base.rb, line 42</span>
|
14
14
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">debug?</span>
|
15
15
|
<span class="ruby-identifier">ivar_cache</span>(<span class="ruby-identifier">:debug</span>) <span class="ruby-keyword kw">do</span>
|
16
16
|
(<span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">all_options</span>[<span class="ruby-value str">"debug"</span>] <span class="ruby-operator">==</span> <span class="ruby-keyword kw">true</span> <span class="ruby-operator">||</span> <span class="ruby-keyword kw">false</span>)
|
@@ -5,16 +5,16 @@
|
|
5
5
|
|
6
6
|
<html>
|
7
7
|
<head>
|
8
|
-
<title>get_options (Cachetastic::
|
8
|
+
<title>get_options (Cachetastic::Adapters::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/
|
13
|
+
<pre><span class="ruby-comment cmt"># File lib/adapters/cachetastic_adapters_base.rb, line 56</span>
|
14
14
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">get_options</span>(<span class="ruby-identifier">name</span>)
|
15
15
|
<span class="ruby-identifier">options</span> = <span class="ruby-identifier">app_config</span>.<span class="ruby-identifier">cachetastic_default_options</span>
|
16
|
-
<span class="ruby-identifier">options</span
|
17
|
-
<span class="ruby-identifier">options</span> =
|
16
|
+
<span class="ruby-identifier">options</span> = {<span class="ruby-value str">"adapter"</span> =<span class="ruby-operator">></span> <span class="ruby-value str">"local_memory"</span>}.<span class="ruby-identifier">merge</span>(<span class="ruby-identifier">options</span>)
|
17
|
+
<span class="ruby-identifier">options</span> = <span class="ruby-identifier">options</span>.<span class="ruby-identifier">merge</span>(<span class="ruby-identifier">app_config</span>.<span class="ruby-identifier">send</span>(<span class="ruby-identifier">name</span>.<span class="ruby-identifier">methodize</span> <span class="ruby-operator">+</span> <span class="ruby-value str">"_options"</span>) <span class="ruby-operator">||</span> {})
|
18
18
|
<span class="ruby-identifier">options</span>
|
19
19
|
<span class="ruby-keyword kw">end</span></pre>
|
20
20
|
</body>
|
@@ -5,7 +5,7 @@
|
|
5
5
|
|
6
6
|
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
7
7
|
<head>
|
8
|
-
<title>Class: Cachetastic::
|
8
|
+
<title>Class: Cachetastic::Adapters::File</title>
|
9
9
|
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
10
10
|
<meta http-equiv="Content-Script-Type" content="text/javascript" />
|
11
11
|
<link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
|
@@ -50,13 +50,13 @@
|
|
50
50
|
<table class="header-table">
|
51
51
|
<tr class="top-aligned-row">
|
52
52
|
<td><strong>Class</strong></td>
|
53
|
-
<td class="class-name-in-header">Cachetastic::
|
53
|
+
<td class="class-name-in-header">Cachetastic::Adapters::File</td>
|
54
54
|
</tr>
|
55
55
|
<tr class="top-aligned-row">
|
56
56
|
<td><strong>In:</strong></td>
|
57
57
|
<td>
|
58
|
-
<a href="../../../files/lib/
|
59
|
-
lib/
|
58
|
+
<a href="../../../files/lib/adapters/cachetastic_adapters_file_rb.html">
|
59
|
+
lib/adapters/cachetastic_adapters_file.rb
|
60
60
|
</a>
|
61
61
|
<br />
|
62
62
|
</td>
|
@@ -66,7 +66,7 @@
|
|
66
66
|
<td><strong>Parent:</strong></td>
|
67
67
|
<td>
|
68
68
|
<a href="Base.html">
|
69
|
-
Cachetastic::
|
69
|
+
Cachetastic::Adapters::Base
|
70
70
|
</a>
|
71
71
|
</td>
|
72
72
|
</tr>
|
@@ -82,13 +82,13 @@
|
|
82
82
|
|
83
83
|
<div id="description">
|
84
84
|
<p>
|
85
|
-
This
|
85
|
+
This adapter uses the file system as it‘s backing. The configuration
|
86
86
|
for this should look something like this:
|
87
87
|
</p>
|
88
88
|
<pre>
|
89
89
|
my_awesome_cache_options:
|
90
90
|
debug: false
|
91
|
-
|
91
|
+
adapter: file
|
92
92
|
marshall_method: none
|
93
93
|
default_expiry: <%= 24.hours %>
|
94
94
|
store_options:
|
@@ -5,12 +5,12 @@
|
|
5
5
|
|
6
6
|
<html>
|
7
7
|
<head>
|
8
|
-
<title>valid? (Cachetastic::
|
8
|
+
<title>valid? (Cachetastic::Adapters::File)</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/
|
13
|
+
<pre><span class="ruby-comment cmt"># File lib/adapters/cachetastic_adapters_file.rb, line 19</span>
|
14
14
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">valid?</span>
|
15
15
|
<span class="ruby-constant">File</span>.<span class="ruby-identifier">exists?</span>(<span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">directory</span>)
|
16
16
|
<span class="ruby-keyword kw">end</span></pre>
|
@@ -5,12 +5,12 @@
|
|
5
5
|
|
6
6
|
<html>
|
7
7
|
<head>
|
8
|
-
<title>setup (Cachetastic::
|
8
|
+
<title>setup (Cachetastic::Adapters::File)</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/
|
13
|
+
<pre><span class="ruby-comment cmt"># File lib/adapters/cachetastic_adapters_file.rb, line 23</span>
|
14
14
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">setup</span>
|
15
15
|
<span class="ruby-ivar">@directory</span> = <span class="ruby-constant">File</span>.<span class="ruby-identifier">join</span>(<span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">store_options</span>[<span class="ruby-value str">"dir"</span>], <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">name</span>.<span class="ruby-identifier">to_s</span>)
|
16
16
|
<span class="ruby-constant">FileUtils</span>.<span class="ruby-identifier">mkdir_p</span>(<span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">directory</span>, <span class="ruby-identifier">:verbose</span> =<span class="ruby-operator">></span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">debug?</span>)
|
@@ -5,12 +5,12 @@
|
|
5
5
|
|
6
6
|
<html>
|
7
7
|
<head>
|
8
|
-
<title>expire_all (Cachetastic::
|
8
|
+
<title>expire_all (Cachetastic::Adapters::File)</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/
|
13
|
+
<pre><span class="ruby-comment cmt"># File lib/adapters/cachetastic_adapters_file.rb, line 29</span>
|
14
14
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">expire_all</span>
|
15
15
|
<span class="ruby-constant">FileUtils</span>.<span class="ruby-identifier">rm_rf</span>(<span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">directory</span>, <span class="ruby-identifier">:verbose</span> =<span class="ruby-operator">></span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">debug?</span>)
|
16
16
|
<span class="ruby-identifier">setup</span>
|
@@ -5,12 +5,12 @@
|
|
5
5
|
|
6
6
|
<html>
|
7
7
|
<head>
|
8
|
-
<title>get (Cachetastic::
|
8
|
+
<title>get (Cachetastic::Adapters::File)</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/
|
13
|
+
<pre><span class="ruby-comment cmt"># File lib/adapters/cachetastic_adapters_file.rb, line 34</span>
|
14
14
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">get</span>(<span class="ruby-identifier">key</span>)
|
15
15
|
<span class="ruby-identifier">full_path</span> = <span class="ruby-identifier">full_path_from_dir</span>(<span class="ruby-identifier">get_key_directoy</span>(<span class="ruby-identifier">key</span>, <span class="ruby-keyword kw">false</span>))
|
16
16
|
<span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">nil</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-constant">File</span>.<span class="ruby-identifier">exists?</span>(<span class="ruby-identifier">full_path</span>)
|
@@ -5,14 +5,14 @@
|
|
5
5
|
|
6
6
|
<html>
|
7
7
|
<head>
|
8
|
-
<title>set (Cachetastic::
|
8
|
+
<title>set (Cachetastic::Adapters::File)</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/
|
13
|
+
<pre><span class="ruby-comment cmt"># File lib/adapters/cachetastic_adapters_file.rb, line 53</span>
|
14
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-value">0</span>)
|
15
|
-
<span class="ruby-identifier">so</span> = <span class="ruby-constant">Cachetastic</span><span class="ruby-operator">::</span><span class="ruby-constant">
|
15
|
+
<span class="ruby-identifier">so</span> = <span class="ruby-constant">Cachetastic</span><span class="ruby-operator">::</span><span class="ruby-constant">Adapters</span><span class="ruby-operator">::</span><span class="ruby-constant">StoreObject</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">key</span>.<span class="ruby-identifier">to_s</span>, <span class="ruby-identifier">value</span>, <span class="ruby-identifier">expiry</span>)
|
16
16
|
<span class="ruby-constant">File</span>.<span class="ruby-identifier">open</span>(<span class="ruby-identifier">full_path_from_key</span>(<span class="ruby-identifier">key</span>), <span class="ruby-value str">"w"</span>) <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">f</span><span class="ruby-operator">|</span>
|
17
17
|
<span class="ruby-identifier">f</span>.<span class="ruby-identifier">puts</span> <span class="ruby-constant">YAML</span>.<span class="ruby-identifier">dump</span>(<span class="ruby-identifier">so</span>)
|
18
18
|
<span class="ruby-keyword kw">end</span>
|
@@ -5,12 +5,12 @@
|
|
5
5
|
|
6
6
|
<html>
|
7
7
|
<head>
|
8
|
-
<title>delete (Cachetastic::
|
8
|
+
<title>delete (Cachetastic::Adapters::File)</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/
|
13
|
+
<pre><span class="ruby-comment cmt"># File lib/adapters/cachetastic_adapters_file.rb, line 60</span>
|
14
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
15
|
<span class="ruby-keyword kw">if</span> <span class="ruby-identifier">delay</span> <span class="ruby-operator"><=</span> <span class="ruby-value">0</span>
|
16
16
|
<span class="ruby-constant">FileUtils</span>.<span class="ruby-identifier">rm_rf</span>(<span class="ruby-identifier">get_key_directoy</span>(<span class="ruby-identifier">key</span>), <span class="ruby-identifier">:verbose</span> =<span class="ruby-operator">></span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">debug?</span>)
|
@@ -5,7 +5,7 @@
|
|
5
5
|
|
6
6
|
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
7
7
|
<head>
|
8
|
-
<title>Class: Cachetastic::
|
8
|
+
<title>Class: Cachetastic::Adapters::LocalMemory</title>
|
9
9
|
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
10
10
|
<meta http-equiv="Content-Script-Type" content="text/javascript" />
|
11
11
|
<link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
|
@@ -50,13 +50,13 @@
|
|
50
50
|
<table class="header-table">
|
51
51
|
<tr class="top-aligned-row">
|
52
52
|
<td><strong>Class</strong></td>
|
53
|
-
<td class="class-name-in-header">Cachetastic::
|
53
|
+
<td class="class-name-in-header">Cachetastic::Adapters::LocalMemory</td>
|
54
54
|
</tr>
|
55
55
|
<tr class="top-aligned-row">
|
56
56
|
<td><strong>In:</strong></td>
|
57
57
|
<td>
|
58
|
-
<a href="../../../files/lib/
|
59
|
-
lib/
|
58
|
+
<a href="../../../files/lib/adapters/cachetastic_adapters_local_memory_rb.html">
|
59
|
+
lib/adapters/cachetastic_adapters_local_memory.rb
|
60
60
|
</a>
|
61
61
|
<br />
|
62
62
|
</td>
|
@@ -66,7 +66,7 @@
|
|
66
66
|
<td><strong>Parent:</strong></td>
|
67
67
|
<td>
|
68
68
|
<a href="Base.html">
|
69
|
-
Cachetastic::
|
69
|
+
Cachetastic::Adapters::Base
|
70
70
|
</a>
|
71
71
|
</td>
|
72
72
|
</tr>
|
@@ -82,9 +82,9 @@
|
|
82
82
|
|
83
83
|
<div id="description">
|
84
84
|
<p>
|
85
|
-
|
85
|
+
An adapter/store that keeps objects in local memory. This is great for
|
86
86
|
development/testing, but probably shouldn‘t be put into production.
|
87
|
-
It‘s also a very good example of how to write a
|
87
|
+
It‘s also a very good example of how to write a adapter.
|
88
88
|
</p>
|
89
89
|
|
90
90
|
</div>
|
@@ -176,7 +176,7 @@ It‘s also a very good example of how to write a store.
|
|
176
176
|
|
177
177
|
<div class="method-description">
|
178
178
|
<p>
|
179
|
-
See <a href="Base.html">Cachetastic::
|
179
|
+
See <a href="Base.html">Cachetastic::Adapters::Base</a>
|
180
180
|
</p>
|
181
181
|
</div>
|
182
182
|
</div>
|
@@ -5,12 +5,12 @@
|
|
5
5
|
|
6
6
|
<html>
|
7
7
|
<head>
|
8
|
-
<title>valid? (Cachetastic::
|
8
|
+
<title>valid? (Cachetastic::Adapters::LocalMemory)</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/
|
13
|
+
<pre><span class="ruby-comment cmt"># File lib/adapters/cachetastic_adapters_local_memory.rb, line 8</span>
|
14
14
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">valid?</span>
|
15
15
|
<span class="ruby-keyword kw">true</span>
|
16
16
|
<span class="ruby-keyword kw">end</span></pre>
|
@@ -5,12 +5,12 @@
|
|
5
5
|
|
6
6
|
<html>
|
7
7
|
<head>
|
8
|
-
<title>setup (Cachetastic::
|
8
|
+
<title>setup (Cachetastic::Adapters::LocalMemory)</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/
|
13
|
+
<pre><span class="ruby-comment cmt"># File lib/adapters/cachetastic_adapters_local_memory.rb, line 12</span>
|
14
14
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">setup</span>
|
15
15
|
<span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">local_store</span> = {}
|
16
16
|
<span class="ruby-keyword kw">end</span></pre>
|
@@ -5,12 +5,12 @@
|
|
5
5
|
|
6
6
|
<html>
|
7
7
|
<head>
|
8
|
-
<title>expire_all (Cachetastic::
|
8
|
+
<title>expire_all (Cachetastic::Adapters::LocalMemory)</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/
|
13
|
+
<pre><span class="ruby-comment cmt"># File lib/adapters/cachetastic_adapters_local_memory.rb, line 16</span>
|
14
14
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">expire_all</span>
|
15
15
|
<span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">local_store</span> = {}
|
16
16
|
<span class="ruby-keyword kw">end</span></pre>
|
@@ -5,12 +5,12 @@
|
|
5
5
|
|
6
6
|
<html>
|
7
7
|
<head>
|
8
|
-
<title>get (Cachetastic::
|
8
|
+
<title>get (Cachetastic::Adapters::LocalMemory)</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/
|
13
|
+
<pre><span class="ruby-comment cmt"># File lib/adapters/cachetastic_adapters_local_memory.rb, line 21</span>
|
14
14
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">get</span>(<span class="ruby-identifier">key</span>)
|
15
15
|
<span class="ruby-identifier">so</span> = <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">local_store</span>[<span class="ruby-identifier">key</span>.<span class="ruby-identifier">to_s</span>]
|
16
16
|
<span class="ruby-keyword kw">if</span> <span class="ruby-identifier">so</span>
|
@@ -5,14 +5,14 @@
|
|
5
5
|
|
6
6
|
<html>
|
7
7
|
<head>
|
8
|
-
<title>set (Cachetastic::
|
8
|
+
<title>set (Cachetastic::Adapters::LocalMemory)</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/
|
13
|
+
<pre><span class="ruby-comment cmt"># File lib/adapters/cachetastic_adapters_local_memory.rb, line 33</span>
|
14
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-value">0</span>)
|
15
|
-
<span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">local_store</span>[<span class="ruby-identifier">key</span>.<span class="ruby-identifier">to_s</span>] = <span class="ruby-constant">Cachetastic</span><span class="ruby-operator">::</span><span class="ruby-constant">
|
15
|
+
<span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">local_store</span>[<span class="ruby-identifier">key</span>.<span class="ruby-identifier">to_s</span>] = <span class="ruby-constant">Cachetastic</span><span class="ruby-operator">::</span><span class="ruby-constant">Adapters</span><span class="ruby-operator">::</span><span class="ruby-constant">StoreObject</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">key</span>.<span class="ruby-identifier">to_s</span>, <span class="ruby-identifier">value</span>, <span class="ruby-identifier">expiry</span>)
|
16
16
|
<span class="ruby-keyword kw">end</span></pre>
|
17
17
|
</body>
|
18
18
|
</html>
|
@@ -5,12 +5,12 @@
|
|
5
5
|
|
6
6
|
<html>
|
7
7
|
<head>
|
8
|
-
<title>delete (Cachetastic::
|
8
|
+
<title>delete (Cachetastic::Adapters::LocalMemory)</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/
|
13
|
+
<pre><span class="ruby-comment cmt"># File lib/adapters/cachetastic_adapters_local_memory.rb, line 37</span>
|
14
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
15
|
<span class="ruby-keyword kw">if</span> <span class="ruby-identifier">delay</span> <span class="ruby-operator"><=</span> <span class="ruby-value">0</span>
|
16
16
|
<span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">local_store</span>.<span class="ruby-identifier">delete</span>(<span class="ruby-identifier">key</span>.<span class="ruby-identifier">to_s</span>)
|
@@ -5,7 +5,7 @@
|
|
5
5
|
|
6
6
|
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
7
7
|
<head>
|
8
|
-
<title>Class: Cachetastic::
|
8
|
+
<title>Class: Cachetastic::Adapters::Memcache</title>
|
9
9
|
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
10
10
|
<meta http-equiv="Content-Script-Type" content="text/javascript" />
|
11
11
|
<link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
|
@@ -50,13 +50,13 @@
|
|
50
50
|
<table class="header-table">
|
51
51
|
<tr class="top-aligned-row">
|
52
52
|
<td><strong>Class</strong></td>
|
53
|
-
<td class="class-name-in-header">Cachetastic::
|
53
|
+
<td class="class-name-in-header">Cachetastic::Adapters::Memcache</td>
|
54
54
|
</tr>
|
55
55
|
<tr class="top-aligned-row">
|
56
56
|
<td><strong>In:</strong></td>
|
57
57
|
<td>
|
58
|
-
<a href="../../../files/lib/
|
59
|
-
lib/
|
58
|
+
<a href="../../../files/lib/adapters/cachetastic_adapters_memcache_rb.html">
|
59
|
+
lib/adapters/cachetastic_adapters_memcache.rb
|
60
60
|
</a>
|
61
61
|
<br />
|
62
62
|
</td>
|
@@ -66,7 +66,7 @@
|
|
66
66
|
<td><strong>Parent:</strong></td>
|
67
67
|
<td>
|
68
68
|
<a href="Base.html">
|
69
|
-
Cachetastic::
|
69
|
+
Cachetastic::Adapters::Base
|
70
70
|
</a>
|
71
71
|
</td>
|
72
72
|
</tr>
|
@@ -82,13 +82,13 @@
|
|
82
82
|
|
83
83
|
<div id="description">
|
84
84
|
<p>
|
85
|
-
This
|
86
|
-
The configuration for this should look something like this:
|
85
|
+
This adapter uses <a href="Memcache.html">Memcache</a> as it‘s
|
86
|
+
backing. The configuration for this should look something like this:
|
87
87
|
</p>
|
88
88
|
<pre>
|
89
89
|
my_awesome_cache_options:
|
90
90
|
debug: false
|
91
|
-
|
91
|
+
adapter: memcache
|
92
92
|
marshall_method: none
|
93
93
|
default_expiry: <%= 24.hours %>
|
94
94
|
store_options:
|