cachetastic 1.0.7 → 1.0.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.
- data/README +87 -0
- data/doc/classes/Cachetastic/Caches/Base.src/M000033.html +1 -1
- data/doc/classes/Cachetastic/Caches/Base.src/M000034.html +1 -1
- data/doc/classes/Cachetastic/Caches/Base.src/M000035.html +1 -1
- data/doc/classes/Cachetastic/Caches/Base.src/M000036.html +1 -1
- data/doc/classes/Cachetastic/Caches/Base.src/M000037.html +1 -1
- data/doc/classes/Cachetastic/Caches/Base.src/M000038.html +1 -1
- data/doc/classes/Cachetastic/Caches/Base.src/M000039.html +1 -1
- data/doc/created.rid +1 -1
- data/doc/files/init_rb.html +1 -1
- data/doc/files/lib/caches/cachetastic_caches_base_rb.html +1 -1
- data/doc/files/lib/caches/cachetastic_caches_page_cache_rb.html +1 -1
- data/doc/files/lib/caches/cachetastic_caches_rails_session_cache_rb.html +1 -1
- data/init.rb +0 -3
- data/lib/caches/cachetastic_caches_base.rb +0 -2
- data/lib/caches/cachetastic_caches_page_cache.rb +0 -2
- data/lib/caches/cachetastic_caches_rails_session_cache.rb +0 -2
- data/lib/tasks/rubyforge_config.yml +1 -1
- metadata +3 -3
data/README
ADDED
@@ -0,0 +1,87 @@
|
|
1
|
+
=Gem Requirements:
|
2
|
+
* Application Configuration
|
3
|
+
* Ruby Extensions
|
4
|
+
* Rails Extensions
|
5
|
+
|
6
|
+
=Configuration:
|
7
|
+
|
8
|
+
cachetastic_default_options:
|
9
|
+
# this will dump into the log, configuration info for each cache, as well as the .inspect
|
10
|
+
# for each object returned from the cache
|
11
|
+
debug: true # true | false (default: false)
|
12
|
+
# this is the type of file store to be used for this cache.
|
13
|
+
# more stores can be developed and plugged in as desired
|
14
|
+
store: local_memory # local_memory | memcache (default: local_memory)
|
15
|
+
# this will marshall objects into and out of the store.
|
16
|
+
# so far yaml is the only supported marshall format.
|
17
|
+
marshall_method: none # none | yaml (default: none)
|
18
|
+
# this sets how long objects will live in the cache before they are auto expired.
|
19
|
+
default_expiry: <%= 24.hours %> # time in seconds (default: 24 hours)
|
20
|
+
# when setting objects into the cache the expiry_swing is +/- to the expiry time.
|
21
|
+
# example: if the expiry time is 1 hour, and the swing is 15 minutes,
|
22
|
+
# objects will go into the cache with an expiry time sometime between 45 mins and 75 mins.
|
23
|
+
expiry_swing: <%= 15.minutes %> # time in seconds (default: 0)
|
24
|
+
# these options get passed on directly to the store.
|
25
|
+
# only the memcache store uses these options currently.
|
26
|
+
store_options: # listed below are options for memcache
|
27
|
+
c_threshold: 10_000
|
28
|
+
compression: true
|
29
|
+
debug: false
|
30
|
+
readonly: false
|
31
|
+
urlencode: false
|
32
|
+
# configure logging for this cache:
|
33
|
+
logging:
|
34
|
+
# n number of logs can be configured for a cache
|
35
|
+
# their names can be anything you want, it's doesn't matter
|
36
|
+
logger_1:
|
37
|
+
# this sets the type of log you want to write to.
|
38
|
+
# right now the only two options are file and console
|
39
|
+
type: file # console | file (default: none)
|
40
|
+
# if the type is file, you need to configure where the log file is to be written.
|
41
|
+
file: log/memcached.log # relative | absolute path to log file
|
42
|
+
# this sets the level of logging for this cache
|
43
|
+
level: info # debug | info | warn | error | fatal (default: info)
|
44
|
+
logger_2:
|
45
|
+
# this sets the type of log you want to write to.
|
46
|
+
# right now the only two options are file and console
|
47
|
+
type: console # console | file (default: none)
|
48
|
+
# this sets the level of logging for this cache
|
49
|
+
level: error # debug | info | warn | error | fatal (default: info)
|
50
|
+
# set the servers to be used for memcache
|
51
|
+
servers:
|
52
|
+
- 127.0.0.1:11211 # ip:port used for memcache
|
53
|
+
|
54
|
+
# if using the mongrel_page_cache_handler gem, you can configure it to use cachetastic.
|
55
|
+
page_cache_storage: cachetastic # disk | cachetastic (default: cachetastic)
|
56
|
+
|
57
|
+
# example of how to override options for page cacheing:
|
58
|
+
cachetastic_caches_page_cache_options:
|
59
|
+
default_expiry: <%= 1.hour %>
|
60
|
+
expiry_swing: <%= 15.minutes %>
|
61
|
+
|
62
|
+
# example of how to override options for rails session cacheing:
|
63
|
+
cachetastic_caches_rails_session_cache_options:
|
64
|
+
default_expiry: <%= 30.minutes %>
|
65
|
+
|
66
|
+
=Examples:
|
67
|
+
|
68
|
+
class MyAwesomeCache < Cachetastic::Caches::Base
|
69
|
+
end
|
70
|
+
|
71
|
+
MyAwesomeCache.set(1, [1,2,3])
|
72
|
+
MyAwesomeCache.get(1) # => [1,2,3]
|
73
|
+
|
74
|
+
class MyAwesomeCache < Cachetastic::Caches::Base
|
75
|
+
class << self
|
76
|
+
def get(key, x, y)
|
77
|
+
super(key) do
|
78
|
+
n = x + y
|
79
|
+
set(key, n)
|
80
|
+
n
|
81
|
+
end
|
82
|
+
end
|
83
|
+
end
|
84
|
+
end
|
85
|
+
|
86
|
+
MyAwesomeCache.get(1, 2, 4) # => 8
|
87
|
+
MyAwesomeCache.get(1, 4, 4) # => 8
|
@@ -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/caches/cachetastic_caches_base.rb, line
|
13
|
+
<pre><span class="ruby-comment cmt"># File lib/caches/cachetastic_caches_base.rb, line 7</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">res</span> = <span class="ruby-keyword kw">nil</span>
|
16
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>
|
@@ -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/caches/cachetastic_caches_base.rb, line
|
13
|
+
<pre><span class="ruby-comment cmt"># File lib/caches/cachetastic_caches_base.rb, line 21</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-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
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
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">"expiry_swing"</span>]
|
@@ -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/caches/cachetastic_caches_base.rb, line
|
13
|
+
<pre><span class="ruby-comment cmt"># File lib/caches/cachetastic_caches_base.rb, line 41</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-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
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>)
|
@@ -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/caches/cachetastic_caches_base.rb, line
|
13
|
+
<pre><span class="ruby-comment cmt"># File lib/caches/cachetastic_caches_base.rb, line 47</span>
|
14
14
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">expire_all</span>
|
15
15
|
<span class="ruby-identifier">store</span>.<span class="ruby-identifier">expire_all</span>
|
16
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>)
|
@@ -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/caches/cachetastic_caches_base.rb, line
|
13
|
+
<pre><span class="ruby-comment cmt"># File lib/caches/cachetastic_caches_base.rb, line 52</span>
|
14
14
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">cache_name</span>
|
15
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>
|
@@ -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/caches/cachetastic_caches_base.rb, line
|
13
|
+
<pre><span class="ruby-comment cmt"># File lib/caches/cachetastic_caches_base.rb, line 56</span>
|
14
14
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">store</span>
|
15
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>
|
@@ -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/caches/cachetastic_caches_base.rb, line
|
13
|
+
<pre><span class="ruby-comment cmt"># File lib/caches/cachetastic_caches_base.rb, line 60</span>
|
14
14
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">logger</span>
|
15
15
|
<span class="ruby-identifier">store</span>.<span class="ruby-identifier">logger</span>
|
16
16
|
<span class="ruby-keyword kw">end</span></pre>
|
data/doc/created.rid
CHANGED
@@ -1 +1 @@
|
|
1
|
-
|
1
|
+
Tue, 08 Jan 2008 13:19:28 -0500
|
data/doc/files/init_rb.html
CHANGED
data/init.rb
CHANGED
metadata
CHANGED
@@ -3,12 +3,11 @@ rubygems_version: 0.9.2
|
|
3
3
|
specification_version: 1
|
4
4
|
name: cachetastic
|
5
5
|
version: !ruby/object:Gem::Version
|
6
|
-
version: 1.0.
|
7
|
-
date: 2008-01-
|
6
|
+
version: 1.0.8
|
7
|
+
date: 2008-01-08 00:00:00 -05:00
|
8
8
|
summary: cachetastic
|
9
9
|
require_paths:
|
10
10
|
- lib
|
11
|
-
- README
|
12
11
|
- lib
|
13
12
|
email:
|
14
13
|
homepage:
|
@@ -133,6 +132,7 @@ files:
|
|
133
132
|
- lib/stores/cachetastic_stores_local_memory.rb
|
134
133
|
- lib/stores/cachetastic_stores_memcache.rb
|
135
134
|
- lib/tasks/rubyforge_config.yml
|
135
|
+
- README
|
136
136
|
test_files: []
|
137
137
|
|
138
138
|
rdoc_options: []
|