Skip to content
This repository was archived by the owner on Dec 1, 2022. It is now read-only.

Revert to 3.0.0 #1

Closed
wants to merge 152 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
152 commits
Select commit Hold shift + click to select a range
df320b2
Bump version
kou Jun 6, 2018
b4143f3
Add a test of modes (by_col_or_row)
284km Jun 23, 2018
c7d454b
Merge pull request #38 from 284km/add_test_modes_col_or_rows
hsbt Jun 23, 2018
7f93155
Row#dup duplicates internal data
kou Jun 26, 2018
5933f7a
Fix typo
stomar Jul 3, 2018
7befa4d
Merge pull request #40 from stomar/fix-typo
kou Jul 4, 2018
ea7f7ea
Add descriptions of new options. (nil_value and empty_value)
owl-bo Jul 4, 2018
1acfe1a
Merge pull request #41 from owlworks/hotfix/add_description_of_nil_em…
kou Jul 5, 2018
b6a4e6d
Support ruby core repository
hsbt Sep 5, 2018
3dd5303
Extracted file list for ruby core repository
hsbt Sep 6, 2018
1615da9
Merge pull request #42 from ruby/fallback-ruby-core
hsbt Sep 6, 2018
8505ff0
Cache input data read during init_separators to avoid seek/rewind.
vyznev Sep 11, 2018
f310765
Add test case for parsing non-seekable input.
vyznev Sep 15, 2018
9ccdfe3
Merge pull request #45 from vyznev/wip-seekless
kou Sep 18, 2018
d9f0ded
enable Table#headers method to get headers in the file when the file …
shibasaka Oct 25, 2018
00f36bc
test for only header Table
shibasaka Oct 25, 2018
33f48f7
Removing branch on raw_encoding
esparta Oct 28, 2018
b77a602
Merge pull request #48 from esparta/string_encoding_io
kou Oct 28, 2018
bcef814
Add test and fix methods in response to review
shibasaka Oct 29, 2018
778646a
adding a document about new argument, and optimising codes
shibasaka Oct 29, 2018
908f39f
Merge pull request #47 from shibasaka/master
kou Oct 31, 2018
46146c4
Use keyword argument for optional argument
kou Oct 31, 2018
e55321d
Add a test for parsing header only CSV
kou Oct 31, 2018
60c8d5f
Introducing Code Coverage report
esparta Nov 15, 2018
ed42a7c
Enabling Code Climate reporting
esparta Nov 15, 2018
56792fb
Update test reporter ID
kou Nov 16, 2018
8f292fc
Restrict coverage execution to CI environment
esparta Nov 16, 2018
710fb39
Merge pull request #50 from esparta/introducing_test_coverage_report
kou Nov 16, 2018
df5ec6a
Fix indent
kou Dec 4, 2018
24b8541
Add support for auto CR row separator detection for CR end data
kou Dec 4, 2018
1176a56
Add 3.0.1 entry
kou Dec 7, 2018
590604c
Bump version
kou Dec 7, 2018
e29ccad
Replace with flexible CSV parser
284km Dec 4, 2018
438960d
Remove obsolete comments
284km Dec 12, 2018
e044bc9
@col_sep_split_separator unified to @col_sep
284km Dec 12, 2018
104092e
Replace with "next if" instead of "unless"
284km Dec 12, 2018
59225a7
Merge pull request #52 from 284km/scanner
kou Dec 12, 2018
adae83d
Fix a parse error bug for new line only input with headers:
kou Dec 14, 2018
eee1203
Remove needless #match? fallback
kou Dec 16, 2018
37c1731
Revert "Remove needless #match? fallback"
kou Dec 17, 2018
dcc27d1
Fix some typos from my previous PR
zverok Dec 17, 2018
4e0aead
Merge pull request #54 from zverok/fix-typos
kou Dec 18, 2018
15d2a98
Extract CSV writing code as CSV::Writer
kou Dec 18, 2018
470c6d9
Clean
kou Dec 18, 2018
d49380a
Extract parse code as CSV::Parser
kou Dec 19, 2018
2482415
travis: add a test for gem
kou Dec 20, 2018
5670cbf
travis: install simplecov
kou Dec 20, 2018
2805b47
Rename news.md to NEWS.md
kou Dec 20, 2018
34b67f4
Add missing files
kou Dec 20, 2018
5d343a4
Use one line per option
kou Dec 20, 2018
a6c71dc
Simplify
kou Dec 20, 2018
650d32e
Remove moved method
kou Dec 20, 2018
11f126e
Use each as primary API
kou Dec 20, 2018
cc1c5c0
Simplify
kou Dec 20, 2018
05c450e
Stop to gets for StringIO to detect row separator
kou Dec 20, 2018
48a0602
test: remove needless assertion
kou Dec 20, 2018
f909a3a
test: split tests
kou Dec 20, 2018
0eee23e
test: split liberal_parsing tests
kou Dec 21, 2018
f4e4c5d
test: check error message
kou Dec 21, 2018
eeab2ed
test: split malformed CSV tests
kou Dec 21, 2018
39da059
parser: stop to use line based parsing
kou Dec 21, 2018
93040a9
Stop to use singleton class
kou Dec 22, 2018
6199627
Follow namespace change
kou Dec 22, 2018
69bb43c
Improve performance for line
kou Dec 22, 2018
df3fd94
test: split
kou Dec 22, 2018
5b071a3
Support Ruby 2.3 again
kou Dec 22, 2018
f1eaad2
test: add a missing variable
kou Dec 22, 2018
c8b278a
Improve row separator performance
kou Dec 22, 2018
7794e4e
Add scripts to profile parsing and writing
kou Dec 22, 2018
38dd75d
Optimize a bit
kou Dec 22, 2018
9dcea24
Improve row end detection
kou Dec 22, 2018
4e66ca3
Fix a bug that unexpected EOS is caused
kou Dec 22, 2018
3c5990e
Suppress a needless method call
kou Dec 22, 2018
3fe5db2
Support chunked quoted value case
kou Dec 22, 2018
a31902a
Support skip lines for no row separator line
kou Dec 23, 2018
3691651
Support String and Regexp skip lines for no row separator line
kou Dec 23, 2018
5808669
Optimize for quoted case
kou Dec 23, 2018
cf191b1
Support multiple character column separator with multiple chunks
kou Dec 23, 2018
b823416
Improve file input parsing performance a bit
kou Dec 23, 2018
40f2f78
test: add missing eof?
kou Dec 23, 2018
faebbfd
Lazy last line evaluation
kou Dec 23, 2018
d77f4e9
Fix inputs scanner optimization
kou Dec 23, 2018
f48f668
Fix a bug that needless lines are kept
kou Dec 23, 2018
b79965e
Add eof? availability check
kou Dec 23, 2018
5ef6081
Add optimization for small file
kou Dec 23, 2018
6f628d9
Add optimization for file input
kou Dec 23, 2018
82520f2
Add missing encoding check
kou Dec 23, 2018
5617c4f
Expand abbreviations
kou Dec 23, 2018
b822b2d
Line end is always \r and \n
kou Dec 23, 2018
7dbd44b
Add 3.0.2 entry
kou Dec 23, 2018
bc5c04a
field_size_limit is N characters not N bytes
kou Dec 23, 2018
b1f188e
Bump version
kou Dec 23, 2018
90422aa
Make the number of columns customizable
kou Dec 23, 2018
8301c5b
Make the number of columns customizable
kou Dec 23, 2018
9b81ece
Sync with the Ruby repository
kou Dec 24, 2018
425515e
Add test to expect CSV.generate returns UTF-8 string by default
Watson1978 Dec 26, 2018
d5dcaf5
Fix string encoding of CSV.generate returns
Watson1978 Dec 26, 2018
8c77062
Merge pull request #63 from Watson1978/encoding
kou Dec 26, 2018
e5518db
Fix parse case of empty string with headers true
284km Dec 26, 2018
e1179c7
Judge as a header with CSV::Parser#use_headers
284km Dec 26, 2018
d886120
Fix condition whether to use header
284km Dec 27, 2018
a86c69a
Merge pull request #65 from 284km/test_empty_string_value_with_header…
kou Dec 27, 2018
b656a14
Remove a needless file
kou Dec 28, 2018
753c2cd
Remove needless TestCSV
kou Dec 28, 2018
5b1307d
Use "helper"
kou Dec 28, 2018
7ed1469
Remove needless comments
kou Dec 28, 2018
f618eb3
Remove needless "csv_"
kou Dec 29, 2018
c1f30fe
Remove needless spaces
kou Dec 29, 2018
5dd025f
Split writing tests
kou Dec 29, 2018
6dc3ced
Split all writing tests
kou Dec 29, 2018
a7264ab
Use "write" instead of "writing"
kou Dec 29, 2018
bc10963
Split parse tests
kou Dec 29, 2018
969fc4f
Fix test location
kou Dec 29, 2018
8e19680
Move tests for encoding of generate and generate_line results
kou Dec 29, 2018
f68b8a5
Use method
kou Jan 1, 2019
2545742
Use benchmark-driver instead of benchmark-ips
284km Dec 24, 2018
32b8e6e
Use contexts to execute benchmark for each version
284km Jan 4, 2019
7798df6
Fix a unparsable bug caused by multiple-characters column separator
kou Jan 4, 2019
725fae8
Merge pull request #57 from 284km/benchmark_driver
kou Jan 5, 2019
e6db203
Support running each benchmark separately
kou Jan 5, 2019
4b1445a
Clean benchmark YAML
kou Jan 5, 2019
05a6854
Use .yaml
kou Jan 5, 2019
5fd7499
Use $LOAD_PATH and require
kou Jan 5, 2019
8710b03
travis: run all benchmarks
kou Jan 5, 2019
963b871
Fix gem name
kou Jan 5, 2019
4467daf
benchmark: remove needless configuration
kou Jan 5, 2019
8c6cfb1
Ensure resetting RUBYLIB
kou Jan 5, 2019
1f9570c
Remove needless require
kou Jan 5, 2019
8292906
Use double quote
kou Jan 5, 2019
fd53cfb
benchmark: use environment variable instead of OptionParser
kou Jan 5, 2019
ce73c0b
Add benchmark:parse:small task
kou Jan 5, 2019
05ed6df
Use early return
kou Jan 5, 2019
b93c543
Remove needless require
kou Jan 5, 2019
074e6a7
Split liberal_parsing tests
kou Jan 5, 2019
a1dc40a
travis: install old csv
kou Jan 5, 2019
516f96e
Add liberal_parsing: double_quote_outside_quote: option
kou Jan 5, 2019
ac0efa7
Add quote_empty: option
kou Jan 5, 2019
e4d6db0
Remove needless require
kou Jan 5, 2019
d1f8f7b
Ensure resetting RUBYLIB
kou Jan 5, 2019
f39c868
Add a test for rewind
kou Jan 7, 2019
332fab1
Fix a bug that double #each parses twice
kou Jan 7, 2019
ce80ff3
Include aliased twice; replace all with header?
maschwenk Jan 7, 2019
58aae24
Add spec
maschwenk Jan 7, 2019
a305c94
Add 3.0.3 entry
kou Jan 12, 2019
ccd362f
Bump version
kou Jan 12, 2019
42893fa
Duplicate definition of _header
maschwenk Jan 7, 2019
4b8f073
Remove Row#header, add as alias to has_key
maschwenk Jan 12, 2019
e72224e
`CSV::Row#include?` aliased twice (#69)
kou Jan 12, 2019
6a63665
Merge pull request #70 from maschwenk/duplicate-headrs-definition
kou Jan 12, 2019
d14046f
Fix typo
artur-intech Jan 16, 2019
6198c20
Merge pull request #72 from artur-beljajev/fix-typo
mrkn Jan 16, 2019
7ede8e8
Fix a compatibility bug when row headers are changed
kou Jan 17, 2019
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 48 additions & 8 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,48 @@
sudo: false
language: ruby
rvm:
- 2.3.6
- 2.4.3
- 2.5.0
- ruby-head
before_install: gem install bundler
notifications:
webhooks:
- https://webhook.commit-email.info/

env:
global:
- CC_TEST_REPORTER_ID=7e9fdb9b0066c819e6f0554e4ac81255f4f01d8da2a42ac1152402797e927401
before_script:
- curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
- chmod +x ./cc-test-reporter
- ./cc-test-reporter before-build
after_script:
- ./cc-test-reporter after-build --exit-code $TRAVIS_TEST_RESULT

matrix:
include:
- name: "2.3"
rvm: 2.3
- name: "2.4"
rvm: 2.4.5
- name: "2.5"
rvm: 2.5.2
- name: "2.6"
rvm: 2.6
- name: "trunk"
rvm: ruby-head
- name: "scanner"
rvm: 2.6
env:
- CSV_PARSER_SCANNER_TEST=yes
- name: "benchmark"
rvm: 2.6
install:
- bundle install --jobs=3 --retry=3
- gem install csv -v 3.0.1
- gem install csv -v 3.0.2
script:
- bundle exec rake benchmark
- name: "gem"
rvm: 2.6
install:
- rake install
- gem install simplecov
script:
- mkdir -p tmp
- cd tmp
- cp -a ../test/ ./
- ../run-test.rb
246 changes: 246 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,246 @@
# News

## 3.0.3 - 2019-01-12

### Improvements

* Migrated benchmark tool to benchmark-driver from benchmark-ips.
[GitHub#57][Patch by 284km]

* Added `liberal_parsing: {double_quote_outside_quote: true}` parse
option.
[GitHub#66][Reported by Watson]

* Added `quote_empty:` write option.
[GitHub#35][Reported by Dave Myron]

### Fixes

* Fixed a compatibility bug that `CSV.generate` always return
`ASCII-8BIT` encoding string.
[GitHub#63][Patch by Watson]

* Fixed a compatibility bug that `CSV.parse("", headers: true)`
doesn't return `CSV::Table`.
[GitHub#64][Reported by Watson][Patch by 284km]

* Fixed a compatibility bug that multiple-characters column
separator doesn't work.
[GitHub#67][Reported by Jesse Reiss]

* Fixed a compatibility bug that double `#each` parse twice.
[GitHub#68][Reported by Max Schwenk]

### Thanks

* Watson

* 284km

* Jesse Reiss

* Dave Myron

* Max Schwenk

## 3.0.2 - 2018-12-23

### Improvements

* Changed to use strscan in parser.
[GitHub#52][Patch by 284km]

* Improves CSV write performance.
3.0.2 will be about 2 times faster than 3.0.1.

* Improves CSV parse performance for complex case.
3.0.2 will be about 2 times faster than 3.0.1.

### Fixes

* Fixed a parse error bug for new line only input with `headers` option.
[GitHub#53][Reported by Chris Beer]

* Fixed some typos in document.
[GitHub#54][Patch by Victor Shepelev]

### Thanks

* 284km

* Chris Beer

* Victor Shepelev

## 3.0.1 - 2018-12-07

### Improvements

* Added a test.
[GitHub#38][Patch by 284km]

* `CSV::Row#dup`: Changed to duplicate internal data.
[GitHub#39][Reported by André Guimarães Sakata]

* Documented `:nil_value` and `:empty_value` options.
[GitHub#41][Patch by OwlWorks]

* Added support for separator detection for non-seekable inputs.
[GitHub#45][Patch by Ilmari Karonen]

* Removed needless code.
[GitHub#48][Patch by Espartaco Palma]

* Added support for parsing header only CSV with `headers: true`.
[GitHub#47][Patch by Kazuma Shibasaka]

* Added support for coverage report in CI.
[GitHub#48][Patch by Espartaco Palma]

* Improved auto CR row separator detection.
[GitHub#51][Reported by Yuki Kurihara]

### Fixes

* Fixed a typo in document.
[GitHub#40][Patch by Marcus Stollsteimer]

### Thanks

* 284km

* André Guimarães Sakata

* Marcus Stollsteimer

* OwlWorks

* Ilmari Karonen

* Espartaco Palma

* Kazuma Shibasaka

* Yuki Kurihara

## 3.0.0 - 2018-06-06

### Fixes

* Fixed a bug that header isn't returned for empty row.
[GitHub#37][Patch by Grace Lee]

### Thanks

* Grace Lee

## 1.0.2 - 2018-05-03

### Improvements

* Split file for CSV::VERSION

* Code cleanup: Split csv.rb into a more manageable structure
[GitHub#19][Patch by Espartaco Palma]
[GitHub#20][Patch by Steven Daniels]

* Use CSV::MalformedCSVError for invalid encoding line
[GitHub#26][Reported by deepj]

* Support implicit Row <-> Array conversion
[Bug #10013][ruby-core:63582][Reported by Dawid Janczak]

* Update class docs
[GitHub#32][Patch by zverok]

* Add `Row#each_pair`
[GitHub#33][Patch by zverok]

* Improve CSV performance
[GitHub#30][Patch by Watson]

* Add :nil_value and :empty_value option

### Fixes

* Fix a bug that "bom|utf-8" doesn't work
[GitHub#23][Reported by Pavel Lobashov]

* `CSV::Row#to_h`, `#to_hash`: uses the same value as `Row#[]`
[Bug #14482][Reported by tomoya ishida]

* Make row separator detection more robust
[GitHub#25][Reported by deepj]

* Fix a bug that too much separator when col_sep is `" "`
[Bug #8784][ruby-core:63582][Reported by Sylvain Laperche]

### Thanks

* Espartaco Palma

* Steven Daniels

* deepj

* Dawid Janczak

* zverok

* Watson

* Pavel Lobashov

* tomoya ishida

* Sylvain Laperche

* Ryunosuke Sato

## 1.0.1 - 2018-02-09

### Improvements

* `CSV::Table#delete`: Added bulk delete support. You can delete
multiple rows and columns at once.
[GitHub#4][Patch by Vladislav]

* Updated Gem description.
[GitHub#11][Patch by Marcus Stollsteimer]

* Code cleanup.
[GitHub#12][Patch by Marcus Stollsteimer]
[GitHub#14][Patch by Steven Daniels]
[GitHub#18][Patch by takkanm]

* `CSV::Table#dig`: Added.
[GitHub#15][Patch by Tomohiro Ogoke]

* `CSV::Row#dig`: Added.
[GitHub#15][Patch by Tomohiro Ogoke]

* Added ISO 8601 support to date time converter.
[GitHub#16]

### Fixes

* Fixed wrong `CSV::VERSION`.
[GitHub#10][Reported by Marcus Stollsteimer]

* `CSV.generate`: Fixed a regression bug that `String` argument is
ignored.
[GitHub#13][Patch by pavel]

### Thanks

* Vladislav

* Marcus Stollsteimer

* Steven Daniels

* takkanm

* Tomohiro Ogoke

* pavel
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# CSV

[![Build Status](https://travis-ci.org/ruby/csv.svg?branch=master)](https://travis-ci.org/ruby/csv)
[![Test Coverage](https://api.codeclimate.com/v1/badges/321fa39e510a0abd0369/test_coverage)](https://codeclimate.com/github/ruby/csv/test_coverage)

This library provides a complete interface to CSV files and data. It offers tools to enable you to read and write to and from Strings or IO objects, as needed.

Expand Down
47 changes: 42 additions & 5 deletions Rakefile
Original file line number Diff line number Diff line change
@@ -1,10 +1,47 @@
require "bundler/gem_tasks"
require "rake/testtask"

Rake::TestTask.new(:test) do |t|
t.libs << "test" << "test/lib"
t.libs << "lib"
t.test_files = FileList['test/**/test_*.rb']
desc "Run test"
task :test do
ruby("run-test.rb")
end

task :default => :test

benchmark_tasks = []
namespace :benchmark do
Dir.glob("benchmark/*.yaml") do |yaml|
name = File.basename(yaml, ".*")
env = {
"RUBYLIB" => nil,
"BUNDLER_ORIG_RUBYLIB" => nil,
}
command_line = [
FileUtils::RUBY, "-v", "-S", "benchmark-driver", File.expand_path(yaml),
]

desc "Run #{name} benchmark"
task name do
puts("```")
sh(env, *command_line)
puts("```")
end
benchmark_tasks << "benchmark:#{name}"

case name
when "parse"
namespace :parse do
desc "Run #{name} benchmark: small"
task :small do
puts("```")
sh(env.merge("N_COLUMNS" => "10"),
*command_line)
puts("```")
end
benchmark_tasks << "benchmark:parse:small"
end
end
end
end

desc "Run all benchmarks"
task :benchmark => benchmark_tasks
29 changes: 0 additions & 29 deletions benchmark/convert_nil.rb

This file was deleted.

Loading