318
319
320
321
322
323
324
325
326
|
# File 'lib/merb-slices/module.rb', line 318
def self.start(interval = nil)
self.lookup ||= Set.new(Merb::Slices.slice_files_from_search_path)
@thread = self.every(interval || Merb::Plugins.config[:merb_slices][:autoload_interval] || 1.0) do
current_files = Set.new(Merb::Slices.slice_files_from_search_path)
(current_files - self.lookup).each { |f| Merb::Slices.activate_by_file(f) }
(self.lookup - current_files).each { |f| Merb::Slices.deactivate_by_file(f) }
self.lookup = current_files
end
end
|