Mega Code Archive

 
Categories / Ruby / File Directory
 

The second parameter r defines that youre opening the file for reading

File.new("text.txt", "r").each { |line| puts line }