Forum: Ruby help ruby noob write a hitEnterToContinue() method

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
72d71185bc90cf1d56a834ea52df5a99?d=identicon&s=25 David Lam (lamdk)
on 2007-07-15 13:43
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?
72d71185bc90cf1d56a834ea52df5a99?d=identicon&s=25 David Lam (lamdk)
on 2007-07-15 14:23


Oh yeah... and I'm using Hipricot... (if that matters)
This topic is locked and can not be replied to.