Installation
Note: Ruby Jard is still under heavy development. Bugs and weird behaviors are expected. If you see one, please don't hesitate to open an issue. I'll try my best to fix it.
Install Ruby Jard
- Bundler
- Ruby Gem
Add one of these lines into your Gemfile. Note: Use of Ruby Jard is discouraged in production environments.
If you would like to use Ruby Jard to debug a test, you can add it to the test group too.
If you would like to use the edge version of Ruby Jard:
Run your program with Ruby Jard
To use Ruby Jard, you just need to put the magic jard
method before any place you want to stop. Jard supports stopping anywhere, including the top-level binding, instance methods, class methods, string evaluation, or even inside a class declaration.
Next, run your program as you normally would. If your program encounters a jard
breakpoint, it will stop execution, display the UI, and let you debug.
In case of the error undefined local variable or method jard
, please require ruby_jard manually when your program initializes. If you use Ruby Jard with well-known frameworks, ruby_jard will be loaded by default.
Supported platform
- Ruby Jard supports official Ruby versions: 2.5.x, 2.6.x, 2.7.x, 2.8.x - 3.0.x (in ruby trunk).
- Truffle Ruby support is on the roadmap.
- jRuby support is not available yet, as byebug core is written in C.
- Ruby Jard is developed and tested on Linux distros and MacOS.
- Windows is not supported (yet).
Dependencies
Ruby Jard has 3 dependencies:
byebug
, compatibility: '>= 9.1', '< 12.0'pry
, compatibility: '~> 0.13.0'tty-screen
, compatibility: '~> 0.8.1'
Ruby Jard is compatible with pry
and byebug
. They can be installed simultaneously without conflict. However, as soon as Jard starts (via the magic jard
method call), this compatibility is no longer guaranteed.
Conflicts
There are some known conflicts between Ruby Jard and other gems:
- Any gems that modify Ruby's Readline standard library, such as
rb-readline
- Any gems that modify Pry or Byebug settings, such as
pry-byebug