Example given:
My path is (given by Dir.pwd) "D:/home/usr/documents/text files/2016"
What is a simple way to get the path without the last subfolder.
Result should be: "D:/home/usr/documents/text files"
Currently I do this path = Dir.pwd.reverse.partition("/")[-1].reverse
Works, but I guess I miss the better way.
Thanks in advance!