write csv in ruby 1.9 and CSV::Writer
问题 i have a code that works fine with ruby 1.87 but dont works with ruby 1.9. It says that CSV::Writer is undeclared but it still part of the rdoc. Does the csv api changed, after the fastercsv merge, or not? my code: require 'csv' def self.export_csv file_name = File.join(RAILS_ROOT, 'public','csv',"#{start_date_f}_#{end_date_f}.csv") return file_name if File.exist?(file_name) @results = find(:all) header_row = [] outfile = File.open(file_name, 'wb') CSV::Writer.generate(outfile) do |csv|