class Dir
Configure our temporary folder
Public Class Methods
tmpdir()
click to toggle source
# File lib/boxlet.rb, line 99 def Dir::tmpdir tmp = './tmp' if $SAFE > 0 tmp = @@systmpdir else for dir in [ENV['TMPDIR'], ENV['TMP'], ENV['TEMP'], @@systmpdir, '/tmp'] if dir and stat = File.stat(dir) and stat.directory? and stat.writable? tmp = dir break end rescue nil end File.expand_path(tmp) end end