Mega Code Archive

 
Categories / Ruby / Development
 

Use gets method to read from standard input (text from your keyboard, by default)

#!/usr/bin/env ruby print "Who do you want to say hello to? " hello = gets puts "Hello, " + hello