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

Serializing to any output #3

Closed
ochko opened this issue Dec 14, 2011 · 2 comments
Closed

Serializing to any output #3

ochko opened this issue Dec 14, 2011 · 2 comments

Comments

@ochko
Copy link
Contributor

ochko commented Dec 14, 2011

Here is how I'm going to use it:

p = Axlsx::Package.new

# Do a lot of fun with worksheets
#....
#....

# Time to persist but not in filesystem, maybe db?
begin
  tmpfile = Tempfile.new("temporary.xlsx")
  p.serialize tmpfile.path
  save(File.read(tmpfile.path)
ensure
  File.unlink(tmpfile.path)
end

Last begin ... ensure ... end block is a big messy. It would be nice it was able to write something like:

save(p.serialize)

Thanks

@randym
Copy link
Owner

randym commented Dec 14, 2011

Ochko - please read the 'good practices' part here:
http://www.ruby-doc.org/stdlib-1.9.3/libdoc/tempfile/rdoc/Tempfile.html

@ochko
Copy link
Contributor Author

ochko commented Dec 14, 2011

Is it necessary to use external filesystem object to make zipped output?

@randym randym closed this as completed Dec 14, 2011
marshall-lee pushed a commit to marshall-lee/axlsx that referenced this issue Oct 2, 2019
Add caxlsx.rb to make auto require work
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

2 participants