Module: Ext::Sendfile

Extended by:
Equipment
Defined in:
lib/ext/sendfile.rb

Overview

The Sendfile equipment allows you to send files to the browser. See Base#sendfile for more options.

Features

  • Autodetects if the ‘sendfile` extension is used in mongrel.

  • Provides mime-type resolution trough the ‘mime/types’ library.

I encourage everybody to use that lib when dealing with mime types.

Dependencies

  • Equipment

  • Forward

  • ‘mime-types` package. Available as a gem.

  • ‘sendfile` package (optional). Available as a gem.

Example

module Controllers
  class ShowPasswd
    def get
      # ...
      sendfile('/etc/password')
    end
  end
end

TODO

  • Implement force_download

Defined Under Namespace

Modules: Base

Constant Summary

Constants included from Equipment

Equipment::DATA_PATH, Equipment::LIB_PATH

Instance Attribute Summary

Attributes included from Equipment

#debug

Method Summary

Methods included from Equipment

dependencies, depends_on, equip, equip_all, global_extensions, included