fixing tempfile handling
Project: http://git-wip-us.apache.org/repos/asf/ode/repo Commit: http://git-wip-us.apache.org/repos/asf/ode/commit/82a053ee Tree: http://git-wip-us.apache.org/repos/asf/ode/tree/82a053ee Diff: http://git-wip-us.apache.org/repos/asf/ode/diff/82a053ee Branch: refs/heads/master Commit: 82a053eeb43c38808ceb30992452cd2906e462b1 Parents: 8d7427e Author: Tammo van Lessen <[email protected]> Authored: Tue May 14 01:58:15 2013 +0200 Committer: Tammo van Lessen <[email protected]> Committed: Tue May 14 01:58:15 2013 +0200 ---------------------------------------------------------------------- tasks/jbi.rake | 8 ++++++-- 1 files changed, 6 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ode/blob/82a053ee/tasks/jbi.rake ---------------------------------------------------------------------- diff --git a/tasks/jbi.rake b/tasks/jbi.rake index 9f57600..32562a3 100644 --- a/tasks/jbi.rake +++ b/tasks/jbi.rake @@ -76,10 +76,14 @@ class JBITask < Buildr::ZipTask when nil, true # Tempfiles gets deleted on garbage collection, so we're going to hold on to it # through instance variable not closure variable. - Tempfile.open("MANIFEST.MF") { |@jbi_xml_tmp| @jbi_xml_tmp.write descriptor } + @jbi_xml_tmp = Tempfile.new('MANIFEST.MF') + @jbi_xml_tmp.write descriptor + @jbi_xml_tmp.close path("META-INF").include @jbi_xml_tmp.path, :as=>"jbi.xml" when Proc, Method - Tempfile.open("MANIFEST.MF") { |@jbi_xml_tmp| @jbi_xml_tmp.write jbi_xml.call.to_s } + @jbi_xml_tmp = Tempfile.new('MANIFEST.MF') + @jbi_xml_tmp.write descriptor + @jbi_xml_tmp.close path("META-INF").include @jbi_xml_tmp.path, :as=>"jbi.xml" end end
