ruby / csv

CSV Reading and Writing
https://ruby.github.io/csv/
BSD 2-Clause "Simplified" License
178 stars 113 forks source link

Add contents summary to CSV::Table#inspect #229

Closed ericgpks closed 2 years ago

ericgpks commented 2 years ago

I thought that it is useful for us if this library has a function to return some rows results as a table. So changed the method to return a table with a header and rows.

esparta commented 2 years ago

I don't think is a good idea to change the signature and the return value of Table#inspect just to have a peek of data. If the user need that it may be a better idea to use Table#values_at(<range>), tho.

With this change there's a high risk some old scripts suddenly start to fail, some others (probably less) that was parsing or grep-ing the result will also fail.

kou commented 2 years ago

Thanks!