Debugging represents one of the most important activities in software development that you need to do on a regular basis. As a developer, you spend time trying to build something, or change something that is already implemented.
This way, you are likely going to need to spend a lot of time trying to improve something that is failing in production, or figure out how to speed up a particular process that is taking too much time to finish.
However, this is particularly difficult in Rails projects. There are many gems that help with this, but one of the most popular ones is pry.
If you are using pry, you may have been sometimes in a need for a faster way to exit its session and not have to use exit multiple times.
I recently stumbled upon an article that was talking about a faster way to exist these pry sessions, which I didn’t know before, which I decided to also write about it so that more people can benefit from it. This was something that was actually mentioned in the Wiki section of the pry repository on GitHub.
And it is also very simple. All you have to do is instead of executing exit you can simply execute exit-program which will break from the loop.
Yeah, you read that right. No fancy shortcuts or complicated commands that you need to execute to do that.
There is also a shortcut, which is !!!
For more details about this and other things related to pry, you can go and take a look at its Wiki page on GitHub.
I hope you find this useful.