lib/masticate/csvify.rb in masticate-0.1.0 vs lib/masticate/csvify.rb in masticate-0.1.1
- old
+ new
@@ -5,13 +5,10 @@
def initialize(filename)
@filename = filename
end
def csvify(opts)
- @output = opts[:output] ? File.open(opts[:output], "w") : $stdout
- csv_options = {}
- csv_options[:col_sep] = opts[:col_sep] if opts[:col_sep]
- csv_options[:quote_char] = opts[:quote_char] || opts[:col_sep] if opts[:quote_char] || opts[:col_sep]
+ standard_options(opts)
@output_count = 0
with_input do |input|
while line = get
row = CSV.parse_line(line, csv_options)