Merge pull request #12 from dmbates/master

Use a thunk to cause outfile to be closed
pull/17/head
Matti Pastell 2014-12-02 20:55:59 +02:00
commit d65cd9dfe5
1 changed files with 3 additions and 3 deletions

View File

@ -49,11 +49,11 @@ function weave(source ; doctype = "pandoc", plotlib="PyPlot", informat="noweb",
parsed = read_noweb(source)
executed = run(parsed)
formatted = format(executed, doctype)
outname = "$(report.cwd)/$(report.basename).$(formatdict[:extension])"
@show outname
outfile = open(outname, "w")
write(outfile, join(formatted, "\n"))
open(outname, "w") do io
write(io, join(formatted, "\n"))
end
info("Report weaved to $(report.basename).$(formatdict[:extension])")
end