title: Iterate through every file in one directory
body: <p>How do I write a loop in ruby so that I can execute a block of code on each file?</p>
  
  <p>I'm new to ruby, and I've concluded that the way to do this is a do each loop.<br>
  The ruby file will be executed from a different directory than the directory I want to loop through.</p>
  
  <p>I've tried the <code>Dir.foreach</code> and I couldn't get it to work.</p>