Last active
August 29, 2015 14:10
-
-
Save itsprdp/68bdfa5e9434b036e74e to your computer and use it in GitHub Desktop.
byebug as debugger monkey patch
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Rails | |
module Rack | |
class Debugger | |
def initialize(app) | |
@app = app | |
# clear ARGV so that rails server options aren't passed to IRB | |
ARGV.clear | |
require 'byebug' | |
::Byebug.start | |
puts "=> Byebug enabled" | |
rescue LoadError | |
puts "You're missing the 'byebug' gem. Add it to your Gemfile, bundle " \ | |
"it and try again." | |
exit(1) | |
end | |
def call(env) | |
@app.call(env) | |
end | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
ref: deivid-rodriguez/byebug#2