From c80fe1093deeb57eee8df11d3c4120158634cb81 Mon Sep 17 00:00:00 2001 From: Joshua Peek Date: Tue, 25 Nov 2008 14:48:09 -0600 Subject: Move debugger into middleware --- railties/lib/rails/rack/debugger.rb | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 railties/lib/rails/rack/debugger.rb (limited to 'railties/lib/rails/rack') diff --git a/railties/lib/rails/rack/debugger.rb b/railties/lib/rails/rack/debugger.rb new file mode 100644 index 0000000000..aa2711c616 --- /dev/null +++ b/railties/lib/rails/rack/debugger.rb @@ -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 -- cgit v1.2.3 From 0b4858cf38f522208381f9bfbbb5c066aceb30d2 Mon Sep 17 00:00:00 2001 From: Jeremy Kemper Date: Wed, 3 Dec 2008 10:23:58 -0600 Subject: Require rack/utils explicitly --- railties/lib/rails/rack/static.rb | 2 ++ 1 file changed, 2 insertions(+) (limited to 'railties/lib/rails/rack') diff --git a/railties/lib/rails/rack/static.rb b/railties/lib/rails/rack/static.rb index 45eb0e5921..ef4e2642e2 100644 --- a/railties/lib/rails/rack/static.rb +++ b/railties/lib/rails/rack/static.rb @@ -1,3 +1,5 @@ +require 'rack/utils' + module Rails module Rack class Static -- cgit v1.2.3