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

fix: info will break if e.g. Roo::CSV is initialized by stream object #544

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

TomFreudenberg
Copy link

@TomFreudenberg TomFreudenberg commented Oct 8, 2020

Summary

This is a bug fix for method Base::info when object is initialized by stream and not filename

require 'roo'

content = "Id;Name;Surname;Title\n"
(1..1000).each { |i| content << "#{i};John;Wick;Actor\n" }
content_io = StringIO.new(content)
spreadsheet = Roo::CSV.new(content_io, csv_options: { col_sep: ';' })
puts spreadsheet.info
spreadsheet.reload
puts spreadsheet.info

What happens without this fix:

  • info break to show filename
  • second output of info will show wrong information cause not rewinded

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant