ruby / csv

CSV Reading and Writing
https://ruby.github.io/csv/
BSD 2-Clause "Simplified" License
181 stars 114 forks source link

strip: true を指定すると空白を含むカラムで落ちる #115

Closed tmtm closed 4 years ago

tmtm commented 4 years ago

strip: true を指定すると空白を含むカラムで落ちます。

% ruby -rcsv -e 'CSV.parse(" v v ", strip: true)'
Traceback (most recent call last):
    7: from -e:1:in `<main>'
    6: from /home/tommy/gems26/gems/csv-3.1.2/lib/csv.rb:686:in `parse'
    5: from /home/tommy/gems26/gems/csv-3.1.2/lib/csv.rb:1289:in `read'
    4: from /home/tommy/gems26/gems/csv-3.1.2/lib/csv.rb:1289:in `to_a'
    3: from /home/tommy/gems26/gems/csv-3.1.2/lib/csv.rb:1280:in `each'
    2: from /home/tommy/gems26/gems/csv-3.1.2/lib/csv.rb:1280:in `each'
    1: from /home/tommy/gems26/gems/csv-3.1.2/lib/csv/parser.rb:334:in `parse'
/home/tommy/gems26/gems/csv-3.1.2/lib/csv/parser.rb:931:in `parse_quotable_robust': TODO: Meaningful message in line 1. (CSV::MalformedCSVError)
kou commented 4 years ago

そうかぁ、これでしっぱいしますかぁ。 修正しました。