aboutsummaryrefslogtreecommitdiffstats
path: root/lib/csv.rb
Commit message (Collapse)AuthorAgeFilesLines
* csv.rb: get rid of discarding coderangenobu2013-07-011-1/+1
| | | | | | | | | * 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
* * lib/csv.rb: Remove the dangerous serialization feature.jeg22013-02-051-127/+0
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39077 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/csv.rb: Added more Hash methods to CSV::Row.jeg22012-12-271-1/+37
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38633 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/csv.rb: A fix for row comparison by Stephen Wattam. [Bug #7528]jeg22012-12-071-1/+2
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38265 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/csv.rb (init_comments): Document private method #init_comments.zzak2012-11-141-0/+5
| | | | | | | 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
* remove garbages.nobu2012-09-201-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36996 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/csv.rb (Object#CSV, Array#to_csv, String#parse_csv): zzak2012-09-191-5/+26
| | | | | | | | 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
* remove trainling spaces.nobu2012-08-211-2/+2
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36750 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/csv.rb: Fixes #161 on githubjeg22012-08-201-1/+24
| | | | | | | | | | * 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
* * lib/csv.rb: Do not modify CSV.generate's argument [ruby-core:38356]marcandre2011-07-211-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32600 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/csv.rb: Document #raw_encoding. Patch by David Czarnecki.drbrain2011-06-161-0/+4
| | | | | | | [Ruby 1.9 - Bug #4874] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32141 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/csv.rb: Improve the line ending detection algorithmjeg22011-06-021-10/+24
| | | | | | | | (patch by Alexey). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31906 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/csv.rb: Enhance each() to support Enumerator.jeg22011-05-261-2/+6
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31740 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/csv.rb: Documentation improvements from Ysiad Ferreiras.jeg22011-05-261-4/+5
| | | | | | | | [Ruby 1.9 - Bug #4785] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31739 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/csv.rb: Improved stray quoting error message (patch by Edvard Majakari).jeg22011-05-251-14/+21
| | | | | | | * lib/csv.rb: Remove debugging prints. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31735 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/csv.rb: fix a typo.nagachika2011-05-111-1/+1
| | | | | | | | * 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
* * lib/csv.rb (CSV::open): suppress universal newline decorator.nobu2011-04-271-4/+12
| | | | | | fixes #4603 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31370 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/csv.rb (CSV.read): no mode is needed.nobu2011-04-271-5/+2
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31369 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * strip trailing spaces.nobu2011-04-261-4/+4
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31357 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/csv.rb (CSV.foreach): 'rb' mode is defaulted in open.nobu2010-12-251-7/+12
| | | | | | | * 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
* * lib/csv.rb (CSV#init_separators): use IO#gets with lengthnobu2010-12-251-38/+4
| | | | | | parameter to get rid of wrong convertion. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30356 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/csv.rb (CSV::foreach, CSV#initialize): fixed passing options.nobu2010-12-251-3/+10
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30355 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/csv.rb (CSV::foreach, CSV#initialize): directly use encodingnobu2010-12-251-5/+3
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30354 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/csv.rb, test/csv: should not assume $, invariant.nobu2010-12-251-7/+7
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30353 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/csv.rb: Upgrading output encoding with ASCII content jeg22010-11-171-2/+1
| | | | | | | | as needed. [ruby-core:33229] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29822 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/csv.rb: Upgrading output encoding as needed. [ruby-core:33135]jeg22010-11-161-8/+20
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29808 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/csv.rb: Fixing documentation typos. [ruby-core:32712]jeg22010-10-071-4/+4
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29422 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/csv.rb: Fix unused variable warnings.marcandre2010-07-111-4/+0
| | | | | | | | | | | | | | | | | | | | | | 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
* * lib/csv.rb: Improving documentation.jeg22010-07-011-0/+8
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28517 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/csv.rb: Fixing a bug that prevented CSV from parsingjeg22010-06-251-2/+8
| | | | | | | | 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
* * lib/csv.rb: Incorporating the fixes from the recentjeg22010-03-231-85/+87
| | | | | | | | 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
* * lib: fixed typo. a patch by Sho Hashimoto in [ruby-dev:40716].nobu2010-03-201-3/+3
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26986 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * A bug fix for deleting blank Table rows from Andy Hartford.jeg22010-01-311-4/+6
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26516 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/csv.rb (CSV#raw_encoding): returns ASCII-8BIT when the ionaruse2009-10-161-1/+3
| | | | | | doesn't have encoding. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25362 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/csv.rb (CSV#read_to_char): set encoding and verify datanaruse2009-10-151-9/+19
| | | | | | | | | | | 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
* * lib/csv.rb: Change magic comment to US-ASCII in order tonaruse2009-08-161-1/+1
| | | | | | make literals as US-ASCII. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24553 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/**/*.rb: removed unnecessary shbang lines.nobu2009-03-061-1/+0
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22788 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * {ext,lib,test}/**/*.rb: removed trailing spaces.nobu2009-03-061-485/+485
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22784 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/csv.rb: Some minor documentation fixes from Gregory Brown.jeg22009-03-031-2/+2
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22744 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/csv.rb: A patch from Madoka Yakamamoto to prevent an infinitejeg22009-03-031-3/+1
| | | | | | | | loop while reading some encodings. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22743 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/csv.rb: Using a more robust transcoding scheme to producejeg22008-12-261-5/+19
| | | | | | | | ASCII compatible inspect() messages. [ruby-dev:37591] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21074 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/csv.rb: Fixed a bug in read_to_char() that would slurpjeg22008-10-251-8/+11
| | | | | | | | | | | | | whole files if the encoding was invalid. It will now read up to 10 bytes ahead to find a valid character boundary or give up. [ruby-core:19465] * test/csv/test_features.rb, test/csv/test_table.rb, test/csv/test_row.rb: Loosened some tests to check for a compatible? Encoding instea of an exact Encoding. [ruby-core:19470] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19931 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/csv/csv.rb: Added support for Encoding::default_internal.jeg22008-10-101-42/+42
| | | | | | | | * lib/csv/csv.rb: Switched to new Hash syntax. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19751 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/csv/csv.rb: Worked around some minor encoding changes in Rubyjeg22008-09-281-4/+4
| | | | | | | | pointed out by Nobu. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19602 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/csv/csv.rb: Improved the idea of whitespace and word characters usedjeg22008-09-231-3/+3
| | | | | | | | in substitutions during header conversion as suggested by Michael Selig. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19494 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/csv/csv.rb: Reworked CSV's parser and generator to be m17n. Datajeg22008-09-211-152/+554
| | | | | | | | | | | | | | | | | | | | | | | | | | | | is now parsed in the Encoding it is in without need for translation. * lib/csv/csv.rb: Improved inspect() messages for better IRb support. * lib/csv/csv.rb: Fixed header writing bug reported by Dov Murik. * lib/csv/csv.rb: Use custom separators in parsing header Strings as suggested by Shmulik Regev. * lib/csv/csv.rb: Added a :write_headers option for outputting headers. * lib/csv/csv.rb: Handle open() calls in binary mode whenever we can to workaround a Windows issue where line-ending translation can cause an off-by-one error in seeking back to a non-zero starting position after auto-discovery for :row_sep as suggested by Robert Battle. * lib/csv/csv.rb: Improved the parser to fail faster when fed some forms of invalid CSV that can be detected without reading ahead. * lib/csv/csv.rb: Added a :field_size_limit option to control CSV's lookahead and prevent the parser from biting off more data than it can chew. * lib/csv/csv.rb: Added readers for CSV attributes: col_sep(), row_sep(), quote_char(), field_size_limit(), converters(), unconverted_fields?(), headers(), return_headers?(), write_headers?(), header_converters(), skip_blanks?(), and force_quotes?(). * lib/csv/csv.rb: Cleaned up code syntax to be more inline with Ruby 1.9 than 1.8. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19441 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/rdoc.rb: massive spelling correction patch from Evan Farrarmatz2008-06-041-4/+4
| | | | | | <evanfarrar at gmail.com> in [ruby-doc:1382] applied. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16810 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * parse.y (arg): operator assignment "a += b rescue c" should bematz2008-05-081-1/+1
| | | | | | | parsed as "a += (b rescue c)" just like normal assignment. [ruby-talk:301000] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16336 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/csv.rb: Cleaned up some code with Ruby 1.9 idioms.jeg22007-12-261-10/+6
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14715 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/csv.rb: Fixed test failures caused by changes to Ruby.jeg22007-12-251-6/+10
| | | | | | | | | * test/csv/tc_serialization, test/csv/tc_csv_parsing, test/csv/tc_features: Fixed test failures caused by changes to Ruby. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14662 b2dd03c8-39d4-4d8f-98ff-823fe69b080e