diff options
Diffstat (limited to 'railties/lib')
-rw-r--r-- | railties/lib/initializer.rb | 8 | ||||
-rw-r--r-- | railties/lib/rails_info.rb (renamed from railties/lib/info.rb) | 16 |
2 files changed, 20 insertions, 4 deletions
diff --git a/railties/lib/initializer.rb b/railties/lib/initializer.rb index 368bf88039..9035138779 100644 --- a/railties/lib/initializer.rb +++ b/railties/lib/initializer.rb @@ -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: # diff --git a/railties/lib/info.rb b/railties/lib/rails_info.rb index 2104f4d6e6..edd90b36ad 100644 --- a/railties/lib/info.rb +++ b/railties/lib/rails_info.rb @@ -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 |