Method: Merb::BootLoader::LoadClasses.remove_classes_in_file

Defined in:
lib/merb-core/bootloader.rb

.remove_classes_in_file(file) {|file| ... } ⇒ Object

Parameters

file<String>

The file to remove classes for.

&block

A block to call with the file that has been removed.

Yields:

  • (file)


402
403
404
405
406
407
408
409
# File 'lib/merb-core/bootloader.rb', line 402

def remove_classes_in_file(file, &block)
  Merb.klass_hashes.each {|x| x.protect_keys!}
  if klasses = LOADED_CLASSES.delete(file)
    klasses.each { |klass| remove_constant(klass) unless klass.to_s =~ /Router/ }
  end
  yield file if block_given?
  Merb.klass_hashes.each {|x| x.unprotect_keys!}
end