MonkeeSage wrote:
> >      puts file
> >      traverse(root + '\\' + file) if File.directory?(root + '\\' + file)
>
> This is also not very portable. Better to use File.join(root, file)

You can also refactor that to this:

puts file = File.join(root, file) # assignment returns its value
 traverse(file) if File.directory?(file)