Ruby's Dir vs File vs Pathname?

Viewed 9575

What is the difference between Ruby's Dir, File, and Pathname classes? They seem to share common methods like basename, dirname, glob, and join. When is using one advantageous over the other?

Pathname seems particularly peculiar when comparing its functionality to Dir and File.

3 Answers
Related