C0 code coverage information
Generated on Tue May 30 23:34:43 CEST 2006 with rcov 0.5.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 class PageCache < ActiveRecord::Base
2
3 cattr_accessor :public_path
4 @@public_path = RAILS_ROOT + "/public"
5
6 def self.sweep(pattern)
7 destroy_all("name like '#{pattern}'")
8 end
9
10 def self.sweep_all
11 destroy_all
12 end
13
14 private
15
16 after_destroy :expire_cache
17
18 def expire_cache
19 # It'd be better to call expire_page here, except it's a
20 # controller method and we can't get to it.
21 path = PageCache.public_path + "/#{self.name}"
22
23 logger.info "Sweeping #{self.name}"
24 delete_file(path)
25 end
26
27 def delete_file(path)
28 File.delete(path) if File.file?(path)
29 end
30 end
Generated using the rcov code coverage analysis tool for Ruby version 0.5.0.