提交 5ff59bff 编写于 作者: N Nicholas Seckar

Remove explicit loading of RailsInfo and RailsInfoController.

Move RailsInfo and RailsInfoController to Rails::Info and Rails::InfoController.
Extend load path with Railties' builtin directory to make adding support code easy.


git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3981 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
上级 b42195cd
*SVN*
* Remove explicit loading of RailsInfo and RailsInfoController. [Nicholas Seckar]
* Move RailsInfo and RailsInfoController to Rails::Info and Rails::InfoController. [Nicholas Seckar]
* Extend load path with Railties' builtin directory to make adding support code easy. [Nicholas Seckar]
* Fix the rails_info controller by explicitly loading it, and marking it as not reloadable. [Nicholas Seckar]
* Fixed rails:freeze:gems for Windows #3274 [paul@paulbutcher.com]
......
class RailsInfoController < ActionController::Base
def self.reloadable?() false end
def properties
if local_request?
render :inline => Rails::Info.to_html
else
render :text => '<p>For security purposes, this information is only available to local requests.</p>', :status => 500
end
end
end
require 'rails_version'
require File.join(File.dirname(File.dirname(__FILE__)), 'builtin/controllers/rails_info_controller')
module Rails
module Info
......
module Rails
class InfoController < ActionController::Base
def properties
if local_request?
render :inline => Rails::Info.to_html
else
render :text => '<p>For security purposes, this information is only available to local requests.</p>', :status => 500
end
end
end
end
\ No newline at end of file
......@@ -183,7 +183,7 @@
<script type="text/javascript">
function about() {
if (Element.empty('about-content')) {
new Ajax.Updater('about-content', 'rails_info/properties', {
new Ajax.Updater('about-content', 'rails/info/properties', {
method: 'get',
onFailure: function() {Element.classNames('about-content').add('failure')},
onComplete: function() {new Effect.BlindDown('about-content', {duration: 0.25})}
......
......@@ -96,7 +96,7 @@ def process
# the individual base class configurations.
load_environment
load_framework_info
add_support_load_paths
load_plugins
......@@ -129,10 +129,10 @@ def require_frameworks
configuration.frameworks.each { |framework| require(framework.to_s) }
end
# Loads Rails::VERSION and Rails::Info.
# TODO: Make this work via dependencies.rb/const_missing instead.
def load_framework_info
require 'rails_info'
# Add the load paths used by support functions such as the info controller
def add_support_load_paths
builtins = File.join(File.dirname(File.dirname(__FILE__)), 'builtin', '*')
$LOAD_PATH.concat(Dir[builtins])
end
# Loads all plugins in <tt>config.plugin_paths</tt>. <tt>plugin_paths</tt>
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册