Methods
- F
- P
- T
Class Public methods
# File railties/lib/rails/info.rb, line 48 48: def to_html 49: (table = '<table>').tap do 50: properties.each do |(name, value)| 51: table << %(<tr><td class="name">#{CGI.escapeHTML(name.to_s)}</td>) 52: formatted_value = if value.kind_of?(Array) 53: "<ul>" + value.map { |v| "<li>#{CGI.escapeHTML(v.to_s)}</li>" }.join + "</ul>" 54: else 55: CGI.escapeHTML(value.to_s) 56: end 57: table << %(<td class="value">#{formatted_value}</td></tr>) 58: end 59: table << '</table>' 60: end 61: end
# File railties/lib/rails/info.rb, line 36 36: def to_s 37: column_width = properties.names.map {|name| name.length}.max 38: info = properties.map do |name, value| 39: value = value.join(", ") if value.is_a?(Array) 40: "%-#{column_width}s %s" % [name, value] 41: end 42: info.unshift "About your application's environment" 43: info * "\n" 44: end