Skip to content

Instantly share code, notes, and snippets.

Created October 30, 2015 12:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/4ab7572a24e7829120d1 to your computer and use it in GitHub Desktop.
Save anonymous/4ab7572a24e7829120d1 to your computer and use it in GitHub Desktop.
Ruby the hard way executed
ruby test.rb foo.txt
First let's print the whole file:
foo
bar
baz
Now let's rewind, kind of like a tape.
Let's print three lines:
1, foo
2, bar
3, baz
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment