diff options
author | Anthony Hernandez <roguegdi27@gmail.com> | 2021-05-10 17:41:26 -0700 |
---|---|---|
committer | Sutou Kouhei <kou@cozmixng.org> | 2021-10-24 05:57:33 +0900 |
commit | 8fde54a3b5073d10aff10d359a3f10818d57ea2c (patch) | |
tree | 6c09e7f3cd247538d1fe6bb2a9302fa8c53df2f9 /transcode.c | |
parent | 1073975013d62ff65d673874256fa318db4ef208 (diff) |
[ruby/csv] CSV(): Add support for Ruby 3 (https://github.com/ruby/csv/pull/215)
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 & 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
Notes
Notes:
Merged: https://github.com/ruby/ruby/pull/5010
Diffstat (limited to 'transcode.c')
0 files changed, 0 insertions, 0 deletions