Skip to content

Instantly share code, notes, and snippets.

@jdecuirm
Created December 17, 2014 02:48
Show Gist options
  • Save jdecuirm/99859fea2b2fb5b94b95 to your computer and use it in GitHub Desktop.
Save jdecuirm/99859fea2b2fb5b94b95 to your computer and use it in GitHub Desktop.
ARGV and gets.chomp
name, last_name = ARGV
print "Now we have your name and last name, can you help us providing your age? "
age = gets.chomp
print "Thanks, now will be helpful to have your favorite food: "
favorite_food = gets.chomp
puts "Hi #{name} #{last_name}, we now you are #{age} years old, and you love to eat #{favorite_food}"
Copy link

ghost commented Jul 27, 2015

Change gets.chomp to $stdin.gets.chomp on lines 4 and 6

Copy link

ghost commented Jul 27, 2015

Change gets.chomp to $stdin.gets.chomp on lines 4 and 6

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment