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
jeg2
f18f940802
Adding a liberal_parsing option to CSV. Patch by Braden Anderson.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53401 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-01-01 02:44:48 +00:00
naruse
3e92b635fb
Add frozen_string_literal: false for all files
...
When you change this to true, you may need to add more tests.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53141 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-12-16 05:07:31 +00:00
hsbt
96fb819676
* lib/csv.rb: accept to use Range object for row selection.
...
[Feature #11267 ][ruby-dev:49091]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50929 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-06-17 01:58:34 +00:00
hsbt
7e3b185a25
* test/csv/test_row.rb: Added some missing tests in CSV.
...
* test/csv/test_table.rb: ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47406 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-09-05 09:34:38 +00:00
hsbt
767358108e
* test/with_different_ofs.rb: move into test library directory.
...
* test/csv/base.rb: fix require path for with_different_ofs.rb.
* test/digest/test_digest_extend.rb: ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46563 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-06-26 09:27:22 +00:00
nobu
f9a5335ed4
csv.rb: honor encoding option
...
* lib/csv.rb (CSV#<<): honor explicity given encoding. based on
the patch by DAISUKE TANIWAKI <daisuketaniwaki AT gmail.com> at
[ruby-core:62113]. [Bug #9766 ]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46391 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-06-10 01:57:10 +00:00
akr
2ad2007307
* lib/csv.rb (CSV.open): Close the opened file when an exception occur.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46224 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-05-29 10:44:59 +00:00
nobu
ae3022e434
test_features.rb: fix up r46123
...
* test/csv/test_features.rb: no longer `nil` is valid data source
for `CSV.new`. [GH-580]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46125 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-05-26 02:58:15 +00:00
zzak
0aa197c6f2
* lib/csv.rb: Reject nil as data source for CSV.new, patch by @Peeja.
...
[Fixes GH-580] https://github.com/ruby/ruby/pull/580
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46123 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-05-25 16:41:40 +00:00
jeg2
1170b057e0
* lib/csv.rb: Symbol HeaderConverter: strip leading/trailing space.
...
Reported by Skye Shaw
[Fixes GH-575]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45498 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-04-01 14:40:48 +00:00
jeg2
7c4d4e1eb2
* lib/csv.rb: Don't attempt to convert nil headers.
...
Reported by Skye Shaw
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45497 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-04-01 14:35:03 +00:00
jeg2
3fb752a921
* lib/csv.rb: Fixed a broken regular expression that was causing
...
CSV to miss escaping some special meaning characters when used
in parsing.
Reported by David Unric
[ruby-core:54986] [Bug #8405 ]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45374 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-03-20 14:38:21 +00:00
nobu
2d89896461
* test/csv/test_data_converters.rb: use descriptive assertions.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45223 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-03-01 07:08:19 +00:00
jeg2
895e9b0acd
* lib/csv.rb: Optimize header hashes by freezing string keys.
...
[ruby-core:58510]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43825 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-11-24 00:44:41 +00:00
jeg2
80c4b4b3d7
* lib/csv.rb: If skip_lines is set to a String, convert it to a Regexp
...
to prevent the alternative, which is that each line in the CSV gets
converted to a Regexp when calling skip_lines#match.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43823 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-11-23 23:12:11 +00:00
nobu
28204c67ed
csv.rb: foreach enumerator
...
* lib/csv.rb (CSV.foreach): support enumerator. based on a patch by
Hanmac (Hans Mackowiak) at [ruby-core:57643]. [ruby-core:57283]
[Feature #8929 ]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43135 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-10-04 00:32:35 +00:00
nobu
d8441fcc6e
encdb.c, encoding.c: make BOM-encodings dummy
...
* enc/encdb.c (ENC_DUMMY_UNICODE): make BOM-encodings dummy.
* encoding.c (enc_autoload): keep dummy encodings dummy.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43034 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-09-24 08:15:18 +00:00
nobu
84a5622646
test_encodings.rb: remove BOM encodings
...
* test/csv/test_encodings.rb (TestCSV#each_encoding): encodings with
BOM are external use only.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43033 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-09-24 07:48:51 +00:00
akr
8f671120f1
* test/csv/test_features.rb, test/logger/test_logger.rb
...
test/mkmf/test_have_macro.rb, test/net/http/test_http.rb,
test/openssl/test_config.rb, test/psych/test_encoding.rb,
test/psych/test_exception.rb, test/psych/test_psych.rb,
test/psych/test_tainted.rb, test/readline/test_readline.rb,
test/rexml/test_contrib.rb, test/ruby/test_autoload.rb,
test/ruby/test_beginendblock.rb, test/ruby/test_exception.rb,
test/ruby/test_file.rb, test/ruby/test_io.rb,
test/ruby/test_marshal.rb, test/ruby/test_process.rb,
test/ruby/test_require.rb, test/ruby/test_rubyoptions.rb,
test/syslog/test_syslog_logger.rb, test/webrick/test_httpauth.rb,
test/zlib/test_zlib.rb: Use Tempfile.create.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40400 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-04-20 23:03:52 +00:00
jeg2
b614d7823c
* lib/csv.rb: Remove the dangerous serialization feature.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39077 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-02-05 18:28:26 +00:00
jeg2
93030d0e4d
* lib/csv.rb: Added more Hash methods to CSV::Row.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38633 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-12-27 16:15:53 +00:00
jeg2
5b1065f3fe
* lib/csv.rb: A fix for row comparison by Stephen Wattam. [Bug #7528 ]
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38265 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-12-07 17:42:16 +00:00
nobu
d059d718b5
remove trainling spaces.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36750 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-08-21 04:50:18 +00:00
jeg2
3c3e659196
* lib/csv.rb: Fixes #161 on github
...
* lib/csv.rb: You can now specify a pattern for :skip_lines.
Matching lines will not be passed to the CSV parser.
* lib/csv.rb: Patch by Christian Schwartz.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36743 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-08-20 20:52:36 +00:00
nagachika
331352e676
* test/csv/test_features.rb: add require for Tempfile.
...
* test/csv/test_serialization.rb: ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36332 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-07-07 14:14:54 +00:00
nobu
63a164f32e
test: fix test conditions
...
* test/csv/test_features.rb (TestCSV#test_gzip_reader_bug_fix): test
only if zlib is available.
* test/csv/test_features.rb (TestCSV#test_gzip_writer_bug_fix): ditto.
* test/open-uri/test_open-uri.rb (TestOpenURI#test_content_encoding):
ditto.
* test/rexml/test_order.rb (OrderTester#test_more_ordering): ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35592 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-05-08 06:50:03 +00:00
nobu
a0d2cd2e1e
test: why believe source directories are writable always?
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35591 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-05-08 06:49:59 +00:00
marcandre
616cae1090
* lib/csv.rb: Do not modify CSV.generate's argument [ruby-core:38356]
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32600 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-07-21 21:37:43 +00:00
jeg2
a9c056f1ed
* lib/csv.rb: Enhance each() to support Enumerator.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31740 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-05-26 15:35:06 +00:00
jeg2
6e7544f132
* lib/csv.rb: Improved stray quoting error message (patch by Edvard Majakari).
...
* lib/csv.rb: Remove debugging prints.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31735 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-05-25 14:46:08 +00:00
nobu
e858442f4f
* lib/csv.rb (CSV::open): suppress universal newline decorator.
...
fixes #4603
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31370 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-04-27 21:07:09 +00:00
nobu
0b98b9a95d
* strip trailing spaces.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31357 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-04-26 15:57:04 +00:00
sorah
a790bd0bd7
* lib/test/unit.rb: Add new options; --jobs,-j,--ruby,--jobs-status,
...
--no-retry.
[Feature #4415 ] [ruby-dev:43226],[ruby-dev:43222],[ruby-core:35294]
* lib/test/unit/parallel.rb: Used at test/unit --jobs(-j) option.
* test/csv/test_serialization.rb: test/unit parallel running ready.
* test/rake/test_file_task.rb: test/unit parallel running ready.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30939 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-02-22 03:36:38 +00:00
nobu
6d8c13bc61
* test/with_different_ofs.rb (DifferentOFS): should not affect
...
original classes.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30380 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-12-26 02:15:55 +00:00
nobu
ef99044673
* test/csv: DifferentOFS needs to be include in each classes.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30370 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-12-25 13:49:14 +00:00
nobu
c41b036f4d
test/with_different_ofs.rb: fixed typos.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30369 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-12-25 13:41:11 +00:00