For a given file name path, I need to get the folder one level before it. This can be accomplished in ruby with the following code:
File.dirname(File.dirname("/a/b/c.txt"))
=> "/a"
Independently from this exact case, how can I DRY two method calls in sequence?