diff --git a/README.md b/README.md index 24564f6d..475b36e4 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ Better Errors replaces the standard Rails error page with a much better and more useful error page. It is also usable outside of Rails in any Rack app as Rack middleware. -![image](http://i.imgur.com/urVDW.png) +![image](http://i.imgur.com/Me5of.png) ## Features diff --git a/lib/better_errors/code_formatter.rb b/lib/better_errors/code_formatter.rb index 582534f7..dcb2d4df 100644 --- a/lib/better_errors/code_formatter.rb +++ b/lib/better_errors/code_formatter.rb @@ -23,7 +23,7 @@ def html end def source_unavailable - "
Source unavailable
" + "Source unavailable
" end def coderay_scanner diff --git a/lib/better_errors/stack_frame.rb b/lib/better_errors/stack_frame.rb index d0e124b4..0e68fa9b 100644 --- a/lib/better_errors/stack_frame.rb +++ b/lib/better_errors/stack_frame.rb @@ -53,6 +53,18 @@ def gem_path end end end + + def name_parts + @name_parts ||= name.match(/^(.*?)([\.\#].*)$/) + end + + def class_name + name_parts && name_parts[1] + end + + def method_name + name_parts && name_parts[2] + end def context if application? diff --git a/lib/better_errors/templates/main.erb b/lib/better_errors/templates/main.erb index c73910ac..dac3c108 100644 --- a/lib/better_errors/templates/main.erb +++ b/lib/better_errors/templates/main.erb @@ -3,229 +3,668 @@Message | -<%= exception_message %> | -
---|---|
File | -<%= backtrace_frames.first.filename %> | -
Line | -<%= backtrace_frames.first.line %> | -
<%= exception_message %>