How do I write a loop in ruby so that I can execute a block of code on each file?
I\'m new to ruby, and I\'ve concluded that the way to do this is a do each loop.
To skip . & .., you can use Dir::each_child.
.
..
Dir.each_child('/path/to/dir') do |filename| puts filename end
Dir::children returns an array of the filenames.