C0 code coverage information
Generated on Tue Dec 04 22:06:25 -0500 2007 with rcov 0.8.0
Code reported as executed by Ruby looks like this...
and this: this line is also marked as covered.
Lines considered as run by rcov, but not reported by Ruby, look like this,
and this: these lines were inferred by rcov (using simple heuristics).
Finally, here's a line marked as not executed.
1 #####
2 #
3 # Copyright 2007 Chris Strom, Robin Strom
4 #
5 # This file is part of EEE Code.
6 #
7 # EEE Code is free software: you can redistribute it and/or modify
8 # it under the terms of the GNU General Public License as published by
9 # the Free Software Foundation, either version 3 of the License, or
10 # (at your option) any later version.
11 #
12 # EEE Code is distributed in the hope that it will be useful,
13 # but WITHOUT ANY WARRANTY; without even the implied warranty of
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 # GNU General Public License for more details.
16 #
17 # You should have received a copy of the GNU General Public License
18 # along with EEE Code. If not, see <http://www.gnu.org/licenses/>.
19 #
20
21 # Filters added to this controller apply to all controllers in the application.
22 # Likewise, all the methods added will be available for all controllers.
23
24 class ApplicationController < ActionController::Base
25 # Pick a unique cookie name to distinguish our session data from others'
26 session :session_key => '_eee_session_id'
27
28 # From acts_as_authenticated
29 include AuthenticatedSystem
30 before_filter :login_from_cookie
31
32 def expire_meal_page(meal, expire_links=true)
33 expire_action("/meals/#{meal.uri}")
34 expire_action("/meals/#{meal.uri}.cache")
35 expire_action("/meals/#{meal.uri}.html")
36 expire_action("/recipes/#{meal.uri}")
37 expire_action("/recipes/#{meal.uri}.cache")
38 expire_action("/recipes/#{meal.uri}.html")
39 expire_action("/d/#{meal.uri}")
40 expire_action("/d/#{meal.uri}.cache")
41 expire_action("/d/#{meal.uri}.html")
42
43 expire_action(:controller => 'home', :action => 'index')
44 expire_action(:controller => 'meals', :action => 'mini_calendar')
45 expire_action(:controller => 'meals', :action => 'rss')
46
47 if expire_links
48 expire_meal_page(meal.next, false) if meal.next
49 expire_meal_page(meal.prev, false) if meal.prev
50 end
51 end
52
53 def expire_recipe_page(recipe, expire_links=true)
54 expire_action("/recipes/#{recipe.uri}")
55 expire_action("/recipes/#{recipe.uri}.cache")
56 expire_action("/recipes/#{recipe.uri}.html")
57 expire_action("/d/#{recipe.uri}")
58 expire_action("/d/#{recipe.uri}.cache")
59 expire_action("/d/#{recipe.uri}.html")
60
61 expire_action(:controller => 'ingredients', :action => 'list')
62 expire_action(:controller => 'ingredients', :action => 'index')
63
64 if expire_links
65 expire_recipe_page(recipe.next, false) if recipe.next
66 expire_recipe_page(recipe.prev, false) if recipe.prev
67 expire_recipe_page(recipe.replacement_for, false) if recipe.is_replacement?
68 recipe.alternate_preparations.each{|r| expire_recipe_page(r, false)}
69 end
70 end
71 end
Generated using the rcov code coverage analysis tool for Ruby version 0.8.0.