Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
AndyObtiva committed May 31, 2024
1 parent 4718f31 commit 5bfaf88
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@

(credit to Aaron Patterson for partial inspiration: https://tenderlovemaking.com/2016/02/05/i-am-a-puts-debuggerer.html)

If you like Awesome Print (or Amazing Print), you will love Puts Debuggerer (which builds upon them)!
If you like [Awesome_Print](https://rubygems.org/gems/awesome_print) (or [Amazing_Print](https://github.com/amazing-print/amazing_print)), you will love Puts Debuggerer (which builds upon them)!

Debuggers are great! They help us troubleshoot complicated programming problems by inspecting values produced by code, line by line. They are invaluable when trying to understand what is going on in a large application composed of thousands or millions of lines of code.

In day-to-day test-driven development and simple app debugging though, a puts statement can be a lot quicker in revealing what is going on than halting execution completely just to inspect a single value or a few. This is certainly true when writing the simplest possible code that could possibly work, and running a test every few seconds or minutes. Still, there are a number of problems with puts debugging, like difficulty in locating puts statements in a large output log, knowing which methods and line numbers were invoked, identifying which variables were printed, and seeing the content of structured hashes and arrays in an understandable format.

Enter [puts_debuggerer](https://rubygems.org/gems/puts_debuggerer)! A guilt-free puts debugging Ruby gem FTW that prints file names, line numbers, code statements, headers, footers, stack traces, and formats output nicely courtesy of [awesome_print](https://rubygems.org/gems/awesome_print).
Enter [puts_debuggerer](https://rubygems.org/gems/puts_debuggerer)! A guilt-free puts debugging Ruby gem FTW that prints file names, line numbers, code statements, headers, footers, stack traces, and formats output nicely courtesy of [awesome_print](https://rubygems.org/gems/awesome_print) (or [amazing_print](https://github.com/amazing-print/amazing_print) if you prefer).

[puts_debuggerer](https://rubygems.org/gems/puts_debuggerer) automates tips mentioned in [this blog post](https://tenderlovemaking.com/2016/02/05/i-am-a-puts-debuggerer.html) by Aaron Patterson using the `pd` method available everywhere after requiring the [gem](https://rubygems.org/gems/puts_debuggerer).

Expand All @@ -22,14 +22,14 @@ Basic Example:
# /Users/User/trivia_app.rb # line 1
require 'pd' # line 2
bug_or_band = 'beatles' # line 3
pd bug_or_band # line 4
pd bug_or_band # line 4 (band)
```

Output:

```bash
[PD] /Users/User/trivia_app.rb:4
> pd bug_or_band # line 4
> pd bug_or_band # line 4 (band)
=> "beatles"
```

Expand Down

0 comments on commit 5bfaf88

Please sign in to comment.