Move info.rb to rails_info.rb and load Rails::Info after initialization
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2884 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
This commit is contained in:
parent
71b032a0a6
commit
55fab64391
|
@ -1,5 +1,7 @@
|
|||
*SVN*
|
||||
|
||||
* Load Rails::Info after initialization [Sam Stephenson]
|
||||
|
||||
* Added script/about to display formatted Rails::Info output [Sam Stephenson]
|
||||
|
||||
* Added Rails::Info to catalog assorted information about a Rails application's environment [Sam Stephenson]
|
||||
|
|
|
@ -87,6 +87,8 @@ module Rails
|
|||
# could overwrite anything set from the defaults/global through
|
||||
# the individual base class configurations.
|
||||
load_environment
|
||||
|
||||
load_framework_info
|
||||
|
||||
load_plugins
|
||||
end
|
||||
|
@ -113,6 +115,12 @@ 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'
|
||||
end
|
||||
|
||||
# Loads all plugins in the <tt>vendor/plugins</tt> directory. Each
|
||||
# subdirectory of <tt>vendor/plugins</tt> is inspected as follows:
|
||||
#
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
require 'rails_version'
|
||||
|
||||
module Rails
|
||||
module Info
|
||||
mattr_accessor :properties
|
||||
|
@ -19,8 +21,7 @@ module Rails
|
|||
end
|
||||
|
||||
def components
|
||||
%w(active_record action_pack action_web_service
|
||||
action_mailer active_support)
|
||||
%w( active_record action_pack action_web_service action_mailer active_support )
|
||||
end
|
||||
|
||||
def component_version(component)
|
||||
|
@ -57,6 +58,11 @@ module Rails
|
|||
Gem::RubyGemsVersion
|
||||
end
|
||||
|
||||
# The Rails version.
|
||||
property 'Rails version' do
|
||||
Rails::Version::STRING
|
||||
end
|
||||
|
||||
# Versions of each Rails component (Active Record, Action Pack,
|
||||
# Action Web Service, Action Mailer, and Active Support).
|
||||
components.each do |component|
|
||||
|
@ -71,8 +77,10 @@ module Rails
|
|||
end
|
||||
|
||||
# The application's location on the filesystem.
|
||||
property 'Application root', File.expand_path(RAILS_ROOT)
|
||||
|
||||
property 'Application root' do
|
||||
File.expand_path(RAILS_ROOT)
|
||||
end
|
||||
|
||||
# The current Rails environment (development, test, or production).
|
||||
property 'Environment' do
|
||||
RAILS_ENV
|
|
@ -3,7 +3,7 @@ $:.unshift File.dirname(__FILE__) + "/../../activesupport/lib"
|
|||
|
||||
require 'test/unit'
|
||||
require 'active_support'
|
||||
require 'info'
|
||||
require 'rails_info'
|
||||
|
||||
class << Rails::Info
|
||||
protected
|
Loading…
Reference in New Issue