Method deprecated or moved
This method is deprecated or moved on the latest stable version.
The last existing version (v6.0.0) is shown here.
filter_out_descendants(dirs)
public
Filters out directories which are descendants of others in the collection
(stable).
# File activesupport/lib/active_support/evented_file_update_checker.rb, line 208
def filter_out_descendants(dirs)
return dirs if dirs.length < 2
dirs_sorted_by_nparts = dirs.sort_by { |dir| dir.each_filename.to_a.length }
descendants = []
until dirs_sorted_by_nparts.empty?
dir = dirs_sorted_by_nparts.shift
dirs_sorted_by_nparts.reject! do |possible_descendant|
ascendant_of?(dir, possible_descendant) && descendants << possible_descendant
end
end
# Array#- preserves order.
dirs - descendants
end