1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

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
This commit is contained in:
Nicholas Seckar 2006-03-19 18:45:26 +00:00
parent b42195cdb7
commit 5ff59bff82
6 changed files with 23 additions and 19 deletions

View file

@ -1,5 +1,11 @@
*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]

View file

@ -1,12 +0,0 @@
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

View file

@ -1,5 +1,4 @@
require 'rails_version'
require File.join(File.dirname(File.dirname(__FILE__)), 'builtin/controllers/rails_info_controller')
module Rails
module Info

View file

@ -0,0 +1,11 @@
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

View 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})}

View file

@ -96,7 +96,7 @@ module Rails
# the individual base class configurations.
load_environment
load_framework_info
add_support_load_paths
load_plugins
@ -129,10 +129,10 @@ module Rails
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>