diff options
author | Nicholas Seckar <nseckar@gmail.com> | 2005-08-31 00:47:51 +0000 |
---|---|---|
committer | Nicholas Seckar <nseckar@gmail.com> | 2005-08-31 00:47:51 +0000 |
commit | 49d5cadbb2de988b1e9662f16f26d82e86c9a473 (patch) | |
tree | 3babb350a515f31519980226671c63498cf8750d | |
parent | 87b68002827015d887dd566c477b957d8e5cb842 (diff) | |
download | rails-49d5cadbb2de988b1e9662f16f26d82e86c9a473.tar.gz rails-49d5cadbb2de988b1e9662f16f26d82e86c9a473.tar.bz2 rails-49d5cadbb2de988b1e9662f16f26d82e86c9a473.zip |
Only load breakpoint in development mode and when BREAKPOINT_SERVER_PORT is defined. Closes #1957
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2079 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
-rw-r--r-- | railties/CHANGELOG | 2 | ||||
-rw-r--r-- | railties/lib/dispatcher.rb | 13 |
2 files changed, 12 insertions, 3 deletions
diff --git a/railties/CHANGELOG b/railties/CHANGELOG index a1360b18ce..90b7e240e0 100644 --- a/railties/CHANGELOG +++ b/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] 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 |