Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

clean YAML output

  • Loading branch information...
commit 44c234392058690c6449b7dd58c93a85505bf813 1 parent 7a29bc0
@mislav authored
View
5 lib/never_forget/exception_handler.rb
@@ -1,6 +1,7 @@
require 'rbconfig'
require 'erubis'
require 'active_support/memoizable'
+require 'yaml'
module NeverForget
class ExceptionHandler
@@ -45,6 +46,10 @@ module TemplateHelpers
include RbConfig
extend ActiveSupport::Memoizable
+ def y(obj)
+ YAML.dump(obj).sub(/^---.*\n/, '').gsub(/ !(omap|map:BSON::OrderedHash) *$/, '')
+ end
+
def gem_path
paths = []
paths << Bundler.bundle_path << Bundler.user_bundle_path if defined? Bundler
View
4 lib/never_forget/list_exceptions.erb
@@ -78,12 +78,12 @@
<% if ex['params'].present? %>
<h3>Params:</h3>
-<pre class="params"><%== YAML.dump ex['params'] %></pre>
+<pre class="params"><%== y ex['params'] %></pre>
<% end %>
<% if ex['session'].present? %>
<h3>Session:</h3>
-<pre class="session"><%== YAML.dump ex['session'] %></pre>
+<pre class="session"><%== y ex['session'] %></pre>
<% end %>
<h3>Backtrace:</h3>
Please sign in to comment.
Something went wrong with that request. Please try again.