title: How can I create a zip file without temporary files in ruby?
body: <p>I create a zip file with some generated content (in other words: the files in the archive don't exist, the content is build in my script).</p>
  
  <p>I use a script similar to this:</p>
  
  <pre><code>#~ gem 'rubyzip', '=1.1.0'
  require 'zip/zip'
  
  zipname = 'test.zip'
  File.delete(zipname) if File.exists?(zipname) #delete previous version
  
  Zip::ZipFile.open(zipname, Zip::ZipFile::CREATE) do |zipfile|
    1.upto(100) do |i| #Just some testfiles with content
      zipfile.get_output_stream("%08i.txt" % i) do |output_entry_stream| #Filename
            output_entry_stream.write("Testcontent %08i" % i)            #generated content
          end
        sleep 1  #sleep some time to see the temporary files
    end   #testdocs
  end #ZipFile.open(zipname)
  </code></pre>
  
  <p>This works fine, I get my zip with the correct data inside.</p>
  
  <p>But during the zip creation I have a lot of temporary files. They are deleted when the zip is finished, but the files disturb me during the creation. And if the process raises an exception, then I have to delete them manual.</p>
  
  <p>I have this behaviour with Zip::VERSION 2.0.2 and 1.1.0 (using the gem rubyzip)</p>
  
  <ul>
  <li>Can I avoid this temporary files?</li>
  <li>If not: Can I determine a (temporary) folder for them?</li>
  </ul>