class Rake::FileList

def exclude?(fn)

Should the given file name be excluded?
def exclude?(fn)
  return true if @exclude_patterns.any? do |pat|
    case pat
    when Regexp
      fn =~ pat
    when /[*?]/
      File.fnmatch?(pat, fn, File::FNM_PATHNAME)
    else
      fn == pat
    end
  end
  @exclude_procs.any? { |p| p.call(fn) }
end