<feed xmlns='http://www.w3.org/2005/Atom'>
<title>ruby.git/lib/csv.rb, branch v3_3_11</title>
<subtitle>The Ruby Programming Language</subtitle>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/'/>
<entry>
<title>[ruby/csv] [DOC] Fix broken links</title>
<updated>2023-10-03T07:13:18+00:00</updated>
<author>
<name>Burdette Lamar</name>
<email>BurdetteLamar@Yahoo.com</email>
</author>
<published>2023-09-30T20:36:42+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=798083fac807ff2c510f1072685f6b33e229b436'/>
<id>798083fac807ff2c510f1072685f6b33e229b436</id>
<content type='text'>
(https://github.com/ruby/csv/pull/283)

https://github.com/ruby/csv/commit/af64a15b2f
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
(https://github.com/ruby/csv/pull/283)

https://github.com/ruby/csv/commit/af64a15b2f
</pre>
</div>
</content>
</entry>
<entry>
<title>[ruby/csv] Add CSV::InvalidEncodingError</title>
<updated>2023-10-03T07:13:18+00:00</updated>
<author>
<name>Kosuke Shibata</name>
<email>56685224+shibaaaa@users.noreply.github.com</email>
</author>
<published>2023-09-14T00:25:06+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=2325e1cd81d721645ad600d93829604c13f6cbd8'/>
<id>2325e1cd81d721645ad600d93829604c13f6cbd8</id>
<content type='text'>
(https://github.com/ruby/csv/pull/287)

To handle encoding errors in CSV parsing with the appropriate error
class

https://github.com/ruby/csv/commit/68b44887e5
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
(https://github.com/ruby/csv/pull/287)

To handle encoding errors in CSV parsing with the appropriate error
class

https://github.com/ruby/csv/commit/68b44887e5
</pre>
</div>
</content>
</entry>
<entry>
<title>[ruby/csv] All Enumerable based methods consume the same lines with other methods</title>
<updated>2023-05-24T16:44:17+00:00</updated>
<author>
<name>Sutou Kouhei</name>
<email>kou@clear-code.com</email>
</author>
<published>2022-09-07T21:19:05+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=88876f02c1050be989500090763203a36c70597b'/>
<id>88876f02c1050be989500090763203a36c70597b</id>
<content type='text'>
This may have a performance penalty. We should benchmark this.

GitHub: fix https://github.com/ruby/csv/pull/260

Reported by Lhoussaine Ghallou. Thanks!!!

https://github.com/ruby/csv/commit/acc05116c5
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This may have a performance penalty. We should benchmark this.

GitHub: fix https://github.com/ruby/csv/pull/260

Reported by Lhoussaine Ghallou. Thanks!!!

https://github.com/ruby/csv/commit/acc05116c5
</pre>
</div>
</content>
</entry>
<entry>
<title>[ruby/csv] CSV#read consumes the same lines with other methods like CSV#shift</title>
<updated>2023-05-24T16:44:17+00:00</updated>
<author>
<name>Sutou Kouhei</name>
<email>kou@clear-code.com</email>
</author>
<published>2022-09-03T13:01:59+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=73c56e06c429ca713d3b612437d2087314a1062f'/>
<id>73c56e06c429ca713d3b612437d2087314a1062f</id>
<content type='text'>
GitHub: fix https://github.com/ruby/csv/pull/258

Reported by Lhoussaine Ghallou. Thanks!!!

https://github.com/ruby/csv/commit/71e6d24e28
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
GitHub: fix https://github.com/ruby/csv/pull/258

Reported by Lhoussaine Ghallou. Thanks!!!

https://github.com/ruby/csv/commit/71e6d24e28
</pre>
</div>
</content>
</entry>
<entry>
<title>[ruby/csv] Use https links instead of http</title>
<updated>2023-02-21T10:31:29+00:00</updated>
<author>
<name>Vivek Bharath Akupatni</name>
<email>apatniv@gmail.com</email>
</author>
<published>2023-02-12T05:35:51+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=2ac1efc0f32e9d5dfb3b606ce0b0bcc83a355aa0'/>
<id>2ac1efc0f32e9d5dfb3b606ce0b0bcc83a355aa0</id>
<content type='text'>
(https://github.com/ruby/csv/pull/274)

https://github.com/ruby/csv/commit/e2a06929a8
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
(https://github.com/ruby/csv/pull/274)

https://github.com/ruby/csv/commit/e2a06929a8
</pre>
</div>
</content>
</entry>
<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='https://git.ruby-lang.org/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='https://git.ruby-lang.org/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='https://git.ruby-lang.org/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='https://git.ruby-lang.org/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='https://git.ruby-lang.org/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>
</feed>
