Ruby [has a tempfile module](http://www.rubytips.org/2008/01/11/using-temporary-files-in-ruby-tempfilenew/).