Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

History

12 Commits

Repository files navigation

Objective

Simply Disply How to debug sinatra application with debugger or pry

especially, I would like to step in method debug like below

step

How to Use

# added to the Gemfilegroup:development,:testdogem'awesome_print'gem'racksh'gem'debugger'gem'pry'gem'pry-debugger'end

You can just use debugger, if you run it ruby my_app.rb

classMyApp < Sinatra::Baseenable:sessionsget'/'dodebuggersession[:user]='anonymouse'redirectto('/bar')end

visit at http://localhost:4567

You can use pry, if you run it rackup

classMyApp < Sinatra::Baseenable:sessionsget'/'dobinding.prysession[:user]='anonymouse'redirectto('/bar')end

in case to use the short cut of next contine step finish add pry config

#.pryrcPry.commands.alias_command'c','continue'Pry.commands.alias_command's','step'Pry.commands.alias_command'n','next'Pry.commands.alias_command'f','finish'

visit at http://localhost:9292

looks like

ruby my_app.rb

debugger

rackup

pry

sinatra console

You may also would like to know how to run console for sinatra and simulate a get or post call from console, try racksh

racksh

About

Best Practice: How to debug sinatra with debugger and pry

Resources

Stars

17 stars

Watchers

2 watching

Forks

Releases

Packages

Used by

Contributors

Languages