Help ruby noob write a hitEnterToContinue() method


#1

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

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

… 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?


#2

Oh yeah… and I’m using Hipricot… (if that matters)