Ruby Command Line
October 31, 2013
Today really quick I went through some of ruby tutorials on learn to code the hard way. Here are some of the things I learned:
printis different thanputsin that it doesn’t output a newline character.- use the
getscommand to gather input from the user. - use the
gets.chompcommand to remove the newline that gets added. - use
ARGVto get input from the command prompt. - use the
STDIN.gets.chompcommand if you are using ARGV. - use
File.open()to open files.