Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
23 additions
and
12 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
module Rails | ||
module Rack | ||
class Debugger | ||
def initialize(app) | ||
@app = app | ||
|
||
require_library_or_gem 'ruby-debug' | ||
::Debugger.start | ||
::Debugger.settings[:autoeval] = true if ::Debugger.respond_to?(:settings) | ||
puts "=> Debugger enabled" | ||
rescue Exception | ||
puts "You need to install ruby-debug to run the server in debugging mode. With gems, use 'gem install ruby-debug'" | ||
exit | ||
end | ||
|
||
def call(env) | ||
@app.call(env) | ||
end | ||
end | ||
end | ||
end |
c80fe10
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't liike this "rescue Exception" which hides any other problem with loading ruby-debug. For example, ruby-debug-0.10.3/cli/ruby-debug/interface.rb fails because of "uninitialized constant Debugger::LocalInterface::Readline" and the message printed is "You need to install ruby-debug" although it is installed.