Just noticed ANOTHER standard Ruby extension that bears on this subject.
With a path to the local standard Ruby lib dir pushed into the $LOAD_PATH array, you add the following to your module:
require('tmpdir.rb')
This standard extension adds the class methods:
Dir::tmpdir and Dir::mktmpdir
If you read the file, you'll recognize the Dir::tmpdir method as the 'progenitor' of the edition in the Google 'webtextures_loader.rb' file. (Google "lifted" it, and stripped out the Win32 specific part.)
So (above) when we talked about whether to rely on the WebTextures plugin, my advice is, to instead rely on the Standard Ruby library.