0.0
No commit activity in last 3 years
No release in over 3 years
Helper methods for Ruby on Rails application debugging.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.16
~> 12.3
~> 3.7
~> 0.15

Runtime

< 1.9, >= 1.6
< 6, > 4.0
 Project Readme

DebugExtras

Build Status Maintainability Test Coverage

Helper methods for Ruby on Rails applications debugging. Screenshots.

Table of Contents

  • Features
  • Installation
  • Usage
    • #dd
    • #wp
    • #dump
  • Styling
  • License

Features

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

  • wp <variable> at any app/ place. Inspired by classic PHP 'print' debug. 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 default CSS to the page on methods call. You can override styles and set your fonts, margins, etc using .debug-extras wrapper. Just look to the page sources to see them at the end of head section.

Example how to override default fonts in your stylesheet:

.debug-extras pre,
.debug-extras kbd {
    font-family: Consolas, SFMono-Regular, Menlo, Monaco, Ubuntu, monospace !important;
    font-size: 14px !important;
    line-height: 18px !important;
}

or may be you want to use pre-wrap rendering:

.debug-extras pre {
    white-space: pre-wrap !important;
}

Note: if #wp and #dump results looks different compare to the screenshots above then default styles were overridden by yours.

License

DebugExtras is released under the MIT License.