Skip to content
This repository has been archived by the owner on Jun 3, 2024. It is now read-only.
/ rack-debug Public archive
forked from ddollar/rack-debug

Rack::Debug is middleware that provides a simple interface to ruby-debug. Helps debug apps running in Passenger.

Notifications You must be signed in to change notification settings

assaydepot/rack-debug

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

60 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Fork Purpose

The reason for this fork is change the dependency to rely on debugger instead of the older and unmaintainted ruby-debug19

NOTE: If you’re using Ruby 1.8.x please use the 1.x series of rack-debug

Install

$ gem install rack-debug

Rails

# config/environments/development.rb
config.gem 'rack-debug'
config.middleware.use 'Rack::Debug'

# RAILS_ROOT/Rakefile
require 'rack-debug/tasks'

Middleware

# add a use line to your builder
require 'rack/debug'
Rack::Builder.new do
  use Rack::Debug
  run MyApp.new
end

# can optionally specify where to put the sockets
use Rack::Debug, :socket_path => '/tmp/rack-debug'

# Rakefile
require 'rack-debug/tasks'

Add breakpoints to your code

@user = User.find(params[:id])
debugger
render :show

Debugging:

# run the rake task,
$ rake debug
Connected.

# refresh a page in your browser, your app will break at debugger statements
(rdb:1) p @user
#<User id: 1, name: "David Dollar", email: "[email protected]", created_at: "...", updated_at: "...">

# can specify the socket path
SOCKET_PATH=/tmp/rack-debug rake debug

Meta:

Author/Maintainer: David Dollar

Patches contributed by:
  Bart Teeuwisse

Thanks to:

Rack::Bug for a good example of Rack middleware in Rails
Ben Scofield for making me want to build some Rack middleware

About

Rack::Debug is middleware that provides a simple interface to ruby-debug. Helps debug apps running in Passenger.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Ruby 100.0%