aboutsummaryrefslogtreecommitdiffstats
path: root/lib/csv.rb
Commit message (Collapse)AuthorAgeFilesLines
...
* * 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
* * lib/csv.rb: Import the FasterCSV source as the new CSV class.jeg22007-12-251-0/+1892
| | | | | | | * test/csv/*: Added all applicable tests from FasterCSV. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14646 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/csv.rb, test/csv/test_csv.rb: Removed in preparation for FasterCSVjeg22007-12-241-972/+0
| | | | | | | | code import. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14639 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/csv.rb (CSV::IOReader#initialize): use String#[](pos, len)nahi2006-09-021-1/+1
| | | | | | | | instead of String#[](idx) to check utf BOM. follows String#[](idx) behavior change of 1.9. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10829 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/csv.rb (CSV.read, CSV.readlines): added. works as IO.read andnahi2004-05-261-63/+82
| | | | | | | | | | | | | | | IO.readlines in CSV format. * lib/csv.rb (CSV.parse): [CAUTION] behavior changed. in the past, CSV.parse accepts a filename to be read-opened (it was just a shortcut of CSV.open(filename, 'r')). now CSV.parse accepts a string or a stream to be parsed e.g. CSV.parse("1,2\n3,r") #=> [['1', '2'], ['3', '4']] * test/csv/test_csv.rb: follow above changes. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@6410 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/csv.rb: fixed a few bugs around multi char record/field separator.nahi2004-05-201-83/+89
| | | | | | | * test/csv/test_csv.rb: added boundary test for above feature. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@6377 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/csv.rb: writes lines with "\n" when row separator is not given.nahi2004-05-181-301/+244
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | formerly it was "\r\n". * lib/csv.rb: [CAUTION] API change * CSV::Row removed. a row is represented as just an Array. since CSV::Row was a subclass of Array, it won't hurt almost all programs except one which depended CSV::Row#match. * CSV::Cell removed. a cell is represented as just a String or nil(NULL). this change will cause widespread destruction. CSV.open("foo.csv", "r") do |row| row.each do |cell| if cell.is_null # Cell#is_null p "(NULL)" else p cell.data # Cell#data end end end must be just; CSV.open("foo.csv", "r") do |row| row.each do |cell| if cell.nil? p "(NULL)" else p cell end end end * lib/csv.rb: [CAUTION] record separator(CR, LF, CR+LF) behavior change. CSV.open, CSV.parse, and CSV,generate now do not force opened file binmode. formerly it set binmode explicitly. with CSV.open, binmode of opened file depends the given mode parameter "r", "w", "rb", and "wb". CSV.parse and CSV.generate open file with "r" and "w". setting mode properly is user's responsibility now. * lib/csv.rb: accepts String as a fs (field separator/column separator) and rs (record separator/row separator) * lib/csv.rb: added CSV.foreach(path, rs = nil, &block). CSV.foreach now does not handle "| cmd" as a path different from IO.foreach. needed? * test/csv/test_csv.rb: updated. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@6359 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * dln.c, io.c, pack.c, lib/benchmark.rb, lib/cgi.rb, lib/csv.rb,nobu2004-04-181-3/+3
| | | | | | | | | | | | | | lib/date.rb, lib/ftools.rb, lib/getoptlong.rb, lib/logger.rb, lib/matrix.rb, lib/monitor.rb, lib/set.rb, lib/thwait.rb, lib/timeout.rb, lib/yaml.rb, lib/drb/drb.rb, lib/irb/workspace.rb, lib/net/ftp.rb, lib/net/http.rb, lib/net/imap.rb, lib/net/pop.rb, lib/net/telnet.rb, lib/racc/parser.rb, lib/rinda/rinda.rb, lib/rinda/tuplespace.rb, lib/shell/command-processor.rb, lib/soap/rpc/soaplet.rb, lib/test/unit/testcase.rb, lib/test/unit/testsuite.rb: typo fix. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@6178 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * exception message clean-up by Ian Macdonald <ian@caliban.org>.matz2004-03-291-4/+4
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@6044 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/csv.rb: document reduction. [ruby-core:02429]nahi2004-02-161-775/+427
| | | | | | | | | * test/yaml/test_yaml.rb: added 0..1 test with "0".."1" on display. it should be defined that the specification about what kind of Range is supported in ruby's custom type in YAML. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@5731 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/csv.rb: add Cell#to_str and Cell#to_s for /.../ =~ aCell,nahi2003-12-121-0/+14
| | | | | | | | | "#{aCell}" and so on. * test/csv/test_csv.rb: add tests. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@5177 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/csv.rb (IOReader, BasicWriter): call binmode when a given IOnahi2003-10-061-3/+5
| | | | | | | | | | respond_to?(:binmode). record separator was wrong when you gave text mode IO to Reader.parse and Writer.generate. * test/csv/test_csv.rb: add tests for above change. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4708 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/csv.rb: add extra pamameter to specify row(record) separater character.nahi2003-09-151-55/+69
| | | | | | | | | | | | | | | To parse Mac's CR separated CSV, do like this. CSV.open("mac.csv", "r", ?,,?\r) { |row| p row.to_a } The 3rd parameter in this example ?, is for column separater and the 4th ?\r is for row separater. Row separater is nil by default. Nil separater means "\r\n" or "\n". * test/csv/test_csv.rb: add tests for above feature. * test/csv/mac.csv: added. Sample CR separated CSV file. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4553 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/csv.rb: Import csv module.nahi2003-06-191-0/+1322
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3964 b2dd03c8-39d4-4d8f-98ff-823fe69b080e