C0 code coverage information
Generated on Fri Aug 25 10:11:28 PDT 2006 with rcov 0.7.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 module NewsParts
2 def current_news(is_homepage)
3 # recent news are the top 2 "headline" stories. not blogs.
4 unless read_fragment(:overwrite_params => {:controller => '/page', :action => 'news', :part => 'recent'})
5 @recent_news = News.find_recent(:limit => 2)
6 # make a list of id's that will not be in the next list
7 top_news_ids = []
8 @recent_news.each {|rn| top_news_ids << rn.id }
9
10 blog_conditions = "published_at <= ? AND (type = 'News' OR type = 'NewsBlurb') AND approved = 1"
11 blog_conditions << " AND id NOT IN (#{top_news_ids.join(", ")})" if top_news_ids.size > 0
12
13 @recent_blogs = Article.find_recent(:limit => 5, :conditions => [blog_conditions, Time.now])
14 end
15
16 unless read_fragment(:overwrite_params => {:controller => '/page', :action => 'news', :part => 'other_recent'})
17 @other_recent_news = Article.find_recent( :joins => "USE INDEX (ix_published_at)",
18 :limit => nil,
19 :conditions => ['(published_at < ? AND published_at >= ?) AND (type = \'News\' OR type = \'NewsBlurb\') AND approved = 1', Time.now.beginning_of_day, Time.now.beginning_of_day.ago(1.months)]
20 )
21 end
22 end
23
24 def find_paged_news(conditions)
25 paginate :article,
26 #:select => 'id, title, published_at, updated_at, image_id, artist, type, download_type_id, premiere_position',
27 :conditions => conditions,
28 :order => 'published_at DESC, updated_at DESC',
29 :per_page => 12
30 end
31
32 def setup_page
33 rss_name 'news'
34
35 @page_title = "Pitchfork: News" unless @page_title
36 @page_title << " - #{@results_title}" if @results_title
37 @stylesheets << "pages"
38 end
39 end
Generated using the rcov code coverage analysis tool for Ruby version 0.7.0.