title: How to split a directory string in Ruby?
body: <p>In ruby, I'm able to do</p>
  
  <pre><code>File.dirname("/home/gumby/bigproject/now_with_bugs_fixed/32/FOO_BAR_2096.results")
  </code></pre>
  
  <p>and get</p>
  
  <pre><code>"/home/gumby/bigproject/now_with_bugs_fixed/32"
  </code></pre>
  
  <p>but now I'd like to split up that directory string into the individual folder components, ie something like</p>
  
  <pre><code>["home", "gumby", "bigproject", "now_with_bugs_fixed", "32"]
  </code></pre>
  
  <p>Is there a way to do that other than using </p>
  
  <pre><code>directory.split("/")[1:-1]
  </code></pre>