lib/masticate/mender.rb in masticate-0.1.3 vs lib/masticate/mender.rb in masticate-0.1.4
- old
+ new
@@ -85,10 +85,10 @@
def fieldcount(line)
explode(line).count
end
def explode(line)
- CSV.parse_line(line, :col_sep => @col_sep, :quote_char => @quote_char)
+ CSV.parse_line(line, :col_sep => @col_sep, :quote_char => @quote_char).map {|s| s && s.strip}
end
# a line is "junky" if it has 2 or fewer fields with any content
def junky?(line)
explode(line).select {|s| s && !s.strip.empty?}.count <= 2