Commit graph

63490 commits

Author SHA1 Message Date
Burdette Lamar
f89186aebb
[ruby/csv] Add document for CSV.instance (#136)
Co-authored-by: Sutou Kouhei <kou@cozmixng.org>
85e293c1ba
2020-07-20 02:32:52 +09:00
Burdette Lamar
1ac702cd29
[ruby/csv] Add RDoc links for delegated methods (#135)
1a4b96b418
2020-07-20 02:32:52 +09:00
Koichi ITO
08e70126ae
[ruby/csv] Add invalid: :replace for CSV.open (#130)
This PR adds `invalid: :replace` for `CSV.open`. It is a PR similar to #129.
5bf687341c
2020-07-20 02:32:52 +09:00
Koichi ITO
cee10c1b70
[ruby/csv] Fix an error for CSV.open (#131)
Follow up to https://github.com/ruby/csv/pull/130/files#r434885191.

This PR fixes `ArgumentError` for `CSV.open` when processing
invalid byte sequence in UTF-8.
a4b528c209
2020-07-20 02:32:52 +09:00
Koichi ITO
4e33a87879
[ruby/csv] Add undef: :replace for CSV.open (#129)
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.
cff8b18480
2020-07-20 02:32:51 +09:00
Burdette Lamar
cf8157e001
[ruby/csv] RDoc for foreach, generate (#127)
* Rdoc for foreach

* Enhanced Rdoc for CSV.generate
8c26c0ab1f
2020-07-20 02:32:51 +09:00
Sutou Kouhei
731c0eb44d
[ruby/csv] Bump version
c6577e5b6e
2020-07-20 02:32:51 +09:00
Burdette Lamar
9e6d54a501
[ruby/csv] Enhanced Rdoc (#124)
* 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
0d42df39cb
2020-07-20 02:32:51 +09:00
Sutou Kouhei
e3808c5aca
[ruby/csv] Add missing document files to .gem
GitHub: fix GH-125

Reported by joast. Thanks!!!

bf41fa94cf
2020-07-20 02:32:51 +09:00
Sutou Kouhei
71bee3819f
[ruby/csv] Bump version
936f15f3cd
2020-07-20 02:32:50 +09:00
Sutou Kouhei
1822b19221
[ruby/csv] Don't drop stack trace in CSV.parse_line
GitHub: fix GH-120

Reported by Kyle d'Oliveira. Thanks!!!

2959483f90
2020-07-20 02:32:50 +09:00
Sutou Kouhei
cf7e472ab4
[ruby/csv] test scanner: specify encoding explicitly
6e83a1de9c
2020-07-20 02:32:50 +09:00
Sutou Kouhei
b8084b5cb4
[ruby/csv] Fix a bug that write_nil_value or write_empty_value don't work with non String
GitHub: fix GH-123

Reported by asm256. Thanks!!!

b4492139be
2020-07-20 02:32:50 +09:00
Sutou Kouhei
5359121a56
[ruby/csv] Revert "test: use binary mode explicitly for Ruby 2.7"
This reverts commit 736174d28413a4c36630b0daf2f170c8d2fc9abe.

It doesn't solve anything.

0ee3bdd0d3
2020-07-20 02:32:50 +09:00
Sutou Kouhei
0ee5578e8c
[ruby/csv] test: use binary mode explicitly for Ruby 2.7
736174d284
2020-07-20 02:32:50 +09:00
Burdette Lamar
6ba1abd40c
[ruby/csv] Enhanced Rdoc for CSV (#122)
cd670595d5
2020-07-20 02:32:50 +09:00
Sutou Kouhei
033514c62f
[ruby/csv] Bump version
edc6cb9022
2020-07-20 02:32:49 +09:00
Sutou Kouhei
814bfc8adc
[ruby/csv] Fix a parse bug when split character exists in middle of column value
GitHub: fix #115

Reported by TOMITA Masahiro. Thanks!!!

398b3564c5
2020-07-20 02:32:49 +09:00
TOMITA Masahiro
aeac7db823
[ruby/csv] Fix docs for :strip option (#114)
fb10925271
2020-07-20 02:32:49 +09:00
Seiei Miyagi
3c5b67e0db
[ruby/csv] Ensuring StringIO's encoding in CSV.generate (#111)
dbf55ef008
2020-07-20 02:32:49 +09:00
Mike MacDonald
d57bc03ba9
[ruby/csv] Do not loop forever when skip_lines regexp matches zero length with anchors (#110)
* Do not loop forever when skip_lines regexp matches zero length with anchors

* Remove needless white spaces

* Add missing eos check in skip_needless_lines

* Simplify test

3b15d4a3e8
2020-07-20 02:32:49 +09:00
Jim Kane
b219cd5ac3
[ruby/csv] Make CSV::Row#dup return a usable Row (#108)
* Make CSV::Row#dup return a usable Row

Previously, calling `dup` on a `CSV::Row` object yielded an object whose
copy was too shallow. Changing the clone's fields would also change the
fields on the source. This change makes the clone more distinct from the
source, so that changes can be made to its fields without affecting the
source.

* Simplify

64a1ea06fc
2020-07-20 02:32:49 +09:00
Sutou Kouhei
9141aae8c2
[ruby/csv] Suppress warnings
b37df55f46
2020-07-20 02:32:49 +09:00
Sutou Kouhei
172cfce6dc
[ruby/csv] Bump version
284ce810bc
2020-07-20 02:32:48 +09:00
Nobuyoshi Nakada
d03a7c6a25
Revert "test/csv/write/test_general.rb: suppress warnings"
This reverts commit 375cf12918, to
sync csv from the upstream.
2020-07-20 02:32:48 +09:00
Jeremy Evans
05bf811c28 Special case Range#max for integer beginning and Float::Infinity end
Popular Ruby libraries such as Rails and Rubocop relying on the
previous behavior, even though it is technically a bug. The
correct behavior is probably raising RangeError, since that is what
an endless range raises.

Related to [Bug #17017]
2020-07-19 10:25:55 -04:00
Nobuyoshi Nakada
d637208abd
Fixed a typo 2020-07-19 23:13:21 +09:00
git
2eaa53e9a3 * 2020-07-19 [ci skip] 2020-07-19 01:19:01 +09:00
Michael Kohl
8a5ad2b77d
Fix Range#max for beginless Integer ranges [Bug #17034]
* Fix Range#max for beginless Integer ranges
* Update test/ruby/test_range.rb
* Fix formatting

https://github.com/ruby/ruby/pull/3328

Co-authored-by: Nobuyoshi Nakada <nobu@ruby-lang.org>
2020-07-19 01:18:40 +09:00
Kenta Murata
b4e784434c
Optimize Array#min (#3324)
The benchmark result is below:

|                |compare-ruby|built-ruby|
|:---------------|-----------:|---------:|
|ary2.min        |     39.105M|   39.442M|
|                |           -|     1.01x|
|ary10.min       |     23.995M|   30.762M|
|                |           -|     1.28x|
|ary100.min      |      6.249M|   10.783M|
|                |           -|     1.73x|
|ary500.min      |      1.408M|    2.714M|
|                |           -|     1.93x|
|ary1000.min     |    828.397k|    1.465M|
|                |           -|     1.77x|
|ary2000.min     |    332.256k|  570.504k|
|                |           -|     1.72x|
|ary3000.min     |    338.079k|  573.868k|
|                |           -|     1.70x|
|ary5000.min     |    168.217k|  286.114k|
|                |           -|     1.70x|
|ary10000.min    |     85.512k|  143.551k|
|                |           -|     1.68x|
|ary20000.min    |     43.264k|   71.935k|
|                |           -|     1.66x|
|ary50000.min    |     17.317k|   29.107k|
|                |           -|     1.68x|
|ary100000.min   |      9.072k|   14.540k|
|                |           -|     1.60x|
|ary1000000.min  |     872.930|    1.436k|
|                |           -|     1.64x|

compare-ruby is 9f4b7fc82e.
2020-07-18 23:45:25 +09:00
Kenta Murata
a63f520971
Optimize Array#max (#3325)
The benchmark result is below:

|                |compare-ruby|built-ruby|
|:---------------|-----------:|---------:|
|ary2.max        |     38.837M|   40.830M|
|                |           -|     1.05x|
|ary10.max       |     23.035M|   32.626M|
|                |           -|     1.42x|
|ary100.max      |      5.490M|   11.020M|
|                |           -|     2.01x|
|ary500.max      |      1.324M|    2.679M|
|                |           -|     2.02x|
|ary1000.max     |    699.167k|    1.403M|
|                |           -|     2.01x|
|ary2000.max     |    284.321k|  570.446k|
|                |           -|     2.01x|
|ary3000.max     |    282.613k|  571.683k|
|                |           -|     2.02x|
|ary5000.max     |    145.120k|  285.546k|
|                |           -|     1.97x|
|ary10000.max    |     72.102k|  142.831k|
|                |           -|     1.98x|
|ary20000.max    |     36.065k|   72.077k|
|                |           -|     2.00x|
|ary50000.max    |     14.343k|   29.139k|
|                |           -|     2.03x|
|ary100000.max   |      7.586k|   14.472k|
|                |           -|     1.91x|
|ary1000000.max  |     726.915|    1.495k|
|                |           -|     2.06x|
2020-07-18 23:45:00 +09:00
Nobuyoshi Nakada
9f60ceec54 Suppress bell during the test 2020-07-18 19:33:11 +09:00
git
6f5f15f1e4 * 2020-07-18 [ci skip] 2020-07-18 08:37:44 +09:00
Masataka Pocke Kuwabara
8d2333019a Fix MonitorMixin when the super's initialize has kwargs 2020-07-17 16:37:18 -07:00
卜部昌平
1fb4e28002 skip inlining cexpr! that are not attr! inline
Requested by ko1.
2020-07-16 11:49:09 +09:00
git
5d5b8a33f6 * 2020-07-16 [ci skip] 2020-07-16 10:44:19 +09:00
Samuel Williams
238464863a Remove fiber HTTP test.
The HTTP test hits a remote website which isn't always available and is
not self-contained. Ideally we will rewrite this test with an internal
web server.
2020-07-16 13:43:56 +12:00
Nobuyoshi Nakada
9f4b7fc82e
Check warning flags only if available to run with old versions 2020-07-15 23:33:24 +09:00
Nobuyoshi Nakada
579645d9f8
Fixed infinite loop at error in printing cause [Bug #17033] 2020-07-15 21:39:20 +09:00
Nobuyoshi Nakada
79d06483a8
Close sockets if blocking to fix leaked fds 2020-07-15 16:36:57 +09:00
David Rodríguez
5783d0dbfc Import remaining changes
The "sync with commits" scripts failed to properly import these for some
reason.
2020-07-15 16:05:12 +09:00
David Rodríguez
0c8d90b526 [rubygems/rubygems] Unswallow Gem::Package::FormatError
This error happen in a CI run, and as it is currently, it doesn't give
any useful information about the underlying cause. Let's not swallow the
original error.

8c17ba2f45
2020-07-15 16:05:12 +09:00
David Rodríguez
1f7195421e [rubygems/rubygems] July man pages
58d9a3de5b
2020-07-15 16:05:12 +09:00
Utkarsh Gupta
fd709382b6 [rubygems/rubygems] Tag the specs with :readline
The newly added specs needs to be tagged as
:readline, otherwise they fail on Windows with
the backtrace: `ZeroDivisionError: divided by 0`.

Such issues are already being skipped on Windows.

Signed-off-by: Utkarsh Gupta <utkarsh@debian.org>

391f860af4
2020-07-15 16:05:12 +09:00
Utkarsh Gupta
c44c7019b5 [rubygems/rubygems] Add tests with different flag combinations
Since this PR was made because we missed checking
RuboCop offenses with different flags, therefore
adding tests so that all flag combinations are
tested.

Signed-off-by: Utkarsh Gupta <utkarsh@debian.org>

d08250efc2
2020-07-15 16:05:12 +09:00
David Rodríguez
4f9c673cab [rubygems/rubygems] Allow setting a tag prefix to be used by gem release tasks
679008f23a
2020-07-15 16:05:12 +09:00
Utkarsh Gupta
ca133c0366 [rubygems/rubygems] Fix line spacing to make Layout/EmptyLines happy
The Gemfile wasn't properly put in the last commit.
As a result, Layout/EmptyLines inspected an offense
in the Gemfile.

This also fixes the spec w.r.t change in the task
default.

Signed-off-by: Utkarsh Gupta <utkarsh@debian.org>

d1418fddd3
2020-07-15 16:05:12 +09:00
Utkarsh Gupta
95f90e3d2b [rubygems/rubygems] Add blank lines to make Bundler/OrderedGems happy
If the blank lines aren't used, then rubocop tries to
sort them in alphabetical order within their section.
Thus, adding lines so rubocop considers them as
different sections and doesn't try to sort them.

Signed-off-by: Utkarsh Gupta <utkarsh@debian.org>

cf44b18f0f
2020-07-15 16:05:12 +09:00
Utkarsh Gupta
281898ed6c [rubygems/rubygems] Fix Rakefile to make Style/SymbolArray happy
In case of multiple Rake tasks, the default tasks would
look something like this:
`task default: [:spec, :rubocop]`

Instead, they should use %i and look something like this:
`task default: %i[spec rubocop]`

Signed-off-by: Utkarsh Gupta <utkarsh@debian.org>

487ecd59ce
2020-07-15 16:05:12 +09:00
Utkarsh Gupta
8c65f612f4 [rubygems/rubygems] Fix remaining RuboCop issues
With #3731 and #3740 merged, this covers up the
remaining part of the issues.
This was discovered when one tries to create a gem
with a different framework.
Could be reproduced with:
`bundle gem foo --ext --test=test-unit`

Signed-off-by: Utkarsh Gupta <utkarsh@debian.org>

51b6457150
2020-07-15 16:05:12 +09:00