• Stars
    star
    237
  • Rank 164,154 (Top 4 %)
  • Language
    Ruby
  • License
    MIT License
  • Created about 5 years ago
  • Updated about 2 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Lightweight Ruby debugger! ⚡️

Break

Break is a lightweight debugger for Ruby. It's written in plain Ruby and doesn't have its own frontend. Once you put gem "break" in your Gemfile, it integrates seamlessly with IRB or Pry. You have navigational commands like next and step straight in your REPL session. You don't need to remember to start your debugger or change your development flow. Break embraces your flow, instead of forcing you to abide to yet another tool.

Features

  • Control flow executing control.
  • No runtime cost. The tracing instructions kick in only when navigating.
  • Automatic integration with IRB and Pry.
  • Rails 6 constant auto loading support (not available in other Ruby debuggers).

Installation

Put gem "break" in your Gemfile. Then run bundle install and binding.irb (or binding.pry) to your heart's desire.

Commands

The following commands are available in both IRB and Pry.

Command Description
next Continue to next line.
step Step into method invocation.
up Go up the stack.
down Go down the stack.
whereami Show the code surrounding the current debugged line.
exit Disconnect the debugger and continue to run the program.

Usage

Add break in your application Gemfile and make sure to require "break" early in your program setup. In a Rails application, break will be required automatically and you don't need to worry about that.

gem "break"

Break automatically injects its commands into binding.irb and binding.pry (if available).

If you need to debug your program, type a next to go to the next line of program execution or step to step into a method, block, or class/module opening call. All of this, in the comfort of IRB or Pry. Simple!

Remote usage

Break can integrate with pry-remote for remote process debugging. You have to require break/remote for Break's integration to kick in.

You can declare break in your Gemfile with a custom require to get the remote integration loaded automatically by Bundler:

gem "break", require: "break/remote"

Why we need a debugger in Ruby?

We had our fair share of abandoned Ruby debuggers written in C. During Ruby 1.8 and Ruby 1.9 days, the interpreter itself changed often and didn't provide a stable API to aid the writing of development tools. This means that ruby-debug, a debugger written for Ruby 1.8 had to be rewritten for 1.9 (as a different gem: ruby-debug-base19) and then again for Ruby 2.0. At this point the development was halted as maintaining 3 different implementations is hard.

If we get better APIs in Ruby-land we won't run into the problems ruby-debug did. Even better, the debuggers can be thin layers on top of the heavy-lifting debugging instrumentation APIs that live in the interpreter themselves. This way the interpreter internals can change as much as they want but if they provide the same APIs, all of the debugging tools will still work. On top of that, our debuggers will work on JRuby, TruffleRuby or whatever alternative Ruby implementation is under active development at the time.

Break exists to implement a functional debugger in pure Ruby using the TracePoint API. It also wants to serve as a catalyst for other Ruby-land available APIs that are useful for implementing debugging tools.

Learn more from this Ruby Russia talk. ⚡️

More Repositories

1

jump

Jump helps you navigate faster by learning your habits. ✌️
Go
1,726
star
2

rvt

Remote Terminal for the Browser.
Ruby
54
star
3

web-console

MOVED TO https://github.com/rails/web-console
Ruby
37
star
4

early

Early checks for environment variables availability, so you don't have to.
Ruby
25
star
5

frames.py

Python stack frames goodies.
Python
18
star
6

skiptrace

Bindings for your Ruby exceptions
Ruby
18
star
7

gloat

Next-gen database migrations framework for Go.
Go
14
star
8

web-console-rails3

Rails Console on the Browser, Rails 3 edition.
Ruby
12
star
9

.files

I haz them!
Vim Script
11
star
10

grunt-init-backbone-plugin

Create a Backbone plugin project template with grunt-init.
JavaScript
9
star
11

nilable

Nilable object is a tool to handle nil invocations.
Ruby
8
star
12

masse

Catch those Ruby errors by the masses!
Ruby
8
star
13

serializr

