From a2671e54c3abfcdc14b95f262d0bb6d016a938ff Mon Sep 17 00:00:00 2001 From: hukl Date: Sat, 31 Oct 2009 18:59:01 +0100 Subject: added exception notifier plugin to catch all exceptions --- app/controllers/application_controller.rb | 2 + config/environments/production.rb | 5 +- vendor/plugins/exception_notification/README | 111 +++++++++++++++++++++ vendor/plugins/exception_notification/init.rb | 4 + .../lib/exception_notifiable.rb | 99 ++++++++++++++++++ .../lib/exception_notifier.rb | 66 ++++++++++++ .../lib/exception_notifier_helper.rb | 78 +++++++++++++++ .../test/exception_notifier_helper_test.rb | 61 +++++++++++ .../exception_notification/test/test_helper.rb | 7 ++ .../views/exception_notifier/_backtrace.rhtml | 1 + .../views/exception_notifier/_environment.rhtml | 7 ++ .../views/exception_notifier/_inspect_model.rhtml | 16 +++ .../views/exception_notifier/_request.rhtml | 4 + .../views/exception_notifier/_session.rhtml | 2 + .../views/exception_notifier/_title.rhtml | 3 + .../exception_notification.rhtml | 6 ++ 16 files changed, 471 insertions(+), 1 deletion(-) create mode 100644 vendor/plugins/exception_notification/README create mode 100644 vendor/plugins/exception_notification/init.rb create mode 100644 vendor/plugins/exception_notification/lib/exception_notifiable.rb create mode 100644 vendor/plugins/exception_notification/lib/exception_notifier.rb create mode 100644 vendor/plugins/exception_notification/lib/exception_notifier_helper.rb create mode 100644 vendor/plugins/exception_notification/test/exception_notifier_helper_test.rb create mode 100644 vendor/plugins/exception_notification/test/test_helper.rb create mode 100644 vendor/plugins/exception_notification/views/exception_notifier/_backtrace.rhtml create mode 100644 vendor/plugins/exception_notification/views/exception_notifier/_environment.rhtml create mode 100644 vendor/plugins/exception_notification/views/exception_notifier/_inspect_model.rhtml create mode 100644 vendor/plugins/exception_notification/views/exception_notifier/_request.rhtml create mode 100644 vendor/plugins/exception_notification/views/exception_notifier/_session.rhtml create mode 100644 vendor/plugins/exception_notification/views/exception_notifier/_title.rhtml create mode 100644 vendor/plugins/exception_notification/views/exception_notifier/exception_notification.rhtml diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index d624c89..275a4d4 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -2,6 +2,8 @@ # Likewise, all the methods added will be available for all controllers. class ApplicationController < ActionController::Base + + include ExceptionNotifiable include AuthenticatedSystem helper :all # include all helpers, all the time diff --git a/config/environments/production.rb b/config/environments/production.rb index 1fc9f6b..429bf05 100644 --- a/config/environments/production.rb +++ b/config/environments/production.rb @@ -24,4 +24,7 @@ config.action_controller.perform_caching = true # config.action_mailer.raise_delivery_errors = false # Enable threaded mode -# config.threadsafe! \ No newline at end of file +# config.threadsafe! + +ExceptionNotifier.exception_recipients = %w(hukl@h3q.com) +ExceptionNotifier.sender_address = %("CCCMS Error" ) \ No newline at end of file diff --git a/vendor/plugins/exception_notification/README b/vendor/plugins/exception_notification/README new file mode 100644 index 0000000..9a47c41 --- /dev/null +++ b/vendor/plugins/exception_notification/README @@ -0,0 +1,111 @@ += Exception Notifier Plugin for Rails + +The Exception Notifier plugin provides a mailer object and a default set of +templates for sending email notifications when errors occur in a Rails +application. The plugin is configurable, allowing programmers to specify: + +* the sender address of the email +* the recipient addresses +* the text used to prefix the subject line + +The email includes information about the current request, session, and +environment, and also gives a backtrace of the exception. + +== Usage + +First, include the ExceptionNotifiable mixin in whichever controller you want +to generate error emails (typically ApplicationController): + + class ApplicationController < ActionController::Base + include ExceptionNotifiable + ... + end + +Then, specify the email recipients in your environment: + + ExceptionNotifier.exception_recipients = %w(joe@schmoe.com bill@schmoe.com) + +And that's it! The defaults take care of the rest. + +== Configuration + +You can tweak other values to your liking, as well. In your environment file, +just set any or all of the following values: + + # defaults to exception.notifier@default.com + ExceptionNotifier.sender_address = + %("Application Error" ) + + # defaults to "[ERROR] " + ExceptionNotifier.email_prefix = "[APP] " + +Email notifications will only occur when the IP address is determined not to +be local. You can specify certain addresses to always be local so that you'll +get a detailed error instead of the generic error page. You do this in your +controller (or even per-controller): + + consider_local "64.72.18.143", "14.17.21.25" + +You can specify subnet masks as well, so that all matching addresses are +considered local: + + consider_local "64.72.18.143/24" + +The address "127.0.0.1" is always considered local. If you want to completely +reset the list of all addresses (for instance, if you wanted "127.0.0.1" to +NOT be considered local), you can simply do, somewhere in your controller: + + local_addresses.clear + +== Customization + +By default, the notification email includes four parts: request, session, +environment, and backtrace (in that order). You can customize how each of those +sections are rendered by placing a partial named for that part in your +app/views/exception_notifier directory (e.g., _session.rhtml). Each partial has +access to the following variables: + +* @controller: the controller that caused the error +* @request: the current request object +* @exception: the exception that was raised +* @host: the name of the host that made the request +* @backtrace: a sanitized version of the exception's backtrace +* @rails_root: a sanitized version of RAILS_ROOT +* @data: a hash of optional data values that were passed to the notifier +* @sections: the array of sections to include in the email + +You can reorder the sections, or exclude sections completely, by altering the +ExceptionNotifier.sections variable. You can even add new sections that +describe application-specific data--just add the section's name to the list +(whereever you'd like), and define the corresponding partial. Then, if your +new section requires information that isn't available by default, make sure +it is made available to the email using the exception_data macro: + + class ApplicationController < ActionController::Base + ... + protected + exception_data :additional_data + + def additional_data + { :document => @document, + :person => @person } + end + ... + end + +In the above case, @document and @person would be made available to the email +renderer, allowing your new section(s) to access and display them. See the +existing sections defined by the plugin for examples of how to write your own. + +== Advanced Customization + +By default, the email notifier will only notify on critical errors. For +ActiveRecord::RecordNotFound and ActionController::UnknownAction, it will +simply render the contents of your public/404.html file. Other exceptions +will render public/500.html and will send the email notification. If you want +to use different rules for the notification, you will need to implement your +own rescue_action_in_public method. You can look at the default implementation +in ExceptionNotifiable for an example of how to go about that. + + +Copyright (c) 2005 Jamis Buck, released under the MIT license \ No newline at end of file diff --git a/vendor/plugins/exception_notification/init.rb b/vendor/plugins/exception_notification/init.rb new file mode 100644 index 0000000..4d9d76e --- /dev/null +++ b/vendor/plugins/exception_notification/init.rb @@ -0,0 +1,4 @@ +require "action_mailer" +require "exception_notifier" +require "exception_notifiable" +require "exception_notifier_helper" diff --git a/vendor/plugins/exception_notification/lib/exception_notifiable.rb b/vendor/plugins/exception_notification/lib/exception_notifiable.rb new file mode 100644 index 0000000..d5e28fc --- /dev/null +++ b/vendor/plugins/exception_notification/lib/exception_notifiable.rb @@ -0,0 +1,99 @@ +require 'ipaddr' + +# Copyright (c) 2005 Jamis Buck +# +# Permission is hereby granted, free of charge, to any person obtaining +# a copy of this software and associated documentation files (the +# "Software"), to deal in the Software without restriction, including +# without limitation the rights to use, copy, modify, merge, publish, +# distribute, sublicense, and/or sell copies of the Software, and to +# permit persons to whom the Software is furnished to do so, subject to +# the following conditions: +# +# The above copyright notice and this permission notice shall be +# included in all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +module ExceptionNotifiable + def self.included(target) + target.extend(ClassMethods) + end + + module ClassMethods + def consider_local(*args) + local_addresses.concat(args.flatten.map { |a| IPAddr.new(a) }) + end + + def local_addresses + addresses = read_inheritable_attribute(:local_addresses) + unless addresses + addresses = [IPAddr.new("127.0.0.1")] + write_inheritable_attribute(:local_addresses, addresses) + end + addresses + end + + def exception_data(deliverer=self) + if deliverer == self + read_inheritable_attribute(:exception_data) + else + write_inheritable_attribute(:exception_data, deliverer) + end + end + + def exceptions_to_treat_as_404 + exceptions = [ActiveRecord::RecordNotFound, + ActionController::UnknownController, + ActionController::UnknownAction] + exceptions << ActionController::RoutingError if ActionController.const_defined?(:RoutingError) + exceptions + end + end + + private + + def local_request? + remote = IPAddr.new(request.remote_ip) + !self.class.local_addresses.detect { |addr| addr.include?(remote) }.nil? + end + + def render_404 + respond_to do |type| + type.html { render :file => "#{RAILS_ROOT}/public/404.html", :status => "404 Not Found" } + type.all { render :nothing => true, :status => "404 Not Found" } + end + end + + def render_500 + respond_to do |type| + type.html { render :file => "#{RAILS_ROOT}/public/500.html", :status => "500 Error" } + type.all { render :nothing => true, :status => "500 Error" } + end + end + + def rescue_action_in_public(exception) + case exception + when *self.class.exceptions_to_treat_as_404 + render_404 + + else + render_500 + + deliverer = self.class.exception_data + data = case deliverer + when nil then {} + when Symbol then send(deliverer) + when Proc then deliverer.call(self) + end + + ExceptionNotifier.deliver_exception_notification(exception, self, + request, data) + end + end +end diff --git a/vendor/plugins/exception_notification/lib/exception_notifier.rb b/vendor/plugins/exception_notification/lib/exception_notifier.rb new file mode 100644 index 0000000..72e2e1a --- /dev/null +++ b/vendor/plugins/exception_notification/lib/exception_notifier.rb @@ -0,0 +1,66 @@ +require 'pathname' + +# Copyright (c) 2005 Jamis Buck +# +# Permission is hereby granted, free of charge, to any person obtaining +# a copy of this software and associated documentation files (the +# "Software"), to deal in the Software without restriction, including +# without limitation the rights to use, copy, modify, merge, publish, +# distribute, sublicense, and/or sell copies of the Software, and to +# permit persons to whom the Software is furnished to do so, subject to +# the following conditions: +# +# The above copyright notice and this permission notice shall be +# included in all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +class ExceptionNotifier < ActionMailer::Base + @@sender_address = %("Exception Notifier" ) + cattr_accessor :sender_address + + @@exception_recipients = [] + cattr_accessor :exception_recipients + + @@email_prefix = "[ERROR] " + cattr_accessor :email_prefix + + @@sections = %w(request session environment backtrace) + cattr_accessor :sections + + self.template_root = "#{File.dirname(__FILE__)}/../views" + + def self.reloadable?() false end + + def exception_notification(exception, controller, request, data={}) + content_type "text/plain" + + subject "#{email_prefix}#{controller.controller_name}##{controller.action_name} (#{exception.class}) #{exception.message.inspect}" + + recipients exception_recipients + from sender_address + + body data.merge({ :controller => controller, :request => request, + :exception => exception, :host => (request.env["HTTP_X_FORWARDED_HOST"] || request.env["HTTP_HOST"]), + :backtrace => sanitize_backtrace(exception.backtrace), + :rails_root => rails_root, :data => data, + :sections => sections }) + end + + private + + def sanitize_backtrace(trace) + re = Regexp.new(/^#{Regexp.escape(rails_root)}/) + trace.map { |line| Pathname.new(line.gsub(re, "[RAILS_ROOT]")).cleanpath.to_s } + end + + def rails_root + @rails_root ||= Pathname.new(RAILS_ROOT).cleanpath.to_s + end + +end diff --git a/vendor/plugins/exception_notification/lib/exception_notifier_helper.rb b/vendor/plugins/exception_notification/lib/exception_notifier_helper.rb new file mode 100644 index 0000000..d3dc63a --- /dev/null +++ b/vendor/plugins/exception_notification/lib/exception_notifier_helper.rb @@ -0,0 +1,78 @@ +require 'pp' + +# Copyright (c) 2005 Jamis Buck +# +# Permission is hereby granted, free of charge, to any person obtaining +# a copy of this software and associated documentation files (the +# "Software"), to deal in the Software without restriction, including +# without limitation the rights to use, copy, modify, merge, publish, +# distribute, sublicense, and/or sell copies of the Software, and to +# permit persons to whom the Software is furnished to do so, subject to +# the following conditions: +# +# The above copyright notice and this permission notice shall be +# included in all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +module ExceptionNotifierHelper + VIEW_PATH = "views/exception_notifier" + APP_PATH = "#{RAILS_ROOT}/app/#{VIEW_PATH}" + PARAM_FILTER_REPLACEMENT = "[FILTERED]" + + def render_section(section) + RAILS_DEFAULT_LOGGER.info("rendering section #{section.inspect}") + summary = render_overridable(section).strip + unless summary.blank? + title = render_overridable(:title, :locals => { :title => section }).strip + "#{title}\n\n#{summary.gsub(/^/, " ")}\n\n" + end + end + + def render_overridable(partial, options={}) + if File.exist?(path = "#{APP_PATH}/_#{partial}.rhtml") + render(options.merge(:file => path, :use_full_path => false)) + elsif File.exist?(path = "#{File.dirname(__FILE__)}/../#{VIEW_PATH}/_#{partial}.rhtml") + render(options.merge(:file => path, :use_full_path => false)) + else + "" + end + end + + def inspect_model_object(model, locals={}) + render_overridable(:inspect_model, + :locals => { :inspect_model => model, + :show_instance_variables => true, + :show_attributes => true }.merge(locals)) + end + + def inspect_value(value) + len = 512 + result = object_to_yaml(value).gsub(/\n/, "\n ").strip + result = result[0,len] + "... (#{result.length-len} bytes more)" if result.length > len+20 + result + end + + def object_to_yaml(object) + object.to_yaml.sub(/^---\s*/m, "") + end + + def exclude_raw_post_parameters? + @controller && @controller.respond_to?(:filter_parameters) + end + + def filter_sensitive_post_data_parameters(parameters) + exclude_raw_post_parameters? ? @controller.__send__(:filter_parameters, parameters) : parameters + end + + def filter_sensitive_post_data_from_env(env_key, env_value) + return env_value unless exclude_raw_post_parameters? + return PARAM_FILTER_REPLACEMENT if (env_key =~ /RAW_POST_DATA/i) + return @controller.__send__(:filter_parameters, {env_key => env_value}).values[0] + end +end diff --git a/vendor/plugins/exception_notification/test/exception_notifier_helper_test.rb b/vendor/plugins/exception_notification/test/exception_notifier_helper_test.rb new file mode 100644 index 0000000..dd47637 --- /dev/null +++ b/vendor/plugins/exception_notification/test/exception_notifier_helper_test.rb @@ -0,0 +1,61 @@ +require 'test_helper' +require 'exception_notifier_helper' + +class ExceptionNotifierHelperTest < Test::Unit::TestCase + + class ExceptionNotifierHelperIncludeTarget + include ExceptionNotifierHelper + end + + def setup + @helper = ExceptionNotifierHelperIncludeTarget.new + end + + # No controller + + def test_should_not_exclude_raw_post_parameters_if_no_controller + assert !@helper.exclude_raw_post_parameters? + end + + # Controller, no filtering + + class ControllerWithoutFilterParameters; end + + def test_should_not_filter_env_values_for_raw_post_data_keys_if_controller_can_not_filter_parameters + stub_controller(ControllerWithoutFilterParameters.new) + assert @helper.filter_sensitive_post_data_from_env("RAW_POST_DATA", "secret").include?("secret") + end + def test_should_not_exclude_raw_post_parameters_if_controller_can_not_filter_parameters + stub_controller(ControllerWithoutFilterParameters.new) + assert !@helper.exclude_raw_post_parameters? + end + def test_should_return_params_if_controller_can_not_filter_parameters + stub_controller(ControllerWithoutFilterParameters.new) + assert_equal :params, @helper.filter_sensitive_post_data_parameters(:params) + end + + # Controller with filtering + + class ControllerWithFilterParameters + def filter_parameters(params); :filtered end + end + + def test_should_filter_env_values_for_raw_post_data_keys_if_controller_can_filter_parameters + stub_controller(ControllerWithFilterParameters.new) + assert !@helper.filter_sensitive_post_data_from_env("RAW_POST_DATA", "secret").include?("secret") + assert @helper.filter_sensitive_post_data_from_env("SOME_OTHER_KEY", "secret").include?("secret") + end + def test_should_exclude_raw_post_parameters_if_controller_can_filter_parameters + stub_controller(ControllerWithFilterParameters.new) + assert @helper.exclude_raw_post_parameters? + end + def test_should_delegate_param_filtering_to_controller_if_controller_can_filter_parameters + stub_controller(ControllerWithFilterParameters.new) + assert_equal :filtered, @helper.filter_sensitive_post_data_parameters(:params) + end + + private + def stub_controller(controller) + @helper.instance_variable_set(:@controller, controller) + end +end \ No newline at end of file diff --git a/vendor/plugins/exception_notification/test/test_helper.rb b/vendor/plugins/exception_notification/test/test_helper.rb new file mode 100644 index 0000000..bbe6fc5 --- /dev/null +++ b/vendor/plugins/exception_notification/test/test_helper.rb @@ -0,0 +1,7 @@ +require 'test/unit' +require 'rubygems' +require 'active_support' + +$:.unshift File.join(File.dirname(__FILE__), '../lib') + +RAILS_ROOT = '.' unless defined?(RAILS_ROOT) diff --git a/vendor/plugins/exception_notification/views/exception_notifier/_backtrace.rhtml b/vendor/plugins/exception_notification/views/exception_notifier/_backtrace.rhtml new file mode 100644 index 0000000..7d13ba0 --- /dev/null +++ b/vendor/plugins/exception_notification/views/exception_notifier/_backtrace.rhtml @@ -0,0 +1 @@ +<%= @backtrace.join "\n" %> diff --git a/vendor/plugins/exception_notification/views/exception_notifier/_environment.rhtml b/vendor/plugins/exception_notification/views/exception_notifier/_environment.rhtml new file mode 100644 index 0000000..42dd803 --- /dev/null +++ b/vendor/plugins/exception_notification/views/exception_notifier/_environment.rhtml @@ -0,0 +1,7 @@ +<% max = @request.env.keys.max { |a,b| a.length <=> b.length } -%> +<% @request.env.keys.sort.each do |key| -%> +* <%= "%-*s: %s" % [max.length, key, filter_sensitive_post_data_from_env(key, @request.env[key].to_s.strip)] %> +<% end -%> + +* Process: <%= $$ %> +* Server : <%= `hostname -s`.chomp %> diff --git a/vendor/plugins/exception_notification/views/exception_notifier/_inspect_model.rhtml b/vendor/plugins/exception_notification/views/exception_notifier/_inspect_model.rhtml new file mode 100644 index 0000000..e817847 --- /dev/null +++ b/vendor/plugins/exception_notification/views/exception_notifier/_inspect_model.rhtml @@ -0,0 +1,16 @@ +<% if show_attributes -%> +[attributes] +<% attrs = inspect_model.attributes -%> +<% max = attrs.keys.max { |a,b| a.length <=> b.length } -%> +<% attrs.keys.sort.each do |attr| -%> +* <%= "%*-s: %s" % [max.length, attr, object_to_yaml(attrs[attr]).gsub(/\n/, "\n ").strip] %> +<% end -%> +<% end -%> + +<% if show_instance_variables -%> +[instance variables] +<% inspect_model.instance_variables.sort.each do |variable| -%> +<%- next if variable == "@attributes" -%> +* <%= variable %>: <%= inspect_value(inspect_model.instance_variable_get(variable)) %> +<% end -%> +<% end -%> diff --git a/vendor/plugins/exception_notification/views/exception_notifier/_request.rhtml b/vendor/plugins/exception_notification/views/exception_notifier/_request.rhtml new file mode 100644 index 0000000..2542309 --- /dev/null +++ b/vendor/plugins/exception_notification/views/exception_notifier/_request.rhtml @@ -0,0 +1,4 @@ +* URL : <%= @request.protocol %><%= @host %><%= @request.request_uri %> +* IP address: <%= @request.env["HTTP_X_FORWARDED_FOR"] || @request.env["REMOTE_ADDR"] %> +* Parameters: <%= filter_sensitive_post_data_parameters(@request.parameters).inspect %> +* Rails root: <%= @rails_root %> diff --git a/vendor/plugins/exception_notification/views/exception_notifier/_session.rhtml b/vendor/plugins/exception_notification/views/exception_notifier/_session.rhtml new file mode 100644 index 0000000..283c862 --- /dev/null +++ b/vendor/plugins/exception_notification/views/exception_notifier/_session.rhtml @@ -0,0 +1,2 @@ +* session id: <%= @request.session.instance_variable_get(:@session_id).inspect %> +* data: <%= PP.pp(@request.session.instance_variable_get(:@data),"").gsub(/\n/, "\n ").strip %> diff --git a/vendor/plugins/exception_notification/views/exception_notifier/_title.rhtml b/vendor/plugins/exception_notification/views/exception_notifier/_title.rhtml new file mode 100644 index 0000000..1ed5a3f --- /dev/null +++ b/vendor/plugins/exception_notification/views/exception_notifier/_title.rhtml @@ -0,0 +1,3 @@ +------------------------------- +<%= title.to_s.humanize %>: +------------------------------- diff --git a/vendor/plugins/exception_notification/views/exception_notifier/exception_notification.rhtml b/vendor/plugins/exception_notification/views/exception_notifier/exception_notification.rhtml new file mode 100644 index 0000000..ec30c4a --- /dev/null +++ b/vendor/plugins/exception_notification/views/exception_notifier/exception_notification.rhtml @@ -0,0 +1,6 @@ +A <%= @exception.class %> occurred in <%= @controller.controller_name %>#<%= @controller.action_name %>: + + <%= @exception.message %> + <%= @backtrace.first %> + +<%= @sections.map { |section| render_section(section) }.join %> -- cgit v1.3