Learn different ways to read a file in Ruby, including slurping it, streaming it, using File.new, File.open, and File.read. Discover the advantages of treating a file as a stream.
Table of contents
TL; DRUsing File.newUsing File.openUsing File.readReading All LinesRead Large Files as StreamsBonus: File is an EnumerableSort: