diff --git a/railties/builtin/rails_info/rails/info.rb b/railties/builtin/rails_info/rails/info.rb index c8bc9cb4f1..2bd9b55617 100644 --- a/railties/builtin/rails_info/rails/info.rb +++ b/railties/builtin/rails_info/rails/info.rb @@ -3,11 +3,11 @@ module Rails mattr_accessor :properties class << (@@properties = []) def names - map { |name, value| name } + map &:first end def value_for(property_name) - if property = find { |name, value| name == property_name } + if property = assoc(property_name) property.last end end @@ -16,19 +16,19 @@ module Rails class << self #:nodoc: def property(name, value = nil) value ||= yield - properties << [name, value] if value + properties << [name, value] if value rescue Exception end def components %w( active_record action_pack active_resource action_mailer active_support ) end - + def component_version(component) require "#{component}/version" "#{component.classify}::VERSION::STRING".constantize end - + def edge_rails_revision(info = svn_info) info[/^Revision: (\d+)/, 1] || freeze_edge_version end @@ -51,7 +51,7 @@ module Rails end alias inspect to_s - + def to_html returning table = '