Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,14 @@ There are several options for (1) and (2). Please choose your favorite way.

### Modify source code with [`binding.break`](#bindingbreak-method) (similar to `binding.pry` or `binding.irb`)

If you can modify the source code, you can use the debugger by adding `require 'debug'` line at the top of your program and putting [`binding.break`](#bindingbreak-method) method (`binding.b` for short) into lines where you want to stop as breakpoints like `binding.pry` and `binding.irb`.
After that, you run the program as usual and you will enter the debug console at breakpoints you inserted.
If you can modify the source code, you can use the debugger by adding `require 'debug'` at the top of your program and putting [`binding.break`](#bindingbreak-method) method into lines where you want to stop as breakpoints like `binding.pry` and `binding.irb`.

You can also use its 2 aliases in the same way:

- `binding.b`
- `debugger`

After that, run the program as usual and you will enter the debug console at breakpoints you inserted.

The following example shows the demonstration of [`binding.break`](#bindingbreak-method).

Expand Down
10 changes: 8 additions & 2 deletions misc/README.md.erb
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,14 @@ There are several options for (1) and (2). Please choose your favorite way.

### Modify source code with [`binding.break`](#bindingbreak-method) (similar to `binding.pry` or `binding.irb`)

If you can modify the source code, you can use the debugger by adding `require 'debug'` line at the top of your program and putting [`binding.break`](#bindingbreak-method) method (`binding.b` for short) into lines where you want to stop as breakpoints like `binding.pry` and `binding.irb`.
After that, you run the program as usual and you will enter the debug console at breakpoints you inserted.
If you can modify the source code, you can use the debugger by adding `require 'debug'` at the top of your program and putting [`binding.break`](#bindingbreak-method) method into lines where you want to stop as breakpoints like `binding.pry` and `binding.irb`.

You can also use its 2 aliases in the same way:

- `binding.b`
- `debugger`

After that, run the program as usual and you will enter the debug console at breakpoints you inserted.

The following example shows the demonstration of [`binding.break`](#bindingbreak-method).

Expand Down