Skip to content

Instantly share code, notes, and snippets.

@itsprdp
Last active August 29, 2015 14:10
Show Gist options
  • Save itsprdp/68bdfa5e9434b036e74e to your computer and use it in GitHub Desktop.
Save itsprdp/68bdfa5e9434b036e74e to your computer and use it in GitHub Desktop.
byebug as debugger monkey patch
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
@itsprdp
Copy link
Author

itsprdp commented Nov 30, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment