title: Copy a file, creating directories as necessary in Ruby
body: <p>Let's say I have a file at <code>/source.txt</code>, and I want to copy it to <code>/a/b/c.txt</code>. <code>/a</code> and <code>/a/b</code> may or may not exist.</p>
  
  <p>Is there a way to copy the file and have it create the necessary parent directories if necessary?</p>
  
  <p>Ideally this would be one command. In particular, I'd like to avoid parsing the file/directory parts of destination path and then manually calling <code>FileUtils.mkdir_p</code> and <code>FileUtils.cp</code>.</p>
  
  <p>Pure Ruby is preferred, though a Rails-dependent solution is acceptable.</p>