Module: ActiveSupport::Dependencies::Blamable

Defined in:
lib/gems/activesupport-2.2.2/lib/active_support/dependencies.rb

Overview

Exception file-blaming

Instance Method Summary collapse

Instance Method Details

#blame_file!(file) ⇒ Object

:nodoc:



182
183
184
# File 'lib/gems/activesupport-2.2.2/lib/active_support/dependencies.rb', line 182

def blame_file!(file)
  (@blamed_files ||= []).unshift file
end

#blamed_filesObject



186
187
188
# File 'lib/gems/activesupport-2.2.2/lib/active_support/dependencies.rb', line 186

def blamed_files
  @blamed_files ||= []
end

#copy_blame!(exc) ⇒ Object



195
196
197
198
# File 'lib/gems/activesupport-2.2.2/lib/active_support/dependencies.rb', line 195

def copy_blame!(exc)
  @blamed_files = exc.blamed_files.clone
  self
end

#describe_blameObject



190
191
192
193
# File 'lib/gems/activesupport-2.2.2/lib/active_support/dependencies.rb', line 190

def describe_blame
  return nil if blamed_files.empty?
  "This error occurred while loading the following files:\n   #{blamed_files.join "\n   "}"
end