Skip to content
Open
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
2 changes: 1 addition & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ GEM
docile (1.4.0)
faraday (0.9.2)
multipart-post (>= 1.2, < 3)
git (1.10.2)
git (1.11.0)
rchardet (~> 1.8)
github_api (0.16.0)
addressable (~> 2.4.0)
Expand Down
14 changes: 12 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,7 @@ There are many more options and features in [puts_debuggerer](https://rubygems.o

This is the recommended way for installing in [Rails](rubyonrails.org) apps in addition to configuring the [`app_path` option](#putsdebuggererapp_path).

Add the following to bundler's `Gemfile`.
Add the following to bundler's `Gemfile` (in Rails, you can optionally limit to the `:development` and `:test` groups).

```ruby
gem 'puts_debuggerer', '~> 0.13.5'
Expand All @@ -334,6 +334,16 @@ bundle

Optionally, you may configure the [Rails](rubyonrails.org) initializer `config/initializers/puts_debuggerer_options.rb` with further customizations as per the [Options](#options) section below.

Also, you may want to add the following to the initializer too if you limited the `puts_debuggerer` gem to the `:development` and `:test` groups:

```ruby
unless Rails.env.development? || Rails.env.test?
def pd(*args, &block) # `pd(...)` in Ruby 2.7+
# No Op (just a stub in case developers forget troubleshooting pd calls in the code and deploy to production)
end
end
```

### Option 2: Manual

Or manually install and require library.
Expand Down Expand Up @@ -364,7 +374,7 @@ Still, if you do not need it, you may disable by setting `PutsDebuggerer.print_e
PutsDebuggerer.print_engine = :puts
```

If you also avoid requiring 'awesome_print', PutsDebuggerer won't require it either if it sees that you have a different `print_engine`
If you also avoid requiring 'awesome_print', PutsDebuggerer will NOT require it either if it sees that you have a different `print_engine`. In fact, you may switch to another print engine if you prefer like [amazing_print](https://github.com/amazing-print/amazing_print) as [explained here](https://github.com/AndyObtiva/puts_debuggerer#putsdebuggererprint_engine).

You may also avoid requiring in Bundler `Gemfile` with `require: false`:

Expand Down
3 changes: 3 additions & 0 deletions TODO.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ Here are tasks considered for future versions. Once done, they are moved to the

## Next

- Automatically print class and method name as part of the file name and line number printout
- Support displaying the date/time of the pd printout via an option (local and global)
- Consider supporting `header: :method` to print the Class#method name as the header (consider supporting in footer/wrapper too)
- Consider adding performance profiling to pd methods automatically, with some customization options too
- Fix issue with no printing code in bigger rails apps filled with other gems (perhaps there is some conflict?)
- Support passing options directly without an object (e.g. pd caller: true)
Expand Down