summaryrefslogtreecommitdiffstats
path: root/app/helpers/timelog_helper.rb
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2009-11-04 13:22:26 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2009-11-04 13:22:26 +0000
commit27e3fa2bed6bd9ca543d22053c3f1c1eab01e051 (patch)
tree01b75e9cef292045ef80a094ce434a55af33c808 /app/helpers/timelog_helper.rb
parent4ea714fb911ba78918688fc5236cc670d209c55c (diff)
downloadredmine-27e3fa2bed6bd9ca543d22053c3f1c1eab01e051.tar.gz
redmine-27e3fa2bed6bd9ca543d22053c3f1c1eab01e051.zip
Use FasterCSV or ruby1.9 CSV instead of ruby1.8 builtin CSV.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@3007 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/helpers/timelog_helper.rb')
-rw-r--r--app/helpers/timelog_helper.rb8
1 files changed, 2 insertions, 6 deletions
diff --git a/app/helpers/timelog_helper.rb b/app/helpers/timelog_helper.rb
index 178929161..01dcbb473 100644
--- a/app/helpers/timelog_helper.rb
+++ b/app/helpers/timelog_helper.rb
@@ -81,8 +81,7 @@ module TimelogHelper
ic = Iconv.new(l(:general_csv_encoding), 'UTF-8')
decimal_separator = l(:general_csv_decimal_separator)
custom_fields = TimeEntryCustomField.find(:all)
- export = StringIO.new
- CSV::Writer.generate(export, l(:general_csv_separator)) do |csv|
+ export = FCSV.generate(:col_sep => l(:general_csv_separator)) do |csv|
# csv header fields
headers = [l(:field_spent_on),
l(:field_user),
@@ -115,7 +114,6 @@ module TimelogHelper
csv << fields.collect {|c| begin; ic.iconv(c.to_s); rescue; c.to_s; end }
end
end
- export.rewind
export
end
@@ -124,8 +122,7 @@ module TimelogHelper
end
def report_to_csv(criterias, periods, hours)
- export = StringIO.new
- CSV::Writer.generate(export, l(:general_csv_separator)) do |csv|
+ export = FCSV.generate(:col_sep => l(:general_csv_separator)) do |csv|
# Column headers
headers = criterias.collect {|criteria| l(@available_criterias[criteria][:label]) }
headers += periods
@@ -144,7 +141,6 @@ module TimelogHelper
row << "%.2f" %total
csv << row
end
- export.rewind
export
end