Step debug a loop for only as many iterations as you need to
I've found myself here a few times http://devopsreactions.tumblr.com/post/53831016555/stepping-a-long-loop-when-debugging
You don't have to do that, I promise.
In Ruby, you can do something like the following:
@@stop = false
def some_method_that_you_are_debugging
too_many.times do
debugger unless @@stop
blah_blah
end
end
Then when you are finished debugging and you don't want to keep running through the loop, just do the following:
@@stop = true
No more keyboard mashing.
Written by Stephen Aghaulor
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Ruby
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#