Get a temporary directory in Ruby with Dir.tmpdir
, or a unique one with Dir.mktmpdir
:
> require 'tmpdir'
= true
> Dir.tmpdir
= "/var/folders/gz/5xvm5fkx79bdr3bnbchj68980000gn/T"
> Dir.mktmpdir
= "/var/folders/gz/5xvm5fkx79bdr3bnbchj68980000gn/T/d20121019-72333-q6n2fm"