aboutsummaryrefslogtreecommitdiffstats
path: root/lib/csv/writer.rb
diff options
context:
space:
mode:
authorHiroshi SHIBATA <hsbt@ruby-lang.org>2022-12-09 08:46:14 +0900
committerHiroshi SHIBATA <hsbt@ruby-lang.org>2022-12-09 16:36:22 +0900
commit643918ecfe9c980f251247de6acd3be6280da24c (patch)
treea5b4011c13ee3af5b110e377a839e79045266dcd /lib/csv/writer.rb
parent260a00d80e4dcc930b040313a99da29e4b1e6678 (diff)
downloadruby-643918ecfe9c980f251247de6acd3be6280da24c.tar.gz
Merge csv-3.2.6
Diffstat (limited to 'lib/csv/writer.rb')
-rw-r--r--lib/csv/writer.rb10
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/csv/writer.rb b/lib/csv/writer.rb
index 4a9a35c5af..030a295bc9 100644
--- a/lib/csv/writer.rb
+++ b/lib/csv/writer.rb
@@ -1,11 +1,8 @@
# frozen_string_literal: true
require_relative "input_record_separator"
-require_relative "match_p"
require_relative "row"
-using CSV::MatchP if CSV.const_defined?(:MatchP)
-
class CSV
# Note: Don't use this class directly. This is an internal class.
class Writer
@@ -42,7 +39,10 @@ class CSV
@headers ||= row if @use_headers
@lineno += 1
- row = @fields_converter.convert(row, nil, lineno) if @fields_converter
+ if @fields_converter
+ quoted_fields = [false] * row.size
+ row = @fields_converter.convert(row, nil, lineno, quoted_fields)
+ end
i = -1
converted_row = row.collect do |field|
@@ -97,7 +97,7 @@ class CSV
return unless @headers
converter = @options[:header_fields_converter]
- @headers = converter.convert(@headers, nil, 0)
+ @headers = converter.convert(@headers, nil, 0, [])
@headers.each do |header|
header.freeze if header.is_a?(String)
end