Class: Merb::BootLoader::ReloadClasses
- Inherits:
-
Merb::BootLoader
- Object
- Merb::BootLoader
- Merb::BootLoader::ReloadClasses
- Defined in:
- lib/merb-core/bootloader.rb
Defined Under Namespace
Classes: TimedExecutor
Class Method Summary collapse
-
.reload ⇒ Object
Reloads all files.
-
.run ⇒ Object
Setup the class reloader if it’s been specified in config.
Methods inherited from Merb::BootLoader
after, after_app_loads, before, before_app_loads, default_framework, finished?, inherited, move_klass
Class Method Details
.reload ⇒ Object
Reloads all files.
683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 |
# File 'lib/merb-core/bootloader.rb', line 683 def self.reload paths = [] Merb.load_paths.each do |path_name, file_info| path, glob = file_info next unless glob paths << Dir[path / glob] end paths << Merb.dir_for(:application) if Merb.dir_for(:application) && File.file?(Merb.dir_for(:application)) paths.flatten.each do |file| next if Merb::BootLoader::LoadClasses::MTIMES[file] && Merb::BootLoader::LoadClasses::MTIMES[file] == File.mtime(file) Merb::BootLoader::LoadClasses.reload(file) end end |