New to Ruby. I'm trying to figure out how to grab the name of a folder. I have this:
path = Dir["#{some_base_path}/*/*"]
Which gives me something like this:
path: ["/tmp/animals/cats/Fluffy"]
What I want is to know the name of the last subfolder - in this case Fluffy.
I've tried variations of Pathname and File.basename, but I always run into no implicit conversion of Array into String (TypeError) errors.
What would be the best way to do this?`