title: File.open, open and IO.foreach in Ruby, what is the difference?
body: <p>All of the following API do the same thing: open a file and call a block for each line. Is there any preference we should use one than another?</p>
  
  <pre><code>File.open("file").each_line {|line| puts line}
  open("file").each_line {|line| puts line}   
  IO.foreach("file") {|line | puts line}
  </code></pre>