byebug-breakpoints

Manage byebug breakpoints in byebugrc

mykiwibuddy

282

0

0.2.5

MIT

GitHub

byebug-breakpoints package

This package helps manage the .byebugrc file.

It does the following:

  1. Allows you to add and remove byebug breakpoints in the Atom editor. The breakpoints are added into the .byebugrc file which is loaded by byebug when it starts (most of the time)
  2. Displays in the editor, breakpoints set in the .byebugrc file when you open the file for editing.
  3. Saves updated breakpoints in the .byebugrc file when you save your .rb file - which means the breakpoints move with the code as you remove or insert lines.

Notes on use

Use:

Breakpoints are highlighted in the line-number.

Testing in development

Rails s does not load byebugrc until it encounters a byebug command. To have breakpoints loaded simply add byebug at the top of any module - it will run when the module is loaded.

Testing inside Atom

I use the ruby-test package for testing in Rails apps in Atom. I found that byebug statements in code caused the package to hang awating byebug commands (because you couldn't interact with it). This was why I wrote this package in the first place.

I found that ruby-test (really Cucumber and rspec) don't load the byebugrc file, so no more hangs.

Here's how rubt-test runs the commands:

bundle exec rspec --tty {relative_path}:{line_number}

Testing Outside of Atom (in the terminal)

I found that running rspec using the following command does not appear to load the byebugrc file. rspec will run and byebug commands in code will work, but not breakpoints in the byebugrc file.

$ rspec -p ./spec

This is easily fixed by running it as:

$ byebug --no-stop -- rspec -p -- ./spec

Note the double-dash before the rspec path.

Todo:

This is my first Atom package and I haven't created the specs yet.

Contributions

These helped me get started