qcam / ruby_jard

Just another ruby debugger. Jard provides a unified experience debugging Ruby source code in different platforms and editors.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

RubyJard

Jard stands for Just Another Ruby Debugger. It implements a layer of UI wrapping around byebug, aims to provide a unified experience when debugging Ruby source code. Ruby Jard supports the following major features at the moment:

  • Default Terminal UI, in which the layout and display are responsive to support different screen sizes.
  • Highlighted source code screen.
  • Stacktrace visualization and navigation.
  • Auto explore and display variables in the current context.
  • Multi-thread exploration and debugging.

In the roadmap:

  • Dynamic breakpoints.
  • Watch expressions.
  • Support different screen sizes.
  • Minimal layout configuration.
  • Fully layout configuration with Tmux.
  • Integrate with Vim.
  • Integrate with Visual Studio Code.
  • Encrypted remote debugging.
  • Some handful debug tools and data visualization.

Ruby Jard's core is Byebug, an awesome de factor debugger for Ruby. Therefore, Ruby Jard supports most of Byebug's functionalities.

If you still don't know what it is, let's watch this video. This is a record of debugging Code Ray - A syntax highlighter for Ruby.

asciicast

Getting Started

Warning: 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.

Add ruby_jard to your Gemfile, recommend to put it in test or development environment.

gem 'ruby_jard'

Add magic method jard before the line you want to debug, just like byebug

def test_method
  a = 1
  b = 2
  jard # Debugger will stop here
  c = a + b
end

Guides

Guide UI

The main page of the debugging UI includes 4 screens:

  • Source: Show the current file, surrounding the source code of the executing line.
  • Stacktrace: Show the current thread's stack trace. You can use up, down, frame to navigate through the stack trace.
  • Variables: Show all the variables in the current context, including local variables, instance variables, and constants.
  • Threads: Show all the threads of the process. This screen is valuable in case you are debugging a multi-threaded program.

At this alpha state, Ruby Jard support some basic commands:

  • next: continue the execution to the next line.
  • step: continue the execution, do deep into the implementation of methods in the current line.
  • continue: continue the execution. The program gonna stops at the next breakpoint.
  • finish: Finish the execution of the current frame, and go back.
  • up: explore the stack trace, jump to the upper frame of the current program
  • down: explore the stack trace, jump to the lower frame of the current program
  • frame: explore the stack trace, jump to a precise frame in the stack trace.

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/ruby_jard. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the code of conduct.

License

The gem is available as open source under the terms of the MIT License.

Code of Conduct

Everyone interacting in the RubyJard project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the code of conduct.

About

Just another ruby debugger. Jard provides a unified experience debugging Ruby source code in different platforms and editors.

License:MIT License


Languages

Language:Ruby 100.0%