roo-rb / roo

Roo provides an interface to spreadsheets of several sorts.
MIT License
2.78k stars 503 forks source link

Fix some ruby 2.7 deprecations #540

Closed zubin closed 4 years ago

zubin commented 4 years ago

Summary

Currently the following deprecation warning is produced when using ruby 2.7:

~/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/roo-2.8.3/lib/roo/csv.rb:96:
warning: Using the last argument as keyword parameters is
deprecated; maybe ** should be added to the call
~/.rbenv/versions/2.7.1/lib/ruby/2.7.0/csv.rb:508: warning: The
called method `foreach' is defined here

The following code (in master) addresses the deprecation:

https://github.com/roo-rb/roo/blob/573d02e3997df9c6a03fafc03125635819c1a769/lib/roo/csv.rb#L105-L111

This PR applies the same change to other methods.

taichi-ishitani commented 4 years ago

~/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/roo-2.8.3/lib/roo/csv.rb:96: warning: Using the last argument as keyword parameters is deprecated; maybe ** should be added to the call ~/.rbenv/versions/2.7.1/lib/ruby/2.7.0/csv.rb:508: warning: The called method `foreach' is defined here

I think these warnings have already been fixed by #530

taichi-ishitani commented 4 years ago

In addition, #each_row_using_tempdir and #csv_foreach methods have no keyword argument. Therefore, I think changes of 5e4701ca5bb5cad7c2019534d16a7e1bce77154c are not necessary.

zubin commented 4 years ago

Ok cheers. In that case a version bump would be good.