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

Opening an IO stream or a file ? #75

Closed
housekeeper opened this issue Sep 27, 2013 · 3 comments
Closed

Opening an IO stream or a file ? #75

housekeeper opened this issue Sep 27, 2013 · 3 comments

Comments

@housekeeper
Copy link

Hi,

In CSV we have the facility to open an IO stream or a file

# raw data could also be an uploaded file 
# which remains in memory
raw_data = File.open(file).read 
csv_data = CSV.new(raw_data)

or

CSV.open(file)
# etc etc

Is it possible to just give roo an IO stream if I can specify its type and parse?
I want to open excel based files without hitting the file system is this possible

Many thanks in advance.

Kind regards,
Carl

@stevendaniels
Copy link
Contributor

Is anyone still interested in this feature?

@ricktessner
Copy link

I would definitely be interested in something like this. Would be very handy to create a placeholder object that has the same interface as a Roo::CSV instance.

For instance, right now, I'm wanting a default instance of Roo::CSV.new(StringIO.new('')). The current code is using a default value of nil which naturally trickles up to elsewhere in the code throwing an "undefined method ... for nil:NilClass".

Being able to create, in effect, a null object that responds to the Roo::CSV interface would be helpful.

afn pushed a commit to amitree/roo that referenced this issue May 1, 2015
afn pushed a commit to amitree/roo that referenced this issue May 1, 2015
Fixes roo-rb#75 allow Roo::Excelx to open streams
simonoff added a commit that referenced this issue May 7, 2015
Fixes #75 allow Roo::Excelx to open streams
@sdistefano
Copy link

This fix doesn't work for ROO::CSV yet

@stevendaniels stevendaniels reopened this Jul 8, 2015
stevendaniels added a commit to stevendaniels/roo that referenced this issue Feb 2, 2016
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

No branches or pull requests

4 participants