lib/fukuzatsu/formatters/csv.rb in fukuzatsu-1.0.6 vs lib/fukuzatsu/formatters/csv.rb in fukuzatsu-2.1.1

- old
+ new

@@ -1,43 +1,42 @@ -module Formatters +module Fukuzatsu - class Csv + module Formatters - include Formatters::Base + class Csv - def self.has_index? - false - end + include Formatters::Base - def self.writes_to_file_system? - true - end + def self.writes_to_file_system? + true + end - def content - rows + "\r\n" - end + def content + rows + "\r\n" + end - def export - begin - File.open(path_to_results, 'a') {|outfile| outfile.write(content)} - rescue Exception => e - puts "Unable to write output: #{e} #{e.backtrace}" + def export + begin + File.open(path_to_results, 'a') {|outfile| outfile.write(content)} + rescue Exception => e + puts "Unable to write output: #{e} #{e.backtrace}" + end end - end - def file_extension - ".csv" - end + def file_extension + ".csv" + end - def path_to_results - File.join(output_directory, "results#{file_extension}") - end + def path_to_results + File.join(output_directory, "results#{file_extension}") + end - def rows - file.methods.map do |method| - "#{file.path_to_file},#{file.class_name},#{method.name},#{method.complexity}" - end.join("\r\n") + def rows + summary.summaries.map do |summary| + "#{summary.source_file},#{summary.container_name},#{summary.entity_name},#{summary.complexity}" + end.join("\r\n") + end + end end - end \ No newline at end of file