This thing also exists: http://www.ruby-doc.org/stdlib-2.1.1/libdoc/fileutils/rdoc/FileUtils.html#method-c-mkdir_p