public
Description: All the extra stuff you could want for the Mack Framework.
Homepage: http://www.mackframework.com
Clone URL: git://github.com/markbates/mack-more.git
Feature: Page Caching [#18 state:resolved]
markbates (author)
Fri Jul 18 14:45:47 -0700 2008
commit  6d94e818f1463ff6d073a932bcc08835be1984e5
tree    f47fd49a81b96c8c900f4b060c4b0d5b067e9eff
parent  e0d4be6165a9826f9c3693e9419b61afc82d3f16
...
47
48
49
 
 
 
 
 
 
50
51
52
53
54
55
 
56
57
 
58
59
60
...
47
48
49
50
51
52
53
54
55
56
57
58
59
60
 
61
62
 
63
64
65
66
0
@@ -47,14 +47,20 @@ module Mack
0
         
0
       end
0
       
0
+      class UncacheableError < StandardError
0
+        def initialize(message)
0
+          super(message)
0
+        end
0
+      end # UncacheableError
0
+      
0
     end # PageCaching
0
   end # Caching
0
   
0
   module Controller
0
     
0
-    class << self
0
+    module ClassMethods
0
       def cache_pages(options = {})
0
-        before_fitler :set_page_cache_header, options
0
+        before_filter :set_page_cache_header, options
0
       end
0
     end
0
     
...
1
2
3
4
 
 
5
6
7
...
1
2
 
 
3
4
5
6
7
0
@@ -1,7 +1,7 @@
0
 class DefaultController
0
   include Mack::Controller
0
-  
0
-  cache_pages
0
+
0
+  cache_pages :except => :never_cached
0
   
0
   # /
0
   def index
...
9
10
11
 
12
 
 
...
9
10
11
12
13
14
15
0
@@ -9,4 +9,7 @@ require_gems do |gem|
0
   # gem.add :redgreen, :version => "1.2.2", :libs => :redgreen
0
   # gem.add :termios
0
   # gem.add :rubyzip, :source => "http://gems.rubyforge.org"
0
+  # gem.add "mack-caching", :libs => "mack-caching"
0
 end
0
+
0
+require 'mack-caching'
...
37
38
39
40
41
 
 
 
 
 
 
42
...
37
38
39
 
40
41
42
43
44
45
46
47
0
@@ -37,4 +37,9 @@ module Mack
0
       
0
     end
0
   end
0
-end
0
\ No newline at end of file
0
+end
0
+
0
+# Mack::Controller::Registry.instance.controllers.each do |cont|
0
+#   puts "cont: #{cont}"
0
+#   cont.send(:include, Mack::Controller)
0
+# end
0
\ No newline at end of file

Comments