class RDoc::RDoc

def normalized_file_list(relative_files, force_doc = false,

def normalized_file_list(relative_files, force_doc = false,
                         exclude_pattern = nil)
  file_list = []
  relative_files.each do |rel_file_name|
    next if exclude_pattern && exclude_pattern =~ rel_file_name
    stat = File.stat rel_file_name rescue next
    case type = stat.ftype
    when "file" then
      next if last_modified = @last_modified[rel_file_name] and
              stat.mtime.to_i <= last_modified.to_i
      if force_doc or RDoc::Parser.can_parse(rel_file_name) then
        file_list << rel_file_name.sub(/^\.\//, '')
        @last_modified[rel_file_name] = stat.mtime
      end
    when "directory" then
      next if rel_file_name == "CVS" || rel_file_name == ".svn"
      dot_doc = File.join rel_file_name, RDoc::DOT_DOC_FILENAME
      if File.file? dot_doc then
        file_list << parse_dot_doc_file(rel_file_name, dot_doc)
      else
        file_list << list_files_in_directory(rel_file_name)
      end
    else
      raise RDoc::Error, "I can't deal with a #{type} #{rel_file_name}"
    end
  end
  file_list.flatten
end