Blame controller files #684
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@718 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
This commit is contained in:
parent
f153f42469
commit
8322ea45c1
@ -109,7 +109,11 @@ def path() [] end
|
|||||||
|
|
||||||
# Load the source file at the given file path
|
# Load the source file at the given file path
|
||||||
def load_file!(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
|
end
|
||||||
|
|
||||||
# Erase all items in this module
|
# Erase all items in this module
|
||||||
@ -197,10 +201,12 @@ def blame_file!(file)
|
|||||||
(@blamed_files ||= []).unshift file
|
(@blamed_files ||= []).unshift file
|
||||||
end
|
end
|
||||||
|
|
||||||
attr_reader :blamed_files
|
def blamed_files
|
||||||
|
@blamed_files ||= []
|
||||||
|
end
|
||||||
|
|
||||||
def describe_blame
|
def describe_blame
|
||||||
return nil if blamed_files.empty?
|
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
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user