This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
Ruby Jard is a terminal-based debugger for Ruby that provides a rich UI wrapping around Byebug. It offers features like highlighted source code, stacktrace visualization, variable exploration, and multi-thread debugging.
bundle exec rspec- Run all testsbundle exec rspec spec/path/to/specific_spec.rb- Run specific test filebundle exec parallel_rspec spec/- Run tests in parallel
bundle exec rubocop- Run lintingbundle exec rubocop -a- Auto-fix linting issues
bundle install- Install dependenciesrake build- Build the gemrake install- Install the gem locallyrake release- Release the gem (maintainers only)
Session Management (lib/ruby_jard/session.rb)
- Entry point for debugging sessions
- Manages the lifecycle of debugging contexts
REPL System
repl_manager.rb- Manages REPL interactionsrepl_processor.rb- Processes commands and inputrepl_interceptor.rb- Intercepts and handles debugging flowrepl_state.rb- Tracks REPL state
Screen & Layout System
screen_manager.rb- Manages multiple debug screensscreen_renderer.rb- Renders screen contentlayout_*.rbfiles - Different layout configurations (wide, narrow, tiny)screens/directory - Individual screen implementations (source, variables, backtrace, etc.)
Inspection System (lib/ruby_jard/inspectors/)
- Modular object inspection with specialized inspectors for different data types
base.rb- Base inspector class- Type-specific inspectors for arrays, hashes, objects, strings, etc.
Command System (lib/ruby_jard/commands/)
- Debugging commands like step, next, continue, frame navigation
- Each command is a separate class inheriting from
base_command.rb
- Configuration-driven: Uses
config.rbfor user customization - Modular screens: Each debug view is a separate screen class
- Responsive layouts: Multiple layout templates adapt to terminal size
- Command pattern: Debug commands are individual classes
- Decorator pattern: Used for colorizing and formatting output
- Byebug Integration: Core debugging functionality via Byebug gem
- Pry Integration: REPL functionality via Pry gem
- TTY Integration: Terminal UI via tty-screen gem
- The codebase uses frozen string literals throughout
- Main entry point is the
jardmethod added to Kernel module - Debugging state is managed through thread-local variables
- UI rendering is optimized for different terminal sizes and capabilities