title: How do I create directory if none exists using File class in Ruby?
body: <p>I have this statement:</p>
  
  <pre><code>File.open(some_path, 'w+') { |f| f.write(builder.to_html)  }
  </code></pre>
  
  <p>Where</p>
  
  <pre><code>some_path = "somedir/some_subdir/some-file.html"
  </code></pre>
  
  <p>What I want to happen is, if there is no directory called <code>somedir</code> or <code>some_subdir</code> or both in the path, I want it to automagically create it.</p>
  
  <p>How can I do that?</p>