Help ruby noob write a hitEnterToContinue() method

i = 0
  @doc.traverse_text { |text|
    puts "#{i}: " + text.to_s.strip + "\n"
    i += 1
  }

  def hit_enter_to_continue
    gets s
    chomp
    if( $_ == "x")
      break
    end
  end

···

--
Posted via http://www.ruby-forum.com/.

Try using getch.

···

On Jul 15, 2007, at 07:40 , David Lam wrote:

i = 0
  @doc.traverse_text { |text|
    puts "#{i}: " + text.to_s.strip + "\n"
    i += 1
  }

  def hit_enter_to_continue
    gets s
    chomp
    if( $_ == "x")
      break
    end
  end

--
Wayne E. Seguin
Sr. Systems Architect & Systems Admin
wayneseguin@gmail.com