Pathname

Append to a pathname

downloads_dir = Pathname.new(ENV['HOME']).join('Downloads')

Get files/folders of a directory as an array

Pathname.new(ENV['HOME']).join('Downloads').children

Get basename (ie. all leaf nodes of a path)

Pathname.new(ENV['HOME']).basename