From: RichardOnRails Date: 2010-02-02T07:30:08+09:00 Subject: Re: Workaround for "conflict" between ARGV and gets? On Feb 1, 1:34 am, Jeff Peng wrote: > 在 2010-02-01一的 13:15 +0900,RichardOnRails写道: > > > gets looks to ARGV, if populated, for its source of data.  That is its > > documented behavior. > > I changed the script to: > > dir=ARGV[0] > ARGV.clear > puts "Delete indicated item [yes, no]" > STDOUT.flush > response = gets.chomp   # doesn't go to STDIN !!! > puts case response >   when /^yes$/i; "Deleting" >   when /^no$/i; "Quiting" >   else; "Huh?" >   end > puts "EOJ" > > It works fine for me. > > $ ruby pause.rb 323 > Delete indicated item [yes, no] > yes > Deleting > EOJ > > -- > Jeff Peng > Email: jeffp...@netzero.net > Skype: compuperson >> ARGV.clear Excellent. My heavy-handed method pales in light of your solution. Many thanks, Jeff - Richard