class Rapport::ReportGeneratorSimpleCsv
Private Class Methods
generate_internal(report, csv)
click to toggle source
# File lib/rapport/report_generators/report_generator_simple_csv.rb, line 47 def self.generate_internal(report, csv) i = 0 csv << report.column_headers report.each_row do |row| csv << row Rapport.logger.debug(row.inspect) if i%1000==0 i+=1 end end
Public Instance Methods
report_name()
click to toggle source
# File lib/rapport/report_generators/report_generator_simple_csv.rb, line 41 def report_name report.table_name.sub('reports_','') end
zip_output_file!()
click to toggle source
# File lib/rapport/report_generators/report_generator_simple_csv.rb, line 33 def zip_output_file! zip_file_name = output_filename.sub(/(\.[^\.]*)?$/,'.zip') Zip::ZipFile.open(zip_file_name, Zip::ZipFile::CREATE) do |zipfile| zipfile.add(File.basename(output_filename),output_filename) end @output_filename = zip_file_name end