Getting started¶ ↑
Development dependencies¶ ↑
-
Byebug
depends on Ruby's TracePoint API provided byruby-core
. This is a young API and a lot of bugs have been recently corrected, so make sure you always have the lastest patch level release installed. -
The recommended tool to manage development dependencies is
bundler
. Rungem install bundler
to install it. -
Running
bundle install
inside a local clone ofbyebug
will get development dependencies installed.
Running the test suite¶ ↑
-
Make sure you compile the C-extension using
bundle exec rake compile
. Otherwise you won't be able to usebyebug
. -
Run the test suite using the default rake task (
bundle exec rake
). This task is composed of 2 subtasks:bundle exec rake compile
&&bundle exec rake test
. -
If you want to run specific tests, use the provided test runner, like so:
-
Specific test files. For example,
script/minitest_runner test/commands/break_test.rb
-
Specific test classes. For example,
script/minitest_runner Byebug::BreakAtLinesTestCase
-
Specific tests. For example,
script/minitest_runner test_catch_removes_specific_catchpoint
-
You can combine any of them and you will get the union of all filters. For example:
script/minitest_runner Byebug::BreakAtLinesTestCase test_catch_removes_specific_catchpoint
Code style¶ ↑
-
Byebug uses overcommit to enforce code style. Install the git hooks using
bundle exec overcommit --install
. They will review your changes before they are committed, checking they are consistent with the project's code style.
Byebug as a C-extension¶ ↑
Byebug is a gem developed as a C-extension. The debugger internal's functionality is implemented in C (the interaction with the TracePoint API). The rest of the gem is implemented in Ruby. Normally you won't need to touch the C-extension, but it will obviously depended on the bug you're trying to fix or the feature you are willing to add. You can learn more about C-extensions here or here.