Permalink
Browse files

Blame controller files #684

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@718 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
  • Loading branch information...
1 parent f153f42 commit 8322ea45c1087325fd428a201749791550bc7859 @dhh dhh committed Feb 20, 2005
Showing with 10 additions and 4 deletions.
  1. +10 −4 activesupport/lib/active_support/dependencies.rb
@@ -109,7 +109,11 @@ def path() [] end
# Load the source file at the given file path
def load_file!(file_path)
- root.module_eval(IO.read(file_path), file_path, 1)
+ begin root.module_eval(IO.read(file_path), file_path, 1)
+ rescue Object => exception
+ exception.blame_file! file_path
+ raise
+ end
end
# Erase all items in this module
@@ -197,10 +201,12 @@ def blame_file!(file)
(@blamed_files ||= []).unshift file
end
- attr_reader :blamed_files
+ def blamed_files
+ @blamed_files ||= []
+ end
def describe_blame
return nil if blamed_files.empty?
- "This error occured while loading the following files:\n #{blamed_files.join '\n '}"
+ "This error occured while loading the following files:\n #{blamed_files.join "\n "}"
end
-end
+end

0 comments on commit 8322ea4

Please sign in to comment.