class Rack::Directory::DirectoryBody
to each file.
Body class for directory entries, showing an index page with links
def DIR_FILE_escape(htmls)
def DIR_FILE_escape(htmls) htmls.map { |e| Utils.escape_html(e) } end
def each
def each show_path = Utils.escape_html(path.sub(/^#{root}/, '')) yield(DIR_PAGE_HEADER % [ show_path, show_path ]) unless path.chomp('/') == root yield(DIR_FILE % DIR_FILE_escape(files.call('..'))) end Dir.foreach(path) do |basename| next if basename.start_with?('.') next unless f = files.call(basename) yield(DIR_FILE % DIR_FILE_escape(f)) end yield(DIR_PAGE_FOOTER) end