What\'s the difference between STDIN.gets() and gets.chomp() in Ruby? Aren\'t they both retrieving raw input from the user?
side question:
gets is actually Kernel#gets. It reads from files passed as arguments or, if no arguments are present, reads from standard input. If you want to read only from standard input, then you should be more explicit about it.
STDIN.gets
$stdin.gets
As for the conversion, I normally use String#to_i. It handles newlines just fine.