Remove core Tempfile dependency (1.9.2-preview1 compat)
commit97e469fc3afb751618b8b9a7b364cb447aaf90dd
authorEric Wong <normalperson@yhbt.net>
Sun, 19 Jul 2009 23:38:16 +0000 (19 16:38 -0700)
committerEric Wong <normalperson@yhbt.net>
Sun, 19 Jul 2009 23:50:36 +0000 (19 16:50 -0700)
tree1c3fdba70ccd2f88e6471441a4c66335189eafae
parent7db0e317dee3514fd80cc0a97a9b78a7a893ec22
Remove core Tempfile dependency (1.9.2-preview1 compat)

With the 1.9.2preview1 release (and presumably 1.9.1 p243), the
Ruby core team has decided that bending over backwards to
support crippled operating/file systems was necessary and that
files must be closed before unlinking.

Regardless, this is more efficient than using Tempfile because:

  1) no delegation is necessary, this is a real File object

  2) no mkdir is necessary for locking, we can trust O_EXCL
     to work properly without unnecessary FS activity

  3) no finalizer is needed to unlink the file, we unlink
     it as soon as possible after creation.
lib/unicorn.rb
lib/unicorn/app/exec_cgi.rb
lib/unicorn/tee_input.rb
lib/unicorn/util.rb