Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update lib/ruby/stdlib/csv.rb to 2.5 #5040

Closed
wants to merge 17 commits into from
Closed

Update lib/ruby/stdlib/csv.rb to 2.5 #5040

wants to merge 17 commits into from

Conversation

esparta
Copy link

@esparta esparta commented Feb 13, 2018

Semi-automatic update trying to preserve the history on MRI .

I checked the spec and theoretically should not be affected nor need to update with upstream.

hsbt and others added 17 commits February 13, 2018 00:36
  [Feature #11865][ruby-core:72452][fix ruby/ruby#1170]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58743 b2dd03c8-39d4-4d8f-98ff-823fe69b080e

Signed-off-by: Espartaco Palma <esparta@gmail.com>
  Patch by @cllns. [Fix ruby/ruby#957]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58744 b2dd03c8-39d4-4d8f-98ff-823fe69b080e

Signed-off-by: Espartaco Palma <esparta@gmail.com>
  [Bug #12373][ruby-core:75462]
  Patch by Yuki Kurihara.

  Benchmark:
  ```
  Warming up --------------------------------------
           csv_shift     1.000  i/100ms
       new_csv_shift     1.000  i/100ms
Calculating -------------------------------------
           csv_shift      1.192  (± 0.0%) i/s -      6.000  in 5.034250s
       new_csv_shift      1.527  (± 0.0%) i/s -      8.000  in 5.243446s

Comparison:
       new_csv_shift:        1.5 i/s
           csv_shift:        1.2 i/s - 1.28x  slower
  ```

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58770 b2dd03c8-39d4-4d8f-98ff-823fe69b080e

Signed-off-by: Espartaco Palma <esparta@gmail.com>
  Patch by @joshpencheon (Josh Pencheon)
  [fix ruby/ruby#1607]

  #### benchmark-ips results
  ```
  trunk:
  Warming up --------------------------------------
                         4.000  i/100ms
  Calculating -------------------------------------
                         39.661  (±10.1%) i/s -      2.352k in 60.034781s
  with-patch:
  Warming up --------------------------------------
                         5.000  i/100ms
  Calculating -------------------------------------
                         60.521  (± 9.9%) i/s -      3.595k in 60.047157s
  ```

  #### memory_profiler resuts

  ```
  trunk:
  allocated memory by class
  -----------------------------------
    35588490  String
     7454320  Array
      294000  MatchData
       37340  Regexp
       11840  Hash
        2400  CSV
        1600  Proc
        1280  Method
         800  StringIO
  with-patch:
  allocated memory by class
  -----------------------------------
    18788490  String
     3454320  Array
      294000  MatchData
       37340  Regexp
       11840  Hash
        2400  CSV
        1600  Proc
        1280  Method
         800  StringIO
  ```

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58777 b2dd03c8-39d4-4d8f-98ff-823fe69b080e

Signed-off-by: Espartaco Palma <esparta@gmail.com>
Use character class directly instead of
character class in character class.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58827 b2dd03c8-39d4-4d8f-98ff-823fe69b080e

Signed-off-by: Espartaco Palma <esparta@gmail.com>
* lib/ruby/stdlib/csv.rb (CSV::Row#to_hash): use Array#to_h

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59426 b2dd03c8-39d4-4d8f-98ff-823fe69b080e

Signed-off-by: Espartaco Palma <esparta@gmail.com>
* lib/ruby/stdlib/csv.rb: usb keyword parameters to receive options

* test/csv/test_features.rb: remove a test for checking options

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59428 b2dd03c8-39d4-4d8f-98ff-823fe69b080e

Signed-off-by: Espartaco Palma <esparta@gmail.com>
* lib/ruby/stdlib/csv.rb: fix incompatibility introduced in r59428.
              CSV.new takes options as keyword arguments.

* test/csv/test_features.rb: add a test to ensure it raises error againt
                             unknown options

* test/csv/test_features.rb: add a test to ensure row_sep option is properly
                             applied

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59437 b2dd03c8-39d4-4d8f-98ff-823fe69b080e

Signed-off-by: Espartaco Palma <esparta@gmail.com>
  It ignored all of lines when given Regexp special characters.

  [Feature #9147][ruby-core:58549]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59639 b2dd03c8-39d4-4d8f-98ff-823fe69b080e

Signed-off-by: Espartaco Palma <esparta@gmail.com>
  [Bug #9988][ruby-core:63375]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59640 b2dd03c8-39d4-4d8f-98ff-823fe69b080e

Signed-off-by: Espartaco Palma <esparta@gmail.com>
…t table method.

  [Bug #12422][ruby-core:75707]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59641 b2dd03c8-39d4-4d8f-98ff-823fe69b080e

Signed-off-by: Espartaco Palma <esparta@gmail.com>
  [Bug #10504][ruby-core:66240]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59642 b2dd03c8-39d4-4d8f-98ff-823fe69b080e

Signed-off-by: Espartaco Palma <esparta@gmail.com>
  [Bug #11126][ruby-core:69088]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59643 b2dd03c8-39d4-4d8f-98ff-823fe69b080e

Signed-off-by: Espartaco Palma <esparta@gmail.com>
* lib/ruby/stdlib/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 ruby/ruby#946

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59657 b2dd03c8-39d4-4d8f-98ff-823fe69b080e

Signed-off-by: Espartaco Palma <esparta@gmail.com>
…he patch from marshall-lee. close ruby/ruby#1168

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59671 b2dd03c8-39d4-4d8f-98ff-823fe69b080e

Signed-off-by: Espartaco Palma <esparta@gmail.com>
  Reported by Eric Wong. Thank you.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59683 b2dd03c8-39d4-4d8f-98ff-823fe69b080e

Signed-off-by: Espartaco Palma <esparta@gmail.com>
  * csv.gemspec: Update release version.
  * lib/ruby/stdlib/csv.rb: Remove superfluous private clause.
  * upstream changeset: ruby/csv#3

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59849 b2dd03c8-39d4-4d8f-98ff-823fe69b080e

Signed-off-by: Espartaco Palma <esparta@gmail.com>
@esparta esparta mentioned this pull request Feb 14, 2018
75 tasks
@kares
Copy link
Member

kares commented Feb 18, 2018

believe this has been done at: ef5e53a#diff-12ef7a6694696218e75a02514e323f85

ask around at IRC if you're into a similar effort - the stdlib git history isn't relevant that much

@headius
Copy link
Member

headius commented Feb 20, 2018

@esparta I am interested in better ways to manage our copy of stdlib.

As it stands right now, we pull from a forked copy of CRuby at https://github.com/jruby/ruby. The patches we apply on top of stdlib are rolled forward each time we update, but we baseline from the actual CRuby repo every time.

A submodule might be an option, or a synchronized subtree like we do for spec/ruby.

There's a bit of massaging to get everything from CRuby into place for JRuby (e.g. we don't have an ext dir so those need to get condensed into lib/ruby/stdlib).

We may not actually want MRI's commit messages in our history either, and having the build basically just pull a known version of CRuby, apply a patch, and copy things into place seems like the cleanest option to me right now.

@headius headius closed this Feb 20, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants