Граф коммитов

77 Коммитов

Автор SHA1 Сообщение Дата
Kosuke Shibata 2325e1cd81
[ruby/csv] Add CSV::InvalidEncodingError
(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
2023-10-03 16:13:18 +09:00
Sutou Kouhei b954a4ebc6 [ruby/csv] Bump version
https://github.com/ruby/csv/commit/e090da19b4
2023-06-28 16:37:10 +09:00
Sutou Kouhei d6d60d4287 [ruby/csv] Fix a bug that the same line is used multiple times
GitHub: fix https://github.com/ruby/csv/pull/279

It's happen when:

* `keep_start`/`keep_{drop,back}` are nested.
  (e.g.: `strip: true, skip_lines: /.../`)
* Row separator is `\r\n`.
* `InputScanner` is used. (Small input doesn't use `InputScanner`)

Reported by Gabriel Nagy. Thanks!!!

https://github.com/ruby/csv/commit/183635ab56
2023-06-28 16:37:10 +09:00
Sutou Kouhei 539559d36e [ruby/csv] Remove nonexistent variable
https://github.com/ruby/csv/commit/bfbd6bbf6f
2023-06-28 16:37:09 +09:00
Sutou Kouhei 1f46793406 [ruby/csv] parser: add one more trace
https://github.com/ruby/csv/commit/5df650be0c
2023-06-28 16:37:09 +09:00
Mau Magnaguagno a0709d0aae [ruby/csv] Remove no longer required refinements
(https://github.com/ruby/csv/pull/250)

Since PR #159, the minimum Ruby version is 2.5.0, a version which no
longer requires refinements for String#delete_suffix?, String#match? and
Regexp#match?.
2023-05-25 01:44:17 +09:00
Mau Magnaguagno 1a05d988d3 [ruby/csv] Remove unused @double_quote_character from Parser
(https://github.com/ruby/csv/pull/273)

https://github.com/ruby/csv/commit/e5622c53ae
2023-02-21 19:31:28 +09:00
Sutou Kouhei 50e58df0e3 [ruby/csv] Bump version
https://github.com/ruby/csv/commit/8606ee83e0
2022-12-26 15:09:21 +09:00
Hiroshi SHIBATA 643918ecfe Merge csv-3.2.6 2022-12-09 16:36:22 +09:00
Nobuyoshi Nakada 0360fca4ad
[DOC] Replace the external URIs to docs with rdoc-ref 2022-10-12 13:30:25 +09:00
Nobuyoshi Nakada 3539da64fc
[DOC] Replace the external URIs to docs with rdoc-ref 2022-10-12 12:27:40 +09:00
Sutou Kouhei 22ef4f6445 [ruby/csv] Revert "parser: fix a keep bug that some texts may be dropped 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
2021-12-24 14:35:33 +09:00
Sutou Kouhei 002ce9f515 [ruby/csv] parser: use row separator explicitly
It will improve performance a bit. (But I haven't confirmed it yet...)

https://github.com/ruby/csv/commit/06a65b0302
2021-12-24 14:35:33 +09:00
Sutou Kouhei 4a5d372ca8 [ruby/csv] parser: fix a keep bug that some texts may be dropped unexpectedly
Ruby: [Bug #18245] [ruby-core:105587]

Reported by Hassan Abdul Rehman.

https://github.com/ruby/csv/commit/5c6523da0a
2021-12-24 14:35:33 +09:00
Sutou Kouhei 56a5ae9f52 [ruby/csv] Fix a bug that all of ARGF contents may not be consumed
GitHub: fix GH-228

Reported by Rafael Navaza. Thanks!!!

https://github.com/ruby/csv/commit/81f595b6a1
2021-12-24 14:35:33 +09:00
Sutou Kouhei d137ce50a1 [ruby/csv] Bump version
https://github.com/ruby/csv/commit/e32b666731
2021-12-24 14:35:33 +09:00
adamroyjones c70dc3cafb [ruby/csv] Add handling for ambiguous parsing options (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
2021-12-24 14:35:33 +09:00
rm155 ee948fc1b4 [ruby/csv] Add support for Ractor (https://github.com/ruby/csv/pull/218)
https://github.com/ruby/csv/commit/a802690e11
2021-10-24 05:57:33 +09:00
Sutou Kouhei 274882be62 [ruby/csv] Use test-unit gem instead of test-framework of ruby repo
https://github.com/ruby/csv/commit/9c4add0d31
2021-10-24 05:57:33 +09:00
Kenta Murata 1073975013 [ruby/csv] CI: Stop coverage mesurement
https://github.com/ruby/csv/commit/5ff3b95018
2021-10-24 05:57:33 +09:00
Sutou Kouhei 8ba98f83b0 [ruby/csv] Use "\n" for the default row separator on Ruby 3.0 or later
https://github.com/ruby/csv/commit/1f9cbc170e
2021-10-24 05:57:33 +09:00
Joakim Antman 7f3dd601c8 [ruby/csv] Changed line ending handling to consider the combination \r\n as a single entry when row is faulty (https://github.com/ruby/csv/pull/220)
https://github.com/ruby/csv/commit/29cef9ea9d
2021-10-24 05:57:33 +09:00
Sutou Kouhei 39ecdabe67 [ruby/csv] Resolve CSV::Converters and HeaderConverters lazy
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
2021-10-24 05:57:33 +09:00
Sutou Kouhei e40baca33d [ruby/csv] Bump version
https://github.com/ruby/csv/commit/3025070cea
2021-10-24 05:57:33 +09:00
Sutou Kouhei cd2c726bc0 [ruby/csv] Bump version
https://github.com/ruby/csv/commit/5855c017ef
2020-12-27 15:26:24 +09:00
Sutou Kouhei 832b7f3c54 [ruby/csv] Add support for \r\n with skip_lines: /...$/ again
GitHub: fix GH-194

Reported by Josef Šimánek. Thanks!!!

https://github.com/ruby/csv/commit/fd86afe081
2020-11-24 09:33:55 +09:00
Sutou Kouhei f9935205ac [ruby/csv] Bump version
https://github.com/ruby/csv/commit/e1b430d965
2020-11-24 09:33:55 +09:00
Hiroshi SHIBATA f9d6d762dc [ruby/csv] Removed needless editorconfig file (#192)
https://github.com/ruby/csv/commit/5623dee00e
2020-11-24 09:33:55 +09:00
Burdette Lamar c5fcafd2fd [ruby/csv] Split recipes into three pages: parsing, generating, filtering (#184)
Co-authored-by: Sutou Kouhei <kou@clear-code.com>

https://github.com/ruby/csv/commit/f0bab6a592
2020-11-24 09:33:55 +09:00
Burdette Lamar 8ea293b79c [ruby/csv] Experimenting with recipes in CSV RDoc (#175)
https://github.com/ruby/csv/commit/01ffd0d2de
2020-11-24 09:33:55 +09:00
Burdette Lamar 207f2acc13 [ruby/csv] Enhanced RDoc for CSV::Row (#173)
https://github.com/ruby/csv/commit/99956c671d
2020-11-24 09:33:55 +09:00
Burdette Lamar e8954fa13b [ruby/csv] Enhanced RDoc for CSV::Row (#171)
https://github.com/ruby/csv/commit/cced8d8de9
2020-11-24 09:33:55 +09:00
Burdette Lamar 31ccc233b1 [ruby/csv] Enhanced RDoc for Row#[]= (#170)
https://github.com/ruby/csv/commit/744e83043f
2020-11-24 09:33:55 +09:00
Burdette Lamar d99bca9012 [ruby/csv] Enhanced RDoc for Table::Row (#169)
https://github.com/ruby/csv/commit/70ed12c1aa
2020-11-24 09:33:55 +09:00
Sutou Kouhei 0543db40d8 [ruby/csv] Don't change initialize_copy's return value
https://github.com/ruby/csv/commit/cf3b60db1c
2020-11-24 09:33:55 +09:00
Burdette Lamar 7deff8880f [ruby/csv] Enhanced RDoc for CSV::Table (#165)
https://github.com/ruby/csv/commit/bce4b696a7
2020-11-24 09:33:55 +09:00
Burdette Lamar 72997f4867 [ruby/csv] Enhanced RDoc for values_at, <<, and push (#164)
https://github.com/ruby/csv/commit/bb3eb242f2
2020-11-24 09:33:55 +09:00
Burdette Lamar 3283ef1a7e [ruby/csv] Enhanced RDoc for Table#[] (#162)
* Enhanced RDoc for Table#[]

* Enhanced RDoc for Table#[]

https://github.com/ruby/csv/commit/5575ffc82e
2020-11-24 09:33:55 +09:00
Sutou Kouhei 067b2175e8 [ruby/csv] Bump version
https://github.com/ruby/csv/commit/e7628e6930
2020-11-24 09:33:55 +09:00
Sutou Kouhei 62d123dfa0 [ruby/csv] Disable stringio >= 0.1.3 dependency
If we have it, we can use the csv gem with a Rack application on
Passenger.

https://github.com/ruby/csv/commit/e0c7074a82
2020-11-24 09:33:55 +09:00
Nobuyoshi Nakada 3198e7abd7
Separate `send` into `public_send` and `__send__` 2020-10-27 16:12:45 +09:00
Hiroshi SHIBATA 8fb02b7a97
Update the license for the default gems to dual licenses 2020-08-18 20:26:39 +09:00
Gabriel Nagy a8eecceaef [ruby/csv] Bump minimum ruby version to 2.5.0 (#159)
A dependency to stringio was added to csv, which requires Ruby version
>= 2.5. Bump the gemspec version accordingly.
https://github.com/ruby/csv/commit/bc5a26029f
2020-07-21 09:17:56 +09:00
Sutou Kouhei 78893f16b2 [ruby/csv] Bump version
https://github.com/ruby/csv/commit/f9cd046d66
2020-07-20 15:39:29 +09:00
Sutou Kouhei d919b0e4f9 [ruby/csv] Require stringio 0.1.3 or later
https://github.com/ruby/csv/commit/09dd9f2771
2020-07-20 15:39:26 +09:00
Sutou Kouhei 178649e6dc
[ruby/csv] force_quotes: add support for specifying the target indexes or names
GitHub: fix GH-153

Reported by Aleksandr. Thanks!!!

https://github.com/ruby/csv/commit/8812c58a26
2020-07-20 02:32:54 +09:00
Koichi ITO cee10c1b70
[ruby/csv] Fix an error for `CSV.open` (#131)
Follow up to https://github.com/ruby/csv/pull/130/files#r434885191.

This PR fixes `ArgumentError` for `CSV.open` when processing
invalid byte sequence in UTF-8.
https://github.com/ruby/csv/commit/a4b528c209
2020-07-20 02:32:52 +09:00
Sutou Kouhei 731c0eb44d
[ruby/csv] Bump version
https://github.com/ruby/csv/commit/c6577e5b6e
2020-07-20 02:32:51 +09:00
Sutou Kouhei e3808c5aca
[ruby/csv] Add missing document files to .gem
GitHub: fix GH-125

Reported by joast. Thanks!!!

https://github.com/ruby/csv/commit/bf41fa94cf
2020-07-20 02:32:51 +09:00
Sutou Kouhei 71bee3819f
[ruby/csv] Bump version
https://github.com/ruby/csv/commit/936f15f3cd
2020-07-20 02:32:50 +09:00