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.
Until the configuration dialog is implemented, you need to create the configuration files by hand following these steps:
.atom-byebug
in your project's root folder.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')
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.
$HOME/atom/packages
folder.Byebug Debugger
in the Packages menu.config.json
for the package in the .atom-byebug
folder of the package's project. That file specifies the Ruby program to run and the arguments to pass. In the future, a dialog will be available to edit this file.sample-ruby-program
in the same folder. This program is executed when the debugger is launched.Thanks :-)
Good catch. Let us know what about this package looks wrong to you, and we'll investigate right away.