Permalink
Switch branches/tags
Nothing to show
Find file
Fetching contributors…
Cannot retrieve contributors at this time
7 lines (5 sloc) 246 Bytes
def write_events file_name, field_names, events
header = field_names.join( ',') + "\n"
rows = events.map { |e| field_names.map { |name| e.send(name).to_s }.join(',') }.join($/)
File.open(file_name + ".csv", 'w') { |f| f.write(text) }
end