Module: Ext::Mount::Views

Defined in:
lib/ext/mount.rb

Instance Method Summary collapse

Instance Method Details

#mount_listingObject

Default dir listing. Available variables :

* @files : contains all the file's basenames.
* @rel_path     : relative path
* @public_path  : the actual public path
* @parent_path  : the public parent path
* @private_path : the actual private folder path


142
143
144
145
146
147
148
149
150
151
# File 'lib/ext/mount.rb', line 142

def mount_listing
  h1 "Dir listing of #{@public_path}"
  ul do
    li { a '..', :href => @parent_path } unless @rel_path == ''
    @files.each do |file|
      li { a file, :href => "#{@public_path}/#{file}" }
    end
    nil
  end
end