def rescan_mixin lib
method_names = []
lib.each_method do |name, _meth|
method_names << name
end
to_rescan = []
tracker.controllers.each do |_name, controller|
if controller.includes.include? lib.name
controller.files.each do |path|
unless @paths.include? path
to_rescan << path
end
end
end
end
to_rescan.each do |controller|
tracker.reset_controller controller
rescan_file controller
end
to_rescan = []
tracker.templates.each do |name, template|
next unless template.render_path
if template.render_path.include_any_method? method_names
name.to_s.match /^([^.]+)/
original = tracker.templates[$1.to_sym]
if original
to_rescan << [name, original.file]
end
end
end
to_rescan.each do |template|
tracker.reset_template template[0]
rescan_file template[1]
end
end