lib/masticate/base.rb in masticate-0.2.3 vs lib/masticate/base.rb in masticate-0.3
- old
+ new
@@ -58,19 +58,27 @@
configure(opts)
@output_count = 0
with_input do |input|
while line = get
- row = CSV.parse_line(line, csv_options)
+ row = CSV.parse_line(line, csv_options) #.map {|s| s && s.strip}
+ if row
+ row = row.map {|s| s && s.strip}
+ end
+ # row2 = row.map {|s| s && s.strip}
+ # if row2.nil?
+ # puts "**** ROW IS [#{row.inspect}]"
+ # end
output = crunch(row)
emit(output) if output
end
end
crunch(nil) {|row| emit(row)}
@output.close if opts[:output]
{
:input_count => input_count,
- :output_count => @output_count
+ :output_count => @output_count,
+ :headers => @headers
}
end
end