Method: CountLOC::CsvFileWriter#write

Defined in:
lib/countloc.rb

#write(data) ⇒ Object

Write the csv file, including the data contents (via the to_csv method on the data)



301
302
303
304
305
306
307
# File 'lib/countloc.rb', line 301

def write(data)
  begin
    File.open(@filename, "wb") { |file| file.puts data.to_csv }
  rescue 
    puts "Error: " + $!.to_s
  end    
end