mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
Import CSV 3.0.8
This includes performance improvements and backward incompatibility fixes. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67560 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
fb96811d15
commit
e3b6c7c7eb
23 changed files with 1534 additions and 650 deletions
|
@ -18,6 +18,7 @@ class CSV
|
|||
if @options[:write_headers] and @headers
|
||||
self << @headers
|
||||
end
|
||||
@fields_converter = @options[:fields_converter]
|
||||
end
|
||||
|
||||
def <<(row)
|
||||
|
@ -31,6 +32,8 @@ class CSV
|
|||
@headers ||= row if @use_headers
|
||||
@lineno += 1
|
||||
|
||||
row = @fields_converter.convert(row, nil, lineno) if @fields_converter
|
||||
|
||||
converted_row = row.collect do |field|
|
||||
quote(field)
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue