End of Life Ruby 3.2 has reached end of life and gets no more fixes. Switch to Ruby 4.0 →
instance method
CSV::Parser#detect_row_separator
detect_row_separator(sample, cr, lf)
lib/csv/parser.rb
View on GitHub ↗
# File tmp/rubies/ruby-3.2.0/lib/csv/parser.rb, line 716
def detect_row_separator(sample, cr, lf)
lf_index = sample.index(lf)
if lf_index
cr_index = sample[0, lf_index].index(cr)
else
cr_index = sample.index(cr)
end
if cr_index and lf_index
if cr_index + 1 == lf_index
cr + lf
elsif cr_index < lf_index
cr
else
lf
end
elsif cr_index
cr
elsif lf_index
lf
else
:auto
end
end
No documentation available