aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_view/template_error.rb
diff options
context:
space:
mode:
authorRick Olson <technoweenie@gmail.com>2007-11-26 03:35:04 +0000
committerRick Olson <technoweenie@gmail.com>2007-11-26 03:35:04 +0000
commit8afb4e136b2482e1e3826d3e00981b4b89680e1a (patch)
tree969ccf3b090efad404184a8fdbe2f2742107a65e /actionpack/lib/action_view/template_error.rb
parent5ae821a7fe97c18101908a945de2639c8a48b7a8 (diff)
downloadrails-8afb4e136b2482e1e3826d3e00981b4b89680e1a.tar.gz
rails-8afb4e136b2482e1e3826d3e00981b4b89680e1a.tar.bz2
rails-8afb4e136b2482e1e3826d3e00981b4b89680e1a.zip
Fix TemplateError so it doesn't bomb on exceptions while running tests [rick]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8210 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'actionpack/lib/action_view/template_error.rb')
-rw-r--r--actionpack/lib/action_view/template_error.rb6
1 files changed, 3 insertions, 3 deletions
diff --git a/actionpack/lib/action_view/template_error.rb b/actionpack/lib/action_view/template_error.rb
index f82cb31846..01b4b15550 100644
--- a/actionpack/lib/action_view/template_error.rb
+++ b/actionpack/lib/action_view/template_error.rb
@@ -81,9 +81,9 @@ module ActionView
private
def strip_base_path(path)
- File.expand_path(path).
- gsub(/^#{Regexp.escape File.expand_path(RAILS_ROOT)}/, '').
- gsub(@base_path, "")
+ stripped_path = File.expand_path(path).gsub(@base_path, "")
+ stripped_path.gsub!(/^#{Regexp.escape File.expand_path(RAILS_ROOT)}/, '') if defined?(RAILS_ROOT)
+ stripped_path
end
def source_location