Given I have a relative path pointing to a directory how can I use it with Ruby's Pathname or File library to get the directory itself?
p = Pathname.new('dir/')
p.dirname => .
p.directory? => false
I have tried './dir/', 'dir/', 'dir'.
What I want is p.dirname to return 'dir'. I do not want point to another file or directory within 'dir'.
You need add another level like
now the directory name is "dir"