From: David Ishmael Date: 2006-03-25T02:58:37+09:00 Subject: Re: Console IO Perfect, thx! -----Original Message----- From: James Edward Gray II [mailto:james@grayproductions.net] Sent: Friday, March 24, 2006 12:53 PM To: ruby-talk ML Subject: Re: Console IO On Mar 24, 2006, at 11:36 AM, Daniel Harple wrote: > On Mar 24, 2006, at 6:31 PM, David Ishmael wrote: > >> Not to shanghai this convo (but its sort of on the same subject), >> is there a >> way to prompt for a response in-line with your question rather >> than printing >> the question and then having it go to the next line? > > Yes, either set $stdout.sync = true, or call $stdout.flush. Neither seem to be required: $ ruby -e 'print "Name? "; gets; puts "Hello #$_"' Name? James Hello James Ruby is a pretty clever girl. ;) James Edward Gray II