Skip to content

Instantly share code, notes, and snippets.

@HammerInTheNews
Created December 13, 2013 20:29
Show Gist options
  • Select an option

  • Save HammerInTheNews/7950843 to your computer and use it in GitHub Desktop.

Select an option

Save HammerInTheNews/7950843 to your computer and use it in GitHub Desktop.
Read all the lines of a text file into a list with some simple processing per line.
lines = File.new('foo.txt', 'r').collect() do |line|
line.strip()
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment