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 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 9</span>
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 23</span>
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">&quot;default_expiry&quot;</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">&quot;expiry_swing&quot;</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 43</span>
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 49</span>
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 54</span>
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 58</span>
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 62</span>
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
- Wed, 02 Jan 2008 21:46:49 -0500
1
+ Tue, 08 Jan 2008 13:19:28 -0500
@@ -56,7 +56,7 @@
56
56
  </tr>
57
57
  <tr class="top-aligned-row">
58
58
  <td><strong>Last Update:</strong></td>
59
- <td>Wed Jan 02 21:36:27 -0500 2008</td>
59
+ <td>Tue Jan 08 13:17:00 -0500 2008</td>
60
60
  </tr>
61
61
  </table>
62
62
  </div>
@@ -56,7 +56,7 @@
56
56
  </tr>
57
57
  <tr class="top-aligned-row">
58
58
  <td><strong>Last Update:</strong></td>
59
- <td>Wed Jan 02 21:36:27 -0500 2008</td>
59
+ <td>Tue Jan 08 13:17:00 -0500 2008</td>
60
60
  </tr>
61
61
  </table>
62
62
  </div>
@@ -56,7 +56,7 @@
56
56
  </tr>
57
57
  <tr class="top-aligned-row">
58
58
  <td><strong>Last Update:</strong></td>
59
- <td>Wed Jan 02 21:36:26 -0500 2008</td>
59
+ <td>Tue Jan 08 13:17:00 -0500 2008</td>
60
60
  </tr>
61
61
  </table>
62
62
  </div>
@@ -56,7 +56,7 @@
56
56
  </tr>
57
57
  <tr class="top-aligned-row">
58
58
  <td><strong>Last Update:</strong></td>
59
- <td>Wed Jan 02 21:36:27 -0500 2008</td>
59
+ <td>Tue Jan 08 13:17:00 -0500 2008</td>
60
60
  </tr>
61
61
  </table>
62
62
  </div>
data/init.rb CHANGED
@@ -1,3 +0,0 @@
1
- #
2
- Copyright:: Copyright (c) 2007-2008 Mark Bates
3
- # :include: README
@@ -1,5 +1,3 @@
1
- #
2
- Copyright:: Copyright (c) 2007-2008 Mark Bates
3
1
  class Cachetastic::Caches::Base
4
2
 
5
3
  # everything is done at the class level. there won't be any 'instances of it'
@@ -1,4 +1,2 @@
1
- #
2
- Copyright:: Copyright (c) 2007-2008 Mark Bates
3
1
  class Cachetastic::Caches::PageCache < Cachetastic::Caches::Base
4
2
  end
@@ -1,4 +1,2 @@
1
- #
2
- Copyright:: Copyright (c) 2007-2008 Mark Bates
3
1
  class Cachetastic::Caches::RailsSessionCache < Cachetastic::Caches::Base
4
2
  end
@@ -2,4 +2,4 @@
2
2
  gem_name: cachetastic
3
3
  package: cachetastic
4
4
  project: magrathea
5
- version: 1.0.7
5
+ version: 1.0.8
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
7
- date: 2008-01-02 00:00:00 -05:00
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: []