about summary refs log tree commit homepage
path: root/lib/unicorn/util.rb
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2010-10-05 07:54:13 +0000
committerEric Wong <normalperson@yhbt.net>2010-10-05 07:54:13 +0000
commit3d147e9bcd8f99c94900a00181692c2a09c3c3c9 (patch)
tree8b0ef9c7895e71c24f9c501ad6d32a3dd856925c /lib/unicorn/util.rb
parente184b9d0fb45b31d80645475e22f0bbbecd195f9 (diff)
downloadunicorn-3d147e9bcd8f99c94900a00181692c2a09c3c3c9.tar.gz
Unicorn::Util.tmpio => Unicorn::TmpIO.new
This is slightly shorter and hopefully easier to find.
Diffstat (limited to 'lib/unicorn/util.rb')
-rw-r--r--lib/unicorn/util.rb28
1 files changed, 0 insertions, 28 deletions
diff --git a/lib/unicorn/util.rb b/lib/unicorn/util.rb
index e9dd57f..8ebdf05 100644
--- a/lib/unicorn/util.rb
+++ b/lib/unicorn/util.rb
@@ -1,19 +1,9 @@
 # -*- encoding: binary -*-
 
 require 'fcntl'
-require 'tmpdir'
 
 module Unicorn
 
-  class TmpIO < ::File
-
-    # for easier env["rack.input"] compatibility
-    def size
-      # flush if sync
-      stat.size
-    end
-  end
-
   module Util
     class << self
 
@@ -78,24 +68,6 @@ module Unicorn
 
         nr
       end
-
-      # creates and returns a new File object.  The File is unlinked
-      # immediately, switched to binary mode, and userspace output
-      # buffering is disabled
-      def tmpio
-        fp = begin
-          TmpIO.open("#{Dir::tmpdir}/#{rand}",
-                     File::RDWR|File::CREAT|File::EXCL, 0600)
-        rescue Errno::EEXIST
-          retry
-        end
-        File.unlink(fp.path)
-        fp.binmode
-        fp.sync = true
-        fp
-      end
-
     end
-
   end
 end