summaryrefslogtreecommitdiff
path: root/lib/csv/parser.rb
AgeCommit message (Collapse)Author
2021-12-24[ruby/csv] Revert "parser: fix a keep bug that some texts may be dropped ↵Sutou Kouhei
unexpectedly" This reverts commit https://github.com/ruby/csv/commit/5c6523da0a61. This introduces another pbolem. We should try again later. https://github.com/ruby/csv/commit/43a1d6fff1 Notes: Merged: https://github.com/ruby/ruby/pull/5336
2021-12-24[ruby/csv] parser: use row separator explicitlySutou Kouhei
It will improve performance a bit. (But I haven't confirmed it yet...) https://github.com/ruby/csv/commit/06a65b0302 Notes: Merged: https://github.com/ruby/ruby/pull/5336
2021-12-24[ruby/csv] parser: fix a keep bug that some texts may be dropped unexpectedlySutou Kouhei
Ruby: [Bug #18245] [ruby-core:105587] Reported by Hassan Abdul Rehman. https://github.com/ruby/csv/commit/5c6523da0a Notes: Merged: https://github.com/ruby/ruby/pull/5336
2021-12-24[ruby/csv] Fix a bug that all of ARGF contents may not be consumedSutou Kouhei
GitHub: fix GH-228 Reported by Rafael Navaza. Thanks!!! https://github.com/ruby/csv/commit/81f595b6a1 Notes: Merged: https://github.com/ruby/ruby/pull/5336
2021-12-24[ruby/csv] Add handling for ambiguous parsing options ↵adamroyjones
(https://github.com/ruby/csv/pull/226) GitHub: fix GH-225 With Ruby 3.0.2 and csv 3.2.1, the file ```ruby require "csv" File.open("example.tsv", "w") { |f| f.puts("foo\t\tbar") } CSV.read("example.tsv", col_sep: "\t", strip: true) ``` produces the error ``` lib/csv/parser.rb:935:in `parse_quotable_robust': TODO: Meaningful message in line 1. (CSV::MalformedCSVError) ``` However, the CSV in this example is not malformed; instead, ambiguous options were provided to the parser. It is not obvious (to me) whether the string should be parsed as - `["foo\t\tbar"]`, - `["foo", "bar"]`, - `["foo", "", "bar"]`, or - `["foo", nil, "bar"]`. This commit adds code that raises an exception when this situation is encountered. Specifically, it checks if the column separator either ends with or starts with the characters that would be stripped away. This commit also adds unit tests and updates the documentation. https://github.com/ruby/csv/commit/cc317dd42d Notes: Merged: https://github.com/ruby/ruby/pull/5336
2021-10-24[ruby/csv] Add support for Ractor (https://github.com/ruby/csv/pull/218)rm155
https://github.com/ruby/csv/commit/a802690e11 Notes: Merged: https://github.com/ruby/ruby/pull/5010
2021-10-24[ruby/csv] Use "\n" for the default row separator on Ruby 3.0 or laterSutou Kouhei
https://github.com/ruby/csv/commit/1f9cbc170e Notes: Merged: https://github.com/ruby/ruby/pull/5010
2021-10-24[ruby/csv] Changed line ending handling to consider the combination \r\n as ↵Joakim Antman
a single entry when row is faulty (https://github.com/ruby/csv/pull/220) https://github.com/ruby/csv/commit/29cef9ea9d Notes: Merged: https://github.com/ruby/ruby/pull/5010
2020-11-24[ruby/csv] Add support for \r\n with skip_lines: /...$/ againSutou Kouhei
GitHub: fix GH-194 Reported by Josef Šimánek. Thanks!!! https://github.com/ruby/csv/commit/fd86afe081 Notes: Merged: https://github.com/ruby/ruby/pull/3804
2020-07-20[ruby/csv] test scanner: specify encoding explicitlySutou Kouhei
https://github.com/ruby/csv/commit/6e83a1de9c Notes: Merged: https://github.com/ruby/ruby/pull/3332
2020-07-20[ruby/csv] Fix a parse bug when split character exists in middle of column valueSutou Kouhei
GitHub: fix #115 Reported by TOMITA Masahiro. Thanks!!! https://github.com/ruby/csv/commit/398b3564c5 Notes: Merged: https://github.com/ruby/ruby/pull/3332
2020-07-20[ruby/csv] Do not loop forever when skip_lines regexp matches zero length ↵Mike MacDonald
with anchors (#110) * Do not loop forever when skip_lines regexp matches zero length with anchors * Remove needless white spaces * Add missing eos check in skip_needless_lines * Simplify test https://github.com/ruby/csv/commit/3b15d4a3e8 Notes: Merged: https://github.com/ruby/ruby/pull/3332
2019-10-12Import CSV 3.1.2 (#2547)Sutou Kouhei
Notes: Merged-By: kou <[email protected]>
2019-07-14[ruby/csv] Fix a bug that strip: true removes newlinesKouhei Sutou
https://github.com/ruby/csv/commit/5540d35a30
2019-04-14Import CSV 3.0.8kou
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
2019-01-25Upgrade CSV to 3.0.4kou
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66922 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-12-23Import CSV 3.0.2kou
This includes performance improvement especially writing. Writing is about 2 times faster. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66507 b2dd03c8-39d4-4d8f-98ff-823fe69b080e