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
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions lib/roo/base.rb
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ def empty?(row, col, sheet = default_sheet)
# this document.
def info
without_changing_default_sheet do
result = "File: #{File.basename(@filename)}\n"\
result = is_stream?(@filename) ? "Content: stream\n" : "File: #{File.basename(@filename)}\n"\
"Number of sheets: #{sheets.size}\n"\
"Sheets: #{sheets.join(', ')}\n"
n = 1
Expand Down Expand Up @@ -456,7 +456,8 @@ def without_changing_default_sheet
end

def reinitialize
initialize(@filename)
@filename.rewind if is_stream?(@filename)
initialize(@filename, @options)
end

def find_basename(filename)
Expand Down