Serializr is a library for creating canonical JSON representation of objects for your RESTful APIs.
Ruby
7
star
14

smiley.zsh-theme

Awesome prompt with happy and sad faces.
6
star
15

chip8.c

Simple CHIP-8 interpreter.
C
6
star
16

raisl

When you type rails fast.
Ruby
6
star
17

middleman-gh_pages

Middleman deploy to GitHub that just works.
Ruby
6
star
18

minitest-assert_changes

Introduces assert_changes and assert_no_changes to Minitest.
Ruby
5
star
19

rubybanitsa.com

Website for the Ruby Banitsa meetup.
Ruby
5
star
20

web-console-pry

Deprecated Pry adapter for Web Console.
Ruby
4
star
21

sx

Nested database transaction support for Golang.
Go
4
star
22

patka

Patka is a fork of goose that applies unapplied migrations, even if they happen to be in the past.
Go
3
star
23

plush

Python's most fluffy web framework.
Python
3
star
24

elmo

Work-in-progress NES emulator 👾
Elm
3
star
25

jaws

Jaws is a simple JWT authentication middleware for Go.
Go
3
star
26

response.py

Python HTTP Requests for the Lazy.
Python
3
star
27

demotivation

Everybody needs some.
JavaScript
2
star
28

cobalt

Node.js client for pygmentize.me.
CoffeeScript
2
star
29

rspec-xunit

The RSpec you know and love with xUnit syntax.
Ruby
2
star
30

rack-delegate

Rack level reverse proxy.
Ruby
2
star
31

strip

XML for humans and stuff.
Ruby
2
star
32

moodswing

Node.js testing framework for that time of the software development cycle.
CoffeeScript
2
star
33

trashy

🗑 Trashy let's you soft-delete Active Record models with ease.
Ruby
2
star
34

railsconf

Resolve Errors Straight from the Error Pages
HTML
2
star
35

backbone-grease

Slicker chaining for Backbone's collection Underscore methods.
JavaScript
2
star
36

assert

Minimal assertion library for Go.
Go
2
star
37

puppet-softlink

Pointless Symlink for Puppet
Ruby
2
star
38

claude

Claude transparently encrypts and decrypts sensitive Active Record attributes.
Ruby
2
star
39

underscore-introduction

A talk about https://underscorejs.org
1
star
40

nope

Nope adds yes, no, on and off into Object.
Ruby
1
star
41

sg

Golang library for transactional еmails through SendGrid or SparkPost.
Go
1
star
42

brownie-points-postmortem

A talk diessecting the internals of the backend of https://browniepoints.com.
JavaScript
1
star
43

teapot.js

The Mighty Quest of Rendering a Teapot.
1
star
44

holmsie

Simple HTML(5) problems detector for Mozilla Firefox.
JavaScript
1
star
45

dollar.do

$?
JavaScript
1
star
46

solutions

Demo application for a Ruby on Rails class in Hack Bulgaria.
Ruby
1
star
47

git-tips

Tips and tricks on using Git.
1
star
48

jekyll-slim

Slim converter for Jekyll
Ruby
1
star
49

gsamokovarov.github.io

Best home page, ever!
SCSS
1
star
50

carmine

Ruby client for pygmentize.me.
Ruby
1
star
51

gti.py

Git launcher in Python.
Python
1
star
52

bootstra386-rails

Bootstra.386 for the Rails Assets Pipeline.
Ruby
1
star
53

pygmentize.me

Your friendly highlighting service.
Python
1
star
54

borica

Ruby integration for Borica.
Ruby
1
star
55

kaigi

Ruby Kaigi talks for 2018 & 2019
Slim
1
star
56

timeout_errors

Catch all of them Net::HTTP timeout errors.
Ruby
1
star
57

dont

Don't merge Pull Requests at work
JavaScript
1
star
58

gti.sh

Git launcher in Bash.
Shell
1
star
59

blog

Demo application for a Ruby on Rails training in Software Society.
Ruby
1
star