about summary refs log tree commit homepage
path: root/lib/yahns/tmpio.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/yahns/tmpio.rb')
-rw-r--r--lib/yahns/tmpio.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/yahns/tmpio.rb b/lib/yahns/tmpio.rb
index d25d5e8..ca86b4e 100644
--- a/lib/yahns/tmpio.rb
+++ b/lib/yahns/tmpio.rb
@@ -12,10 +12,10 @@ class Yahns::TmpIO < File # :nodoc:
   # creates and returns a new File object.  The File is unlinked
   # immediately, switched to binary mode, and userspace output
   # buffering is disabled
-  def self.new(tmpdir = Dir.tmpdir)
+  def self.new(dir)
     retried = false
     begin
-      fp = super("#{tmpdir}/#{rand}", RDWR|CREAT|EXCL|APPEND, 0600)
+      fp = super("#{dir || Dir.tmpdir}/#{rand}", RDWR|CREAT|EXCL|APPEND, 0600)
     rescue Errno::EEXIST
       retry
     rescue Errno::EMFILE, Errno::ENFILE