Sha256: 08d0ce5e0ea898758daaab4f747d6795ebae2a5656c15202c36ef7c3cf3a3c75

Contents?: true

Size: 527 Bytes

Versions: 2

Compression:

Stored size: 527 Bytes

Contents

#          Copyright (c) 2006 Michael Fellinger m.fellinger@gmail.com
# All files in this distribution are subject to the terms of the Ruby license.

module Ramaze
  module FileHelper
    private

    # Sets Content-Type to the mimetype of the file and opens the file you pass
    # it, then throws :respond to finish off the request.

    def send_file(file, mime_type = Tool::MIME.type_for(file))
      response.header["Content-Type"] = mime_type
      response.body = File.open(file)
      throw(:respond)
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
ramaze-0.1.1 lib/ramaze/helper/file.rb
ramaze-0.1.2 lib/ramaze/helper/file.rb