Module: Rack::Bunto::Utils

Defined in:
lib/rack/bunto/utils.rb

Class Method Summary collapse

Class Method Details

.file_info(path) ⇒ Object



11
12
13
14
15
16
17
18
# File 'lib/rack/bunto/utils.rb', line 11

def self.file_info(path)
  info = {
    :body => ::File.read(path),
    :time => ::File.mtime(path).httpdate
  }

  info
end

.media_type(filename) ⇒ Object



5
6
7
8
9
# File 'lib/rack/bunto/utils.rb', line 5

def self.media_type(filename)
  extension = ::File.extname(filename)

  Rack::Mime.mime_type(extension)
end