# Help ruby noob write a hitEnterToContinue() method

**URL:** <https://www.ruby-forum.com/t/help-ruby-noob-write-a-hitentertocontinue-method/109469>\
**Category:** Ruby\
**Created:** [July 15, 2007, 1:43pm UTC](https://www.ruby-forum.com/t/help-ruby-noob-write-a-hitentertocontinue-method/109469 "2007-07-15T13:43:36Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![drlelon](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/ee59a6/32.png) [@drlelon](https://www.ruby-forum.com/u/drlelon)\
**Post date:** [July 15, 2007, 1:43pm UTC](https://www.ruby-forum.com/t/help-ruby-noob-write-a-hitentertocontinue-method/109469/1 "2007-07-15T13:43:36Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![drlelon](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/ee59a6/32.png) [@drlelon](https://www.ruby-forum.com/u/drlelon)\
**Post date:** [July 15, 2007, 2:23pm UTC](https://www.ruby-forum.com/t/help-ruby-noob-write-a-hitentertocontinue-method/109469/2 "2007-07-15T14:23:32Z")

</div>

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