title: ruby each_line comparison only returns last string
body: <p>Code:</p>
  
  <pre><code>class Comparer
  
  words = "asdf-asdf-e-e-a-dsf-bvc-onetwothreefourfive-bob-john"
  foundWords = []
  
  File.foreach('words.txt') do |line|
      substr = "#{line}"
      if words.include? substr
          puts "Found " + substr
          foundWords &lt;&lt; substr            
      end
  end
  
  wordList = foundWords.join("\n").to_s               
  puts "Words found: " + wordList
  
  end
  </code></pre>
  
  <p>words.txt:</p>
  
  <pre><code>one
  blah-blah-blah
  123-5342-123123
  onetwo
  onetwothree
  onetwothreefour
  </code></pre>
  
  <p>I'd like the code to return all instances of include?, however when the code is run, wordList only contains the last line of words.txt ("onetwothreefour".) Why don't the other lines in words.txt get factored?</p>