Faster debugging with RubyMine macros

In my RubyMine I have recorded two macros for debugging and linked them to some keyboard shortcuts. Since I believe everyone could benefit from having those I wanted to share this.

The first one simply inserts

binding.pry

and the second one

.tap { |object| binding.pry }

for when you do not have a reference to the object you want to inspect.

In order to record a macro you simply follow the path Edit > Macros > Start Macro Recording.

Then you simply type binding.pry or whatever you want to record and stop recording with Edit > Macros > Stop Macro and give it some name.

Try and play back your macro to see if it does what you expect.

Finally open your RubyMine settings and add some keyboard shortcut to your macro.

That's it, you are debugging faster now ;-)

Andreas Robecke Almost 9 years ago