Read more

Faster debugging with RubyMine macros

Andreas Robecke
June 22, 2015Software engineer

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.

Illustration web development

Do you need DevOps-experts?

Your development team has a full backlog? No time for infrastructure architecture? Our DevOps team is ready to support you!

  • We build reliable cloud solutions with Infrastructure as code
  • We are experts in security, Linux and databases
  • We support your dev team to perform
Read more Show archive.org snapshot

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 ;-)

Posted by Andreas Robecke to makandra dev (2015-06-22 11:55)