normalized_file_list(options, relative_files, force_doc = false, exclude_pattern=nil)
private
Given a list of files and directories, create a list of all the Ruby files
they contain.
If force_doc is true, we always add the given files. If false,
only add files that we guarantee we can parse It is true when looking at
files given on the command line, false when recursing through
subdirectories.
The effect of this is that if you want a file with a non- standard
extension parsed, you must name it explicity.
Show source
def normalized_file_list(options, 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)
case type = stat.ftype
when "file"
next if @last_created and stat.mtime < @last_created
file_list << rel_file_name.sub(/^\.\//, '') if force_doc || ParserFactory.can_parse(rel_file_name)
when "directory"
next if rel_file_name == "CVS" || rel_file_name == ".svn"
dot_doc = File.join(rel_file_name, DOT_DOC_FILENAME)
if File.file?(dot_doc)
file_list.concat(parse_dot_doc_file(rel_file_name, dot_doc, options))
else
file_list.concat(list_files_in_directory(rel_file_name, options))
end
else
raise RDocError.new("I can't deal with a #{type} #{rel_file_name}")
end
end
file_list
end