aboutsummaryrefslogtreecommitdiffstats
path: root/railties/lib/rails/info.rb
diff options
context:
space:
mode:
Diffstat (limited to 'railties/lib/rails/info.rb')
-rw-r--r--railties/lib/rails/info.rb32
1 files changed, 8 insertions, 24 deletions
diff --git a/railties/lib/rails/info.rb b/railties/lib/rails/info.rb
index edadeaca0e..94ede76932 100644
--- a/railties/lib/rails/info.rb
+++ b/railties/lib/rails/info.rb
@@ -1,6 +1,9 @@
require "cgi"
module Rails
+ # This module helps build the runtime properties used to display in the
+ # Rails::InfoController responses. Including the active Rails version, Ruby
+ # version, Rack version, and so on.
module Info
mattr_accessor :properties
class << (@@properties = [])
@@ -22,17 +25,6 @@ module Rails
rescue Exception
end
- def frameworks
- %w( active_record action_pack action_view action_mailer active_support )
- end
-
- def framework_version(framework)
- if Object.const_defined?(framework.classify)
- require "#{framework}/version"
- framework.classify.constantize.version.to_s
- end
- end
-
def to_s
column_width = properties.names.map {|name| name.length}.max
info = properties.map do |name, value|
@@ -61,6 +53,11 @@ module Rails
end
end
+ # The Rails version.
+ property 'Rails version' do
+ Rails.version.to_s
+ end
+
# The Ruby version and platform, e.g. "2.0.0-p247 (x86_64-darwin12.4.0)".
property 'Ruby version' do
"#{RUBY_VERSION}-p#{RUBY_PATCHLEVEL} (#{RUBY_PLATFORM})"
@@ -75,23 +72,10 @@ module Rails
::Rack.release
end
- # The Rails version.
- property 'Rails version' do
- Rails.version.to_s
- end
-
property 'JavaScript Runtime' do
ExecJS.runtime.name
end
- # Versions of each Rails framework (Active Record, Action Pack,
- # Action Mailer, and Active Support).
- frameworks.each do |framework|
- property "#{framework.titlecase} version" do
- framework_version(framework)
- end
- end
-
property 'Middleware' do
Rails.configuration.middleware.map(&:inspect)
end