atom-byebug

Integration with Ruby's Byebug Debugger (work in progress)

izaera

668

2

0.1.4

GPL v3

GitHub

atom-byebug

An Atom package for integrating with Ruby's byebug debugger.

This is a work in progress and though it is usable it is far from implementing all features of a standard debugger as a GUI. Nevertheless, it is possible to send commands to byebug and see their responses as if they were used from the command line.

How to use

Until the configuration dialog is implemented, you need to create the configuration files by hand following these steps:

  1. Create a directory named .atom-byebug in your project's root folder.
  2. Create a config.json file inside that directory and add two entries named executable and arguments to specify the script to run and the arguments to pass.

For example:

{
    "executable": "./sample-ruby-program",
    "arguments": []
}

That's it. Keep in mind that the script you run must start byebug debugger in remote mode. For more details about that see byebug's documentation, but usually placing the following code at the very beginning of your Ruby program is enough:

require 'byebug'
require 'byebug/core'
Byebug.wait_connection = true
Byebug.start_server('localhost')

How to launch Rails in debug mode

To launch a Rails application within byebug debugger, you can create a launch script in your .atom-byebug, configure it as executable in config.json and set its content to:

#!/usr/bin/env ruby
APP_PATH = File.expand_path('../../config/application', __FILE__)

require 'byebug'
require 'byebug/core'

Byebug.wait_connection = true
Byebug.start_server('localhost')

require_relative '../config/boot'
require 'rails/commands'

Make it executable if you are not using Windows and have fun.

How to contribute

Thanks 😃