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

77 Коммитов

Автор SHA1 Сообщение Дата
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
nobu 7df8b94926 * test/with_diffent_ofs.rb (DifferentOFS): test suite for test
suites affected by $,.
* test/digest/test_digest_extend.rb (TestDigestExtend): should not
  assume $, invariant.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30367 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-12-25 13:08:07 +00:00
nobu 36feefecb9 * test/csv/test_data_converters.rb, test/csv/test_table.rb: don't
not call setup within tests.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30366 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-12-25 13:04:43 +00:00
nobu 08d99ac9e3 * lib/csv.rb (CSV.foreach): 'rb' mode is defaulted in open.
* lib/csv.rb (CSV#init_separators): cannonicalize encoding options
  as Encoding objects.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30360 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-12-25 09:04:33 +00:00
nobu eadc639598 * test/csv/base.rb (TestCSV.with_diffrent_ofs): give name to
anonymous classes.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30357 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-12-25 08:33:58 +00:00
nobu 9c017ca5fb * lib/csv.rb (CSV#init_separators): use IO#gets with length
parameter to get rid of wrong convertion.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30356 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-12-25 08:32:27 +00:00
nobu b4876f5e04 * lib/csv.rb (CSV::foreach, CSV#initialize): directly use encoding
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30354 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-12-25 07:04:38 +00:00
nobu d05217109f * lib/csv.rb, test/csv: should not assume $, invariant.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30353 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-12-25 06:58:58 +00:00
nobu 9b0f2e48d7 * test/csv/test_encodings.rb (TestEncodings#setup): fix evil test
suite writing to the source directory.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30351 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-12-25 06:04:07 +00:00
jeg2 b028e8d45d * lib/csv.rb: Upgrading output encoding with ASCII content
as needed.  [ruby-core:33229]



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29822 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-11-17 15:03:25 +00:00
jeg2 40e5b39336 * lib/csv.rb: Upgrading output encoding as needed. [ruby-core:33135]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29808 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-11-16 23:55:29 +00:00
jeg2 effa0c76d9 * lib/csv.rb: Fixing a bug that prevented CSV from parsing
all multi-line fields correctly.  Patch by Rob Biedenham.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28431 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-06-25 02:59:20 +00:00
usa 230ffa11d7 * test/csv/test_interface.rb (test_write_hash): may need to set binary mode
when converter is specified.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27889 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-05-19 09:10:45 +00:00
jeg2 1bd1128989 * lib/csv.rb: Incorporating the fixes from the recent
FasterCSV releases:  1.5.2 and 1.5.3.  [ruby-core:25038]



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27025 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-03-23 14:59:25 +00:00
jeg2 ae0b606830 * A bug fix for deleting blank Table rows from Andy Hartford.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26516 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-01-31 05:34:17 +00:00
naruse 066b30245b rescue Encoding::ConverterNotFoundError.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24554 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-08-16 06:31:31 +00:00
jeg2 8e2eedf46b * test/csv/test_interface.rb, test/csv/test_serialization.rb:
Trying more fixes some failing tests on Windows.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23099 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-03-30 23:20:44 +00:00
jeg2 a9b53f6397 * test/csv/test_interface.rb: Trying a fix for some failing tests
on Windows.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23094 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-03-29 16:00:47 +00:00