Sutou Kouhei
4fcfa85cb6
[ruby/csv] CSV.generate_line: use the encoding of the first non ASCII field as the expected encoding
...
See also: https://github.com/ruby/stringio/issues/13#issuecomment-660543554
https://github.com/ruby/csv/commit/004cf49d18
2020-07-20 02:32:55 +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
08e70126ae
[ruby/csv] Add `invalid: :replace` for `CSV.open` ( #130 )
...
This PR adds `invalid: :replace` for `CSV.open`. It is a PR similar to #129 .
https://github.com/ruby/csv/commit/5bf687341c
2020-07-20 02:32:52 +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
Koichi ITO
4e33a87879
[ruby/csv] Add `undef: :replace` for `CSV.open` ( #129 )
...
This PR adds `undef: :replace` option for `CSV.open`.
`File.open` has `undef: :replace` option, but `CSV.open` does not.
It would be convenient if `CSV.open` could have a shortcut by having
`undef: :replace` option.
https://github.com/ruby/csv/commit/cff8b18480
2020-07-20 02:32:51 +09:00
Sutou Kouhei
b8084b5cb4
[ruby/csv] Fix a bug that write_nil_value or write_empty_value don't work with non String
...
GitHub: fix GH-123
Reported by asm256. Thanks!!!
https://github.com/ruby/csv/commit/b4492139be
2020-07-20 02:32:50 +09:00
Sutou Kouhei
5359121a56
[ruby/csv] Revert "test: use binary mode explicitly for Ruby 2.7"
...
This reverts commit 736174d28413a4c36630b0daf2f170c8d2fc9abe.
It doesn't solve anything.
https://github.com/ruby/csv/commit/0ee3bdd0d3
2020-07-20 02:32:50 +09:00
Sutou Kouhei
0ee5578e8c
[ruby/csv] test: use binary mode explicitly for Ruby 2.7
...
https://github.com/ruby/csv/commit/736174d284
2020-07-20 02:32:50 +09:00
Sutou Kouhei
814bfc8adc
[ruby/csv] Fix a parse bug when split character exists in middle of column value
...
GitHub: fix #115
Reported by TOMITA Masahiro. Thanks!!!
https://github.com/ruby/csv/commit/398b3564c5
2020-07-20 02:32:49 +09:00
Seiei Miyagi
3c5b67e0db
[ruby/csv] Ensuring StringIO's encoding in CSV.generate ( #111 )
...
https://github.com/ruby/csv/commit/dbf55ef008
2020-07-20 02:32:49 +09:00
Mike MacDonald
d57bc03ba9
[ruby/csv] Do not loop forever when skip_lines regexp matches zero length 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
2020-07-20 02:32:49 +09:00
Jim Kane
b219cd5ac3
[ruby/csv] Make CSV::Row#dup return a usable Row ( #108 )
...
* Make CSV::Row#dup return a usable Row
Previously, calling `dup` on a `CSV::Row` object yielded an object whose
copy was too shallow. Changing the clone's fields would also change the
fields on the source. This change makes the clone more distinct from the
source, so that changes can be made to its fields without affecting the
source.
* Simplify
https://github.com/ruby/csv/commit/64a1ea06fc
2020-07-20 02:32:49 +09:00
Sutou Kouhei
9141aae8c2
[ruby/csv] Suppress warnings
...
https://github.com/ruby/csv/commit/b37df55f46
2020-07-20 02:32:49 +09:00
Nobuyoshi Nakada
d03a7c6a25
Revert "test/csv/write/test_general.rb: suppress warnings"
...
This reverts commit 375cf12918
, to
sync csv from the upstream.
2020-07-20 02:32:48 +09:00
Nobuyoshi Nakada
634eeb4353
Removed trailing spaces [ci skip]
2020-05-14 19:57:39 +09:00
Nobuyoshi Nakada
0686e4181d
Fixed for older versions
...
Fix up 66d1900423
, `RubyVM::MJIT` is
available since ruby 2.6.
2020-02-26 10:16:32 +09:00
Takashi Kokubun
66d1900423
Increase timeout for CSV test with --jit-wait
...
To prevent CI failures like
http://ci.rvm.jp/results/trunk-mjit-wait@silicon-docker/2739995
2020-02-25 09:27:24 -08:00
David Rodríguez
f48655d04d
Remove unneeded exec bits from some files
...
I noticed that some files in rubygems were executable, and I could think
of no reason why they should be.
In general, I think ruby files should never have the executable bit set
unless they include a shebang, so I run the following command over the
whole repo:
```bash
find . -name '*.rb' -type f -executable -exec bash -c 'grep -L "^#!" $1 || chmod -x $1' _ {} \;
```
2019-11-09 21:36:30 +09:00
Yusuke Endoh
375cf12918
test/csv/write/test_general.rb: suppress warnings
...
of "setting Encoding.default_internal".
2019-10-15 23:29:49 +09:00
Sutou Kouhei
92df7d98b6
Import CSV 3.1.2 ( #2547 )
2019-10-12 14:03:21 +09:00
Jeremy Evans
146677a1e7
Fix keyword argument warnings in the tests from Class#new
...
This were previously hidden because calls from C were not warned.
2019-09-06 19:41:23 -07:00
Jeremy Evans
856bb3c35d
Fix remaining warning issues in the tests due to keyword argument separation
2019-08-30 12:39:31 -07:00
Jeremy Evans
e0b4599bba
Fix keyword argument separation warnings in test
2019-08-30 12:39:31 -07:00
Hiroshi SHIBATA
b39efb163d
Aliases capture_output to capture_io for test-unit compatiblity.
2019-08-08 17:19:23 +09:00
Kouhei Sutou
198281a71d
[ruby/csv] Fix a bug that strip: true removes newlines
...
https://github.com/ruby/csv/commit/5540d35a30
2019-07-14 23:07:31 +09:00
Kouhei Sutou
8392592a0a
[ruby/csv] Don't raise on eof?
...
GitHub: fix #86
Reported by krororo. Thanks!!!
https://github.com/ruby/csv/commit/5a8d9d9297
2019-07-14 23:07:31 +09:00
Hiroshi SHIBATA
9f275f7971
Restore support library for only test files that are digest and csv.
2019-07-09 21:16:49 +09:00
Nobuyoshi Nakada
832b509472
with_different_ofs.rb has been moved too
2019-07-02 09:43:33 +09:00
Nobuyoshi Nakada
45ba027d08
Removed unused variables
2019-06-30 08:45:01 +09:00
kou
3791bdf080
Import CSV 3.0.9
...
This fixes test failures on Windows.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67561 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-04-15 02:05:03 +00:00
kou
e3b6c7c7eb
Import CSV 3.0.8
...
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-04-14 21:01:51 +00:00
kou
24b57b102c
Upgrade CSV to 3.0.4
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66922 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-01-25 06:49:59 +00:00
nobu
71e458023d
remove trailing spaces [ci skip]
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66509 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-12-23 11:11:35 +00:00
kou
e5d634260e
Import CSV 3.0.2
...
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
2018-12-23 07:00:35 +00:00
hsbt
60ebd4e26a
Merge csv-3.0.0 from ruby/csv repository.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64638 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-09-05 13:33:21 +00:00
hsbt
5c1941a9be
Merge csv-1.0.2 from upstream.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63364 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-05-09 04:39:16 +00:00
mame
c1d0768f34
test/csv/test_features.rb: enable accidentally-disabled assertions
...
CSV.new does not yield the instance.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63172 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-04-17 07:03:44 +00:00
k0kubun
08bb7d3d19
test_features.rb: fix unused variable warning
...
test/csv/test_features.rb:357: warning: assigned but unused variable - csv
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60030 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-09-26 10:45:14 +00:00
hsbt
ffb49a7e9b
Fixed regression to convert blank value at r45497.
...
[Bug #11126 ][ruby-core:69088]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59643 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-08-22 06:57:00 +00:00
hsbt
ede0df3a9b
Gracefully handle CSV IO when file descriptor closed.
...
[Bug #10504 ][ruby-core:66240]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59642 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-08-22 06:40:59 +00:00
hsbt
20aed4495b
Fixed equality method fails when given the object that doesn't support table method.
...
[Bug #12422 ][ruby-core:75707]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59641 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-08-22 06:34:27 +00:00
hsbt
9c38a08f28
Fixed to write_headers option behavior when given no rows.
...
[Bug #9988 ][ruby-core:63375]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59640 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-08-22 06:17:42 +00:00
hsbt
2c69f7b278
Escape skip_lines string before convert to Regexp.
...
It ignored all of lines when given Regexp special characters.
[Feature #9147 ][ruby-core:58549]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59639 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-08-22 05:32:34 +00:00
glass
32eeff1708
csv.rb: fix incompatibility introduced in r59428
...
* lib/csv.rb: fix incompatibility introduced in r59428.
CSV.new takes options as keyword arguments.
* test/csv/test_features.rb: add a test to ensure it raises error againt
unknown options
* test/csv/test_features.rb: add a test to ensure row_sep option is properly
applied
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59437 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-07-28 07:46:20 +00:00
glass
a983fc5022
csv.rb: use keyword parameters
...
* lib/csv.rb: usb keyword parameters to receive options
* test/csv/test_features.rb: remove a test for checking options
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59428 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-07-27 09:53:58 +00:00
hsbt
87acdae43d
Strip punctuation from CSV headers in symbol converter.
...
Patch by @cllns. [Fix GH-957]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58744 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-05-16 09:32:32 +00:00
hsbt
3b77cb2a64
Added accessor of original line when parsing.
...
[Feature #11865 ][ruby-core:72452][fix GH-1170]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58743 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-05-16 09:17:09 +00:00
nobu
5bb125c63e
csv.rb: fix field_size_limit check
...
* lib/csv.rb (CSV#shift): the last column is an Array in extended
column since r55985. [ruby-dev:49964] [Bug #13149 ]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57406 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-01-23 05:59:28 +00:00
ktsj
b425d4f19a
* lib/csv.rb (CSV::{Row,Table}#{each,delete_if}): returns an enumerator
...
if no block is given. [ruby-core:75346] [Feature #11058 ]
* test/csv/test_row.rb: add test for above.
* test/csv/test_table.rb: ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56083 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-09-07 06:06:09 +00:00
akr
449fbfd4d4
Use Integer instead of Fixnum and Bignum.
...
* object.c, numeric.c, enum.c, ext/-test-/bignum/mul.c,
lib/rexml/quickpath.rb, lib/rexml/text.rb, lib/rexml/xpath_parser.rb,
lib/rubygems/specification.rb, lib/uri/generic.rb,
bootstraptest/test_eval.rb, basictest/test.rb,
test/-ext-/bignum/test_big2str.rb, test/-ext-/bignum/test_div.rb,
test/-ext-/bignum/test_mul.rb, test/-ext-/bignum/test_str2big.rb,
test/csv/test_data_converters.rb, test/date/test_date.rb,
test/json/test_json_generate.rb, test/minitest/test_minitest_mock.rb,
test/openssl/test_cipher.rb, test/rexml/test_jaxen.rb,
test/ruby/test_array.rb, test/ruby/test_basicinstructions.rb,
test/ruby/test_bignum.rb, test/ruby/test_case.rb,
test/ruby/test_class.rb, test/ruby/test_complex.rb,
test/ruby/test_enum.rb, test/ruby/test_eval.rb,
test/ruby/test_iseq.rb, test/ruby/test_literal.rb,
test/ruby/test_math.rb, test/ruby/test_module.rb,
test/ruby/test_numeric.rb, test/ruby/test_range.rb,
test/ruby/test_rational.rb, test/ruby/test_refinement.rb,
test/ruby/test_rubyvm.rb, test/ruby/test_struct.rb,
test/ruby/test_variable.rb, test/rubygems/test_gem_specification.rb,
test/thread/test_queue.rb: Use Integer instead of Fixnum and Bignum.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55029 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-05-17 13:15:57 +00:00