# Put some stuff into a file.open('sample_file', 'w') do |f| f.write("This is line one.\nThis is line two.")endopen('sample_file') { |f| f.readlines }# => ["This is line one.\n", "This is line two."]