DebugExtras

Gem Build Status Maintainability Test Coverage

Extras for Ruby on Rails debugging. Screenshots.

Note: README actual for master branch.

Table of Contents

Features

  • dd <variable> at any app/ place. Inspired by dd function from Laravel.

  • wp <variable> at any app/ place. Inspired by classic PHP 'print' debugging. It works for HTML pages and bypass other content types like application/json.

  • dump <variable> at your views. It's alternative for debug method from ActionView::Helpers::DebugHelper and ap from AwesomePrint.

Installation

Add this line to your Gemfile:

gem 'debug-extras', group: :development

And then execute:

$ bundle

Usage

#dd

Call dd from any app/ place:

dd @books

image

#wp

Call wp from any app/ place:

wp 'Authors through #wp method (called from controller):'
wp @authors

image

#dump

Call dump from views:

<%= dump 'Books through #dump method (called from view):' %>
<%= dump @books %>

image

Styling

DebugExtras inject CSS to the page on methods call. You can override styles and set your fonts, margins, etc using .debug-extras wrapper. Just look to page sources to get an idea.

License

DebugExtras is released under the MIT License.