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 Plugins::Sidebars::ArchivesController < Sidebars::Plugin
2 def self.display_name
3 "Archives"
4 end
5
6 def self.description
7 'Displays links to monthly archives'
8 end
9
10 def self.default_config
11 {'count' => 10, 'show_count' => true}
12 end
13
14 def content
15 @archives = Hash.new
16
17 Article.find(:all, :conditions => 'published != 0', :order => 'created_at DESC').each do |a|
18 index = a.created_at.strftime("%Y-%m").to_sym
19
20 if @archives[index].nil?
21 @archives[index] = Hash.new(0)
22 @archives[index][:name] = a.created_at.strftime("%B %Y")
23 @archives[index][:year], @archives[index][:month] = index.to_s.split("-")
24 end
25 @archives[index][:count] += 1
26
27 break if @archives.size == @sb_config['count'].to_i
28 end
29
30 @archives = @archives.sort_by { |index, month| index.to_s }.reverse.collect { |a| a.last }
31 end
32
33 def configure
34 end
35 end
Generated using the rcov code coverage analysis tool for Ruby version 0.5.0.