mkdtemp is a tiny little RubyGem that I use whenever I need to securely create temporary files or directories in Ruby. I’ve used it several times over the years, and the source code has been publicly available for some time, but it’s only now that I’ve actually published it as a gem for the first time.
From the docs, mkdtemp:
securely creates temporary directories. It is a wrapper for the mkdtemp() function in the standard C library.