diff options
Diffstat (limited to 'railties/lib')
-rw-r--r-- | railties/lib/dispatcher.rb | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/railties/lib/dispatcher.rb b/railties/lib/dispatcher.rb index aaea8dd277..58f00d7604 100644 --- a/railties/lib/dispatcher.rb +++ b/railties/lib/dispatcher.rb @@ -21,8 +21,6 @@ # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #++ -require 'breakpoint' - class Dispatcher class << self def dispatch(cgi = CGI.new, session_options = ActionController::CgiRequest::DEFAULT_SESSION_OPTIONS, output = $stdout) @@ -47,7 +45,7 @@ class Dispatcher private def prepare_application ActionController::Routing::Routes.reload if Dependencies.load? - Breakpoint.activate_drb("druby://localhost:#{BREAKPOINT_SERVER_PORT}", nil, !defined?(FastCGI)) if defined?(BREAKPOINT_SERVER_PORT) rescue nil + prepare_breakpoint Controllers.const_load!(:ApplicationController, "application") unless Controllers.const_defined?(:ApplicationController) end @@ -55,5 +53,14 @@ class Dispatcher reset_application! if Dependencies.load? Breakpoint.deactivate_drb if defined?(BREAKPOINT_SERVER_PORT) end + + def prepare_breakpoint + return unless defined?(BREAKPOINT_SERVER_PORT) + require 'breakpoint' + Breakpoint.activate_drb("druby://localhost:#{BREAKPOINT_SERVER_PORT}", nil, !defined?(FastCGI)) + true + rescue + nil + end end end |