Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

added writer for csvs

  • Loading branch information...
commit f46e62e3c94e8277ad6ed8866a85ca5d94d51fdc 1 parent bbb9c1a
@michaelfeathers michaelfeathers authored
Showing with 6 additions and 0 deletions.
  1. +6 −0 writer_csv.rb
View
6 writer_csv.rb
@@ -0,0 +1,6 @@
+
+def write_events file_name, field_names, events
+ text = field_names.join( ',') + "\n"
+ text += 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
Please sign in to comment.
Something went wrong with that request. Please try again.