Class Rack::File
In: lib/rack/file.rb
Parent: Object

Rack::File serves files below the root given, according to the path info of the Rack request.

Handlers can detect if bodies are a Rack::File, and use mechanisms like sendfile on the path.

Methods

_call   call   each   forbidden   new   not_found   serving  

Constants

F = ::File

External Aliases

path -> to_path

Attributes

path  [RW] 
root  [RW] 

Public Class methods

Public Instance methods

NOTE:

  We check via File::size? whether this file provides size info
  via stat (e.g. /proc files often don't), otherwise we have to
  figure it out by reading the whole file into memory. And while
  we're at it we also use this as body then.

[Validate]