<feed xmlns='http://www.w3.org/2005/Atom'>
<title>delta/ruby.git/lib/csv.rb, branch ruby_3_2</title>
<subtitle>github.com: ruby/ruby.git
</subtitle>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/ruby.git/'/>
<entry>
<title>Merge csv-3.2.6</title>
<updated>2022-12-09T07:36:22+00:00</updated>
<author>
<name>Hiroshi SHIBATA</name>
<email>hsbt@ruby-lang.org</email>
</author>
<published>2022-12-08T23:46:14+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/ruby.git/commit/?id=643918ecfe9c980f251247de6acd3be6280da24c'/>
<id>643918ecfe9c980f251247de6acd3be6280da24c</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>[ruby/csv] Add handling for ambiguous parsing options (https://github.com/ruby/csv/pull/226)</title>
<updated>2021-12-24T05:35:33+00:00</updated>
<author>
<name>adamroyjones</name>
<email>10088591+adamroyjones@users.noreply.github.com</email>
</author>
<published>2021-11-18T21:20:09+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/ruby.git/commit/?id=c70dc3cafb29d89d0377677ead346495183db47e'/>
<id>c70dc3cafb29d89d0377677ead346495183db47e</id>
<content type='text'>
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
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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
</pre>
</div>
</content>
</entry>
<entry>
<title>[ruby/csv] Add support for Ractor (https://github.com/ruby/csv/pull/218)</title>
<updated>2021-10-23T20:57:33+00:00</updated>
<author>
<name>rm155</name>
<email>86454369+rm155@users.noreply.github.com</email>
</author>
<published>2021-10-11T02:21:42+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/ruby.git/commit/?id=ee948fc1b4cb1ad382beee709008bb93b8f6ba75'/>
<id>ee948fc1b4cb1ad382beee709008bb93b8f6ba75</id>
<content type='text'>
https://github.com/ruby/csv/commit/a802690e11
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
https://github.com/ruby/csv/commit/a802690e11
</pre>
</div>
</content>
</entry>
<entry>
<title>[ruby/csv] CSV(): Add support for Ruby 3 (https://github.com/ruby/csv/pull/215)</title>
<updated>2021-10-23T20:57:33+00:00</updated>
<author>
<name>Anthony Hernandez</name>
<email>roguegdi27@gmail.com</email>
</author>
<published>2021-05-11T00:41:26+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/ruby.git/commit/?id=8fde54a3b5073d10aff10d359a3f10818d57ea2c'/>
<id>8fde54a3b5073d10aff10d359a3f10818d57ea2c</id>
<content type='text'>
The implementation of the `CSV` shortcut method is broken in Ruby 3
for calls that look like this:

```ruby
CSV(write_stream, col_sep: "|", headers: headers, write_headers: true) do |csv|
  ...
end
```

The above will result in the following error when the `CSV` method attempts to pass
on arguments to `CSV#instance`:

```
ArgumentError: wrong number of arguments (given 2, expected 0..1)
```

The issue is due to the changes in Ruby 3 relating to positional &amp; keyword arguments.

This commit updates the `CSV()` shortcut implementation to work with Ruby 3, and also
updates the documentation for the shortcut method.

https://github.com/ruby/csv/commit/310dee45fa
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The implementation of the `CSV` shortcut method is broken in Ruby 3
for calls that look like this:

```ruby
CSV(write_stream, col_sep: "|", headers: headers, write_headers: true) do |csv|
  ...
end
```

The above will result in the following error when the `CSV` method attempts to pass
on arguments to `CSV#instance`:

```
ArgumentError: wrong number of arguments (given 2, expected 0..1)
```

The issue is due to the changes in Ruby 3 relating to positional &amp; keyword arguments.

This commit updates the `CSV()` shortcut implementation to work with Ruby 3, and also
updates the documentation for the shortcut method.

https://github.com/ruby/csv/commit/310dee45fa
</pre>
</div>
</content>
</entry>
<entry>
<title>[ruby/csv] Use "\n" for the default row separator on Ruby 3.0 or later</title>
<updated>2021-10-23T20:57:33+00:00</updated>
<author>
<name>Sutou Kouhei</name>
<email>kou@clear-code.com</email>
</author>
<published>2021-09-11T22:34:15+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/ruby.git/commit/?id=8ba98f83b0fa8634c68e2d86e71718cc8097bfcf'/>
<id>8ba98f83b0fa8634c68e2d86e71718cc8097bfcf</id>
<content type='text'>
https://github.com/ruby/csv/commit/1f9cbc170e
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
https://github.com/ruby/csv/commit/1f9cbc170e
</pre>
</div>
</content>
</entry>
<entry>
<title>[ruby/csv] Resolve CSV::Converters and HeaderConverters lazy</title>
<updated>2021-10-23T20:57:33+00:00</updated>
<author>
<name>Sutou Kouhei</name>
<email>kou@clear-code.com</email>
</author>
<published>2021-09-15T06:58:57+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/ruby.git/commit/?id=39ecdabe67d1bc7c864ada6f282590dbc9d3a14e'/>
<id>39ecdabe67d1bc7c864ada6f282590dbc9d3a14e</id>
<content type='text'>
It's for Ractor. If you want to use the built-in converters, you
should call Ractor.make_shareable(CSV::Converters) and/or
Ractor.make_shareable(CSV::HeaderConverters).

https://github.com/ruby/csv/commit/b0b1325d6b
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
It's for Ractor. If you want to use the built-in converters, you
should call Ractor.make_shareable(CSV::Converters) and/or
Ractor.make_shareable(CSV::HeaderConverters).

https://github.com/ruby/csv/commit/b0b1325d6b
</pre>
</div>
</content>
</entry>
<entry>
<title>[ruby/csv] doc: Match text to the struct name (https://github.com/ruby/csv/pull/217)</title>
<updated>2021-10-23T20:57:33+00:00</updated>
<author>
<name>Vince</name>
<email>vince.reuter@gmail.com</email>
</author>
<published>2021-08-05T20:40:05+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/ruby.git/commit/?id=8aaa1c279f7c05a22dd108888d425565fc43e26f'/>
<id>8aaa1c279f7c05a22dd108888d425565fc43e26f</id>
<content type='text'>
https://github.com/ruby/csv/commit/744e41130c
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
https://github.com/ruby/csv/commit/744e41130c
</pre>
</div>
</content>
</entry>
<entry>
<title>[ruby/csv] Fix typo [ci skip]</title>
<updated>2020-12-27T06:27:46+00:00</updated>
<author>
<name>Kenta Murata</name>
<email>mrkn@mrkn.jp</email>
</author>
<published>2020-12-27T04:47:42+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/ruby.git/commit/?id=441cd156e0e6fc5161440c782901861fbc43af80'/>
<id>441cd156e0e6fc5161440c782901861fbc43af80</id>
<content type='text'>
https://github.com/ruby/csv/commit/117bcf311e
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
https://github.com/ruby/csv/commit/117bcf311e
</pre>
</div>
</content>
</entry>
<entry>
<title>[ruby/csv] Clarify and correct RDoc for converters (#178)</title>
<updated>2020-11-24T00:33:55+00:00</updated>
<author>
<name>Burdette Lamar</name>
<email>BurdetteLamar@Yahoo.com</email>
</author>
<published>2020-09-21T22:11:33+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/ruby.git/commit/?id=5a0c8068c8b370c2ce2ba411c146a80194eb3516'/>
<id>5a0c8068c8b370c2ce2ba411c146a80194eb3516</id>
<content type='text'>
https://github.com/ruby/csv/commit/f3e9586b34
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
https://github.com/ruby/csv/commit/f3e9586b34
</pre>
</div>
</content>
</entry>
<entry>
<title>[ruby/csv] Fix CSV.filter to preserve headers (#174)</title>
<updated>2020-11-24T00:33:55+00:00</updated>
<author>
<name>Burdette Lamar</name>
<email>BurdetteLamar@Yahoo.com</email>
</author>
<published>2020-09-11T21:36:01+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/ruby.git/commit/?id=614afb1647d9c9eb170262c8b033f000c5beb6f0'/>
<id>614afb1647d9c9eb170262c8b033f000c5beb6f0</id>
<content type='text'>
Co-authored-by: Sutou Kouhei &lt;kou@clear-code.com&gt;

https://github.com/ruby/csv/commit/203c5e0574
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Co-authored-by: Sutou Kouhei &lt;kou@clear-code.com&gt;

https://github.com/ruby/csv/commit/203c5e0574
</pre>
</div>
</content>
</entry>
</feed>
