aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_view
diff options
context:
space:
mode:
authorNicholas Seckar <nseckar@gmail.com>2005-10-27 21:58:39 +0000
committerNicholas Seckar <nseckar@gmail.com>2005-10-27 21:58:39 +0000
commitf2c920ec24f318e28c0a1e78c019a331368ff5bb (patch)
treea63fd29587d69b09bc39ec3cbcec94a0eeeed668 /actionpack/lib/action_view
parent706a8a8f960572bce1c289cfa7e6a9678fe7f1e1 (diff)
downloadrails-f2c920ec24f318e28c0a1e78c019a331368ff5bb.tar.gz
rails-f2c920ec24f318e28c0a1e78c019a331368ff5bb.tar.bz2
rails-f2c920ec24f318e28c0a1e78c019a331368ff5bb.zip
Fix line number detection and escape RAILS_ROOT in backtrace Regexp
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2773 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'actionpack/lib/action_view')
-rw-r--r--actionpack/lib/action_view/template_error.rb3
1 files changed, 2 insertions, 1 deletions
diff --git a/actionpack/lib/action_view/template_error.rb b/actionpack/lib/action_view/template_error.rb
index b81173dafe..e21f7517b1 100644
--- a/actionpack/lib/action_view/template_error.rb
+++ b/actionpack/lib/action_view/template_error.rb
@@ -47,7 +47,7 @@ module ActionView
def line_number
if file_name
- regexp = /#{Regexp.escape File.basename(file_name)}:(\d+)\s*$/
+ regexp = /#{Regexp.escape File.basename(file_name)}:(\d+)/
[@original_exception.message, @original_exception.clean_backtrace].flatten.each do |line|
return $1.to_i if regexp =~ line
end
@@ -83,3 +83,4 @@ module ActionView
end
Exception::TraceSubstitutions << [/:in\s+`_run_(html|xml).*'\s*$/, ''] if defined?(Exception::TraceSubstitutions)
+Exception::TraceSubstitutions << [%r{^\s*#{Regexp.escape RAILS_ROOT}}, '#{RAILS_ROOT}'] if defined?(RAILS_ROOT)