Class: Dexter::CsvLogParser

Inherits:
LogParser show all
Defined in:
lib/dexter/csv_log_parser.rb

Constant Summary

Constants inherited from LogParser

LogParser::DETAIL_LINE, LogParser::LINE_SEPERATOR, LogParser::REGEX

Instance Method Summary collapse

Methods inherited from LogParser

#initialize

Constructor Details

This class inherits a constructor from Dexter::LogParser

Instance Method Details

#performObject



5
6
7
8
9
10
11
12
13
14
15
# File 'lib/dexter/csv_log_parser.rb', line 5

def perform
  CSV.new(@logfile).each do |row|
    if (m = REGEX.match(row[13]))
      active_line = m[3]
      add_parameters(active_line, row[14]) if row[14]
      process_entry(active_line, m[1].to_f)
    end
  end
rescue CSV::MalformedCSVError => e
  abort "ERROR: #{e.message}"
end