Created
March 2, 2018 15:14
-
-
Save dvrensk/4d28cfb453c1000f98ba774cf44be937 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def xls(name: "Workbook-#{Time.current.strftime("%Y-%m-%d--%H-%M-%S")}.xlsx") | |
package = Axlsx::Package.new | |
sheet = package.workbook.add_worksheet(name: "Sheet 1") | |
yield sheet | |
package.serialize(name) | |
system("open", name) if RUBY_PLATFORM.match("darwin") | |
name | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment