Module: ActiveSupport::Dependencies::Blamable

Defined in:
lib/active_support/dependencies.rb

Overview

Exception file-blaming

Instance Method Summary collapse

Instance Method Details

#blame_file!(file) ⇒ Object

:nodoc:



211
212
213
# File 'lib/active_support/dependencies.rb', line 211

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

#blamed_filesObject



215
216
217
# File 'lib/active_support/dependencies.rb', line 215

def blamed_files
  @blamed_files ||= []
end

#copy_blame!(exc) ⇒ Object



224
225
226
227
# File 'lib/active_support/dependencies.rb', line 224

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

#describe_blameObject



219
220
221
222
# File 'lib/active_support/dependencies.rb', line 219

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