| Name | Total Lines | Lines of Code | Total Coverage | Code Coverage |
|---|---|---|---|---|
| app/helpers/annotation_categories_helper.rb | 34 | 27 | 70.59%
|
66.67%
|
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 require 'fastercsv' |
2 require 'ya2yaml' |
3 |
4 |
5 module AnnotationCategoriesHelper |
6 |
7 def prepare_for_conversion(annotation_categories) |
8 result = {} |
9 annotation_categories.each do |annotation_category| |
10 annotation_texts = [] |
11 annotation_category.annotation_texts.each do |annotation_text| |
12 annotation_texts.push(annotation_text.content) |
13 end |
14 result[annotation_category.annotation_category_name] = annotation_texts |
15 end |
16 return result |
17 end |
18 |
19 def convert_to_csv(annotation_categories) |
20 annotation_categories = prepare_for_conversion(annotation_categories) |
21 csv_out = FasterCSV.generate do |csv| |
22 annotation_categories.each do |annotation_category_name, annotation_texts| |
23 # csv format is user_name,last_name,first_name |
24 csv << annotation_texts.unshift(annotation_category_name) |
25 end |
26 end |
27 return csv_out |
28 end |
29 |
30 def convert_to_yml(annotation_categories) |
31 return prepare_for_conversion(annotation_categories).ya2yaml |
32 end |
33 |
34 end |
Generated on Tue Feb 07 00:07:35 -0500 2012 with rcov 0.9.10