Skip to content
Browse files

Only load breakpoint in development mode and when BREAKPOINT_SERVER_P…

…ORT is defined. Closes #1957

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2079 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
  • Loading branch information...
1 parent 87b6800 commit 49d5cadbb2de988b1e9662f16f26d82e86c9a473 @seckar seckar committed
Showing with 12 additions and 3 deletions.
  1. +2 −0 railties/CHANGELOG
  2. +10 −3 railties/lib/dispatcher.rb
View
2 railties/CHANGELOG
@@ -1,5 +1,7 @@
*SVN*
+* Only load breakpoint in development mode and when BREAKPOINT_SERVER_PORT is defined.
+
* Allow the --toggle-spin switch on process/reaper to be negated
* Replace render_partial with render :partial in scaffold generator [Nicholas Seckar]
View
13 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 @@ def reset_application!
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 @@ def reset_after_dispatch
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

0 comments on commit 49d5cad

Please sign in to comment.
Something went wrong with that request. Please try again.