| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
| |
https://github.com/ruby/csv/commit/117bcf311e
|
|
|
|
| |
https://github.com/ruby/csv/commit/f3e9586b34
|
|
|
|
|
|
| |
Co-authored-by: Sutou Kouhei <kou@clear-code.com>
https://github.com/ruby/csv/commit/203c5e0574
|
|
|
|
| |
https://github.com/ruby/csv/commit/fe975c41d2
|
|
|
|
| |
https://github.com/ruby/csv/commit/910f8e0c5d
|
|
|
|
|
|
|
|
|
|
|
| |
* Enhanced RDoc for several methods
* Update lib/csv.rb
Co-authored-by: Sutou Kouhei <kou@cozmixng.org>
Co-authored-by: Sutou Kouhei <kou@cozmixng.org>
https://github.com/ruby/csv/commit/72e8b00e51
|
|
|
|
|
|
|
|
| |
as the expected encoding
See also: https://github.com/ruby/stringio/issues/13#issuecomment-660543554
https://github.com/ruby/csv/commit/004cf49d18
|
|
|
|
|
|
|
|
|
|
|
| |
* More on RDoc for converters
* More on RDoc for converters
* Fix indent
Co-authored-by: Sutou Kouhei <kou@cozmixng.org>
https://github.com/ruby/csv/commit/6044976160
|
|
|
|
|
|
|
|
|
| |
* Adding call-seq to methods RDoc
Co-authored-by: Sutou Kouhei <kou@cozmixng.org>
https://github.com/ruby/csv/commit/dbd860c1cd
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* RDoc: summary lists for options
* Enhanced RDoc for certain attributes and instance methods
* Enhanced RDoc for certain attributes and instance methods
* Enhanced RDoc for certain attributes and instance methods
* Enhanced RDoc for certain attributes and instance methods
https://github.com/ruby/csv/commit/72d8a25dc9
|
|
|
|
| |
https://github.com/ruby/csv/commit/76379bbe62
|
|
|
|
| |
https://github.com/ruby/csv/commit/60f6f1c28f
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Enhanced RDoc for filter
* Correct return values for ::filter, ::foreach, ::parse
* Enhanced RDoc for filter
* Remove "returns nil"s
Co-authored-by: Sutou Kouhei <kou@clear-code.com>
https://github.com/ruby/csv/commit/2c347f9a3d
|
|
|
|
|
| |
Co-authored-by: Sutou Kouhei <kou@cozmixng.org>
https://github.com/ruby/csv/commit/25dd4cddbb
|
|
|
|
| |
https://github.com/ruby/csv/commit/bc9ea859b0
|
|
|
|
|
|
|
| |
* RDoc for parse_line (adds headers examples)
* RDoc for parse_line (adds headers examples)
https://github.com/ruby/csv/commit/a161be928e
|
|
|
|
|
|
|
|
|
| |
* Added headers: to RDoc for CSV.foreach
* Correct options remark for CSV.generate
* Improve citation for option headers
https://github.com/ruby/csv/commit/b01945ec3a
|
|
|
|
|
|
|
|
|
| |
* Add headers cases to CSV.parse
* Adjust call-seq for CSV.parse
* Update csv.rb
https://github.com/ruby/csv/commit/848c760c43
|
|
|
|
|
|
|
| |
* Enhanced RDoc for CSV
* Repair example code for foreach
https://github.com/ruby/csv/commit/16b425eb37
|
|
|
|
|
| |
Enhancements for open, parse, minor tweaks.
https://github.com/ruby/csv/commit/35392f4e45
|
|
|
|
|
| |
Co-authored-by: Sutou Kouhei <kou@cozmixng.org>
https://github.com/ruby/csv/commit/85e293c1ba
|
|
|
|
| |
https://github.com/ruby/csv/commit/1a4b96b418
|
|
|
|
|
| |
This PR adds `invalid: :replace` for `CSV.open`. It is a PR similar to #129.
https://github.com/ruby/csv/commit/5bf687341c
|
|
|
|
|
|
|
|
|
| |
This PR adds `undef: :replace` option for `CSV.open`.
`File.open` has `undef: :replace` option, but `CSV.open` does not.
It would be convenient if `CSV.open` could have a shortcut by having
`undef: :replace` option.
https://github.com/ruby/csv/commit/cff8b18480
|
|
|
|
|
|
|
| |
* Rdoc for foreach
* Enhanced Rdoc for CSV.generate
https://github.com/ruby/csv/commit/8c26c0ab1f
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Enhanced Rdoc for ::new
* Rdoc for parse_line
* More on parse_line
* Make ::new neater with :call-seq:
* Make better use of :call-seq:
* Rdoc for generate_line
* Respond to review
https://github.com/ruby/csv/commit/0d42df39cb
|
|
|
|
|
|
|
|
| |
GitHub: fix GH-120
Reported by Kyle d'Oliveira. Thanks!!!
https://github.com/ruby/csv/commit/2959483f90
|
|
|
|
| |
https://github.com/ruby/csv/commit/cd670595d5
|
|
|
|
| |
https://github.com/ruby/csv/commit/fb10925271
|
|
|
|
| |
https://github.com/ruby/csv/commit/dbf55ef008
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Cfuncs that use rb_scan_args with the : entry suffer similar keyword
argument separation issues that Ruby methods suffer if the cfuncs
accept optional or variable arguments.
This makes the following changes to : handling.
* Treats as **kw, prompting keyword argument separation warnings
if called with a positional hash.
* Do not look for an option hash if empty keywords are provided.
For backwards compatibility, treat an empty keyword splat as a empty
mandatory positional hash argument, but emit a a warning, as this
behavior will be removed in Ruby 3. The argument number check
needs to be moved lower so it can correctly handle an empty
positional argument being added.
* If the last argument is nil and it is necessary to treat it as an option
hash in order to make sure all arguments are processed, continue to
treat the last argument as the option hash. Emit a warning in this case,
as this behavior will be removed in Ruby 3.
* If splitting the keyword hash into two hashes, issue a warning, as we
will not be splitting hashes in Ruby 3.
* If the keyword argument is required to fill a mandatory positional
argument, continue to do so, but emit a warning as this behavior will
be going away in Ruby 3.
* If keyword arguments are provided and the last argument is not a hash,
that indicates something wrong. This can happen if a cfunc is calling
rb_scan_args multiple times, and providing arguments that were not
passed to it from Ruby. Callers need to switch to the new
rb_scan_args_kw function, which allows passing of whether keywords
were provided.
This commit fixes all warnings caused by the changes above.
It switches some function calls to *_kw versions with appropriate
kw_splat flags. If delegating arguments, RB_PASS_CALLED_KEYWORDS
is used. If creating new arguments, RB_PASS_KEYWORDS is used if
the last argument is a hash to be treated as keywords.
In open_key_args in io.c, use rb_scan_args_kw.
In this case, the arguments provided come from another C
function, not Ruby. The last argument may or may not be a hash,
so we can't set keyword argument mode. However, if it is a
hash, we don't want to warn when treating it as keywords.
In Ruby files, make sure to appropriately use keyword splats
or literal keywords when calling Cfuncs that now issue keyword
argument separation warnings through rb_scan_args. Also, make
sure not to pass nil in place of an option hash.
Work around Kernel#warn warnings due to problems in the Rubygems
override of the method. There is an open pull request to fix
these issues in Rubygems, but part of the Rubygems tests for
their override fail on ruby-head due to rb_scan_args not
recognizing empty keyword splats, which this commit fixes.
Implementation wise, adding rb_scan_args_kw is kind of a pain,
because rb_scan_args takes a variable number of arguments.
In order to not duplicate all the code, the function internals need
to be split into two functions taking a va_list, and to avoid passing
in a ton of arguments, a single struct argument is used to handle
the variables previously local to the function.
|
|
|
|
| |
Mostly requires adding ** in either calls or method definitions.
|
| |
|
| |
|
|
|
|
| |
https://github.com/ruby/csv/commit/5ca8d79f60
|
|
|
|
|
|
| |
:write_empty_value (#87)
https://github.com/ruby/csv/commit/5923ee08b7
|
|
|
|
|
|
|
|
| |
* add document of strip
* modify typo
https://github.com/ruby/csv/commit/de0257dc31
|
|
|
|
|
|
|
|
| |
GitHub: fix #86
Reported by krororo. Thanks!!!
https://github.com/ruby/csv/commit/5a8d9d9297
|
|
|
|
|
|
|
|
| |
This includes performance improvements and backward incompatibility
fixes.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67560 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
| |
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66922 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
|
|
| |
This includes performance improvement especially writing. Writing is
about 2 times faster.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66507 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
| |
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64638 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
| |
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63364 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
If it will not use special variables (like $1, $&, $`...),
it can improve the performance by using Regexp#match? or String#match? instead of Regexp#=~ or String#=~.
This patch is same idea as https://github.com/ruby/ruby/pull/1836
[Fix GH-1842]
## Environment
* OS : Ubuntu 17.10
* Compiler : gcc version 7.2.0
* CPU : Intel(R) Core(TM) i5-3210M CPU @ 2.50GHz
* Memory : 16 GB
## TL;DR
Methods | Before | After | Speed up
----------- | ------ | ------ | --------
CSV.foreach | 44.825 | 48.201 | 7.5%
CSV#shift | 45.200 | 49.584 | 9.7%
CSV.read | 42.968 | 46.853 | 9.0%
CSV.table | 10.933 | 11.277 | 3.1%
## Before
```
Calculating -------------------------------------
CSV.foreach 44.825 (± 0.0%) i/s - 228.000 in 5.086576s
CSV#shift 45.200 (± 0.0%) i/s - 228.000 in 5.044297s
CSV.read 42.968 (± 0.0%) i/s - 216.000 in 5.027504s
CSV.table 10.933 (± 0.0%) i/s - 55.000 in 5.031098s
```
## After
```
Calculating -------------------------------------
CSV.foreach 48.201 (± 0.0%) i/s - 244.000 in 5.062256s
CSV#shift 49.584 (± 0.0%) i/s - 248.000 in 5.001652s
CSV.read 46.853 (± 0.0%) i/s - 236.000 in 5.037044s
CSV.table 11.277 (± 0.0%) i/s - 57.000 in 5.054694s
```
## Benchmark code
```ruby
require 'csv'
require 'benchmark/ips'
CSV.open("/tmp/file.csv", "w") do |csv|
csv << ["player", "gameA", "gameB"]
1000.times do
csv << ['"Alice"', "84.0", "79.5"]
csv << ['"Bob"', "20.0", "56.5"]
end
end
Benchmark.ips do |x|
x.report "CSV.foreach" do
CSV.foreach("/tmp/file.csv") do |row|
end
end
x.report "CSV#shift" do
CSV.open("/tmp/file.csv") do |csv|
while line = csv.shift
end
end
end
x.report "CSV.read" do
CSV.read("/tmp/file.csv")
end
x.report "CSV.table" do
CSV.table("/tmp/file.csv")
end
end
```
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62806 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
|
| |
* csv.gemspec: Update release version.
* lib/csv.rb: Remove superfluous private clause.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59849 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
| |
Reported by Eric Wong. Thank you.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59683 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
|
| |
includes the patch from marshall-lee.
close #1168
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59671 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
|
|
|
|
| |
* lib/csv.rb (CSV::Table#to_a, #to_csv): use Array#push instead of
Array#concat for performance improvement. This performance improvement is
proposed by zdennis <zach.dennis@gmail.com>. The patch is from
Mau Magnaguagno <maumagnaguagno@gmail.com>.
close #946
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59657 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
| |
[Bug #11126][ruby-core:69088]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59643 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|