Help ruby noob write a hitEnterToContinue() method

its like this... where the follow code in my main prints out large text
files

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

              << WANT TO HIT ENTER HERE TO STOP PRINTS FOR DEBUGGING >>
  }

  def hit_enter_to_continue
    gets s
    chomp
    if( $_ == "x")
      break
    end
  end
</CODE>

... but I can't use gets because it'll read the text input from the
outer loop/map thingy! (it even says that 'gets' will be deprecated in
the future..

how do i put a pause there in my program?

···

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

Oh yeah... and I'm using Hipricot... (if that matters)

···

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