Skip to content

Instantly share code, notes, and snippets.

@ilake
Created May 21, 2014 13:28
Show Gist options
  • Save ilake/ee4c40fb61e4e47a0d03 to your computer and use it in GitHub Desktop.
Save ilake/ee4c40fb61e4e47a0d03 to your computer and use it in GitHub Desktop.
# http://ruby.learncodethehardway.org/book/ex12.html
#http://stackoverflow.com/questions/318144/what-is-the-difference-between-include-and-require-in-ruby
- load, could use when file change, reload the file
- require, run the file, and track what will require
- inlcude, take method from module to another place.
- $LOAD_PATH, $: the load paths.
# http://ruby.learncodethehardway.org/book/ex13.html
- $0 the name of the ruby program being run
# http://ruby.learncodethehardway.org/book/ex14.html
- STDIN.gets
- That is because if there is stuff in ARGV, the default gets method tries to treat the first one as a file and read from that. To read from the user's input (i.e., stdin) in such a situation, you have to use it STDIN.gets explicitly.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment