C0 code coverage information
Generated on Tue May 30 23:34:44 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 Theme
2 cattr_accessor :cache_theme_lookup
3 @@cache_theme_lookup = false
4
5 attr_accessor :name, :path
6
7 def initialize(name, path)
8 @name, @path = name, path
9 end
10
11 def layout
12 "../../themes/#{name}/layouts/default"
13 end
14
15 def description
16 readme = File.read("#{path}/about.markdown")
17 HtmlEngine.transform(readme, "markdown smartypants")
18 end
19
20 def self.themes_root
21 RAILS_ROOT + "/themes"
22 end
23
24 def self.current_theme_path
25 "#{themes_root}/#{config[:theme]}"
26 end
27
28 def self.current
29 theme_from_path(current_theme_path)
30 end
31
32 def self.theme_from_path(path)
33 name = path.scan(/[-\w]+$/i).flatten.first
34 self.new(name, path)
35 end
36
37 def self.find_all
38 installed_themes.inject([]) do |array, path|
39 array << theme_from_path(path)
40 end
41 end
42
43 def self.installed_themes
44 cache_theme_lookup ? @theme_cache ||= search_theme_directory : search_theme_directory
45 end
46
47 def self.search_theme_directory
48 Dir.glob("#{themes_root}/[-_a-zA-Z0-9]*").collect do |file|
49 file if File.directory?(file)
50 end.compact
51 end
52 end
Generated using the rcov code coverage analysis tool for Ruby version 0.5.0.