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
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
hsbt
22305ffea0
* lib/csv.rb: fix minor typo by @baroquebobcat [fix GH-583][ci skip]
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45510 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-04-03 05:59:14 +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
a_matsuda
01b1f00461
* lib/csv.rb: [DOC] Fix typos
...
s/occurrs/occurs/, s/interation/iteration/, s/intetionally/intentionally/,
s/modfied/modified/, s/axception/exception/, s/curcuit/circuit/
[ci skip]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43955 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-12-02 05:36:00 +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
zzak
bceb856986
* lib/csv.rb: [DOC] Fix typo in CSV.parse_line by @funky-bibimbap
...
[Fixes GH-430] https://github.com/ruby/ruby/pull/430
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43569 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-11-07 17:10:34 +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
45c2532e59
csv.rb: get rid of discarding coderange
...
* lib/csv.rb (CSV#<<): use StringIO#set_encoding instead of creating
new StringIO instance with String#force_encoding, forcing encoding
discards the cached coderange bits and can make further operations
very slow. [ruby-core:55714] [Bug #8585 ]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41722 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-07-01 06:05:03 +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
zzak
a4b0291fcb
* lib/csv.rb (init_comments): Document private method #init_comments.
...
Based on a patch from Vincent Batts [ruby-core:49172] [Bug #7319 ]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37651 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-11-14 02:53:02 +00:00
nobu
2b64e10feb
remove garbages.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36996 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-09-20 07:06:06 +00:00
zzak
0503756fe5
* lib/csv.rb (Object#CSV, Array#to_csv, String#parse_csv):
...
Examples and documentation for CSV.
[Bug #6880 ] [ruby-core:47218]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36991 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-09-19 22:07:44 +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
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
drbrain
517c3385b1
* lib/csv.rb: Document #raw_encoding. Patch by David Czarnecki.
...
[Ruby 1.9 - Bug #4874 ]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32141 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-06-16 22:54:53 +00:00
jeg2
fe8002b17b
* lib/csv.rb: Improve the line ending detection algorithm
...
(patch by Alexey).
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31906 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-06-02 14:52:11 +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
b74f5dee4a
* lib/csv.rb: Documentation improvements from Ysiad Ferreiras.
...
[Ruby 1.9 - Bug #4785 ]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31739 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-05-26 13:32:40 +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
nagachika
1111afbe5a
* lib/csv.rb: fix a typo.
...
* lib/logger.rb: ditto
* lib/rss.rb: ditto
* lib/webrick/httpauth/authenticator.rb: ditto
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31506 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-05-11 10:22:16 +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
2f348762fb
* lib/csv.rb (CSV.read): no mode is needed.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31369 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-04-27 21:07:04 +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
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
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
9a907880f0
* lib/csv.rb (CSV::foreach, CSV#initialize): fixed passing options.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30355 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-12-25 07:44:50 +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
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
b6e0e98117
* lib/csv.rb: Fixing documentation typos. [ruby-core:32712]
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29422 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-10-07 15:25:23 +00:00
marcandre
70510d026f
* lib/csv.rb: Fix unused variable warnings.
...
Patch by Run Paint [ruby-core:30991]
* lib/date.rb: ditto
* lib/debug.rb: ditto
* lib/drb/drb.rb: ditto
* lib/drb/invokemethod.rb: ditto
* lib/irb/ruby-lex.rb: ditto
* lib/irb/slex.rb: ditto
* lib/logger.rb: ditto
* lib/pathname.rb: ditto
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28619 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-07-11 16:59:10 +00:00
jeg2
5d229db887
* lib/csv.rb: Improving documentation.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28517 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-07-01 14:11:02 +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
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
nobu
c9dd4823d9
* lib: fixed typo. a patch by Sho Hashimoto in [ruby-dev:40716].
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26986 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-03-20 03:30:59 +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
ee2512496c
* lib/csv.rb (CSV#raw_encoding): returns ASCII-8BIT when the io
...
doesn't have encoding.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25362 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-10-16 03:04:38 +00:00
naruse
e3c7548363
* lib/csv.rb (CSV#read_to_char): set encoding and verify data
...
which read from io before encode it to @encoding.
* lib/csv.rb (CSV#raw_encoding): add to get @io's encoding.
* lib/csv.rb (CSV#read_io): add to read string and set @io's
encoding.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25353 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-10-15 18:19:15 +00:00
naruse
2ac5cdd07a
* lib/csv.rb: Change magic comment to US-ASCII in order to
...
make literals as US-ASCII.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24553 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-08-16 06:31:13 +00:00
nobu
f378f10473
* lib/**/*.rb: removed unnecessary shbang lines.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22788 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-03-06 04:23:05 +00:00
nobu
287a34ae0d
* {ext,lib,test}/**/*.rb: removed trailing spaces.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22784 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-03-06 03:56:38 +00:00