pgdexter 0.5.5 → 0.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,24 +0,0 @@
1
- module Dexter
2
- class CsvLogParser < LogParser
3
- FIRST_LINE_REGEX = /\A.+/
4
-
5
- def perform
6
- CSV.new(@logfile.to_io).each do |row|
7
- process_csv_row(row[13], row[14])
8
- end
9
- rescue CSV::MalformedCSVError => e
10
- raise Dexter::Abort, "ERROR: #{e.message}"
11
- end
12
-
13
- def process_csv_row(message, detail)
14
- if (m = REGEX.match(message))
15
- # replace first line with match
16
- # needed for multiline queries
17
- active_line = message.sub(FIRST_LINE_REGEX, m[3])
18
-
19
- add_parameters(active_line, detail) if detail
20
- process_entry(active_line, m[1].to_f)
21
- end
22
- end
23
- end
24
- end