How to get a temp directory in any OS with Ruby
I needed this over the weekend and the existing online help is less than helpful. As it turns out, just like with everything I try to do in Ruby, the solution is simple.
require 'tmpdir'
temp = Dir.tmpdir()
puts temp #C:/Users/Robert/AppData/Local/Temp
This is all built into Ruby, you don't need to install any gems or anything.
Subscribe for Free
Want to stay ahead of the curve? Subscribe now to receive the latest updates, actionable insights, and thought-provoking ideas around business, technology, and leadership straight to your inbox.