Bugs: Browse | Submit New | Admin

[#26134] TMail::UNIXMbox ignores tmpdir

Date:
2009-06-04 16:10
Priority:
3
Submitted By:
Dean Brundage (brundage)
Assigned To:
Nobody (None)
Category:
None
State:
Open
Summary:
TMail::UNIXMbox ignores tmpdir

Detailed description
tmail-1.2.3.1/lib/tmail/mailbox.rb line 217

    def UNIXMbox.new( filename, tmpdir = nil, readonly = false )
      tmpdir = ENV['TEMP'] || ENV['TMP'] || '/tmp'

This effectively ignores the tmpdir parameter.  Developers love patches, even simple ones:

--- /usr/local/jruby-1.2.0/lib/ruby/gems/1.8/gems/tmail-1.2.3.1/lib/tmail/mailbox.rb    Thu Jun  4 10:52:47 2009
+++ mailbox.rb  Thu Jun  4 10:53:07 2009
@@ -215,7 +215,7 @@
     #  File.size?("../test/fixtures/mailbox")
     #  #=> nil
     def UNIXMbox.new( filename, tmpdir = nil, readonly = false )
-      tmpdir = ENV['TEMP'] || ENV['TMP'] || '/tmp'
+      tmpdir ||= ENV['TEMP'] || ENV['TMP'] || '/tmp'
       newobj(filename, "#{tmpdir}/ruby_tmail_#{$$}_#{rand()}", readonly, false)
     end

Add A Comment: Notepad

Please login


Followup

No Followups Have Been Posted

Attached Files:

Name Description Download
No Files Currently Attached

Changes:

No Changes Have Been Made to This Item