lib/astrails/safe/tmp_file.rb in astrails-safe-0.1.10 vs lib/astrails/safe/tmp_file.rb in astrails-safe-0.2.0

- old
+ new

@@ -7,10 +7,29 @@ def self.tmproot @tmproot ||= Dir.mktmpdir end def self.cleanup - FileUtils.remove_entry_secure tmproot + begin + FileUtils.remove_entry_secure tmproot + rescue ArgumentError => e + if e.message =~ /parent directory is world writable/ + puts <<-ERR + + +******************************************************************************** +It looks like you have wrong permissions on your TEMP directory. The usual +case is when you have world writable TEMP directory withOUT the sticky bit. + +Try "chmod +t" on it. + +******************************************************************************** + +ERR + else + raise + end + end @tmproot = nil end def self.create(name) # create temp directory