Sha256: 388e8d6e4816f21cd38e78713519f9e2a070c3a8269dfc91e277eb9c57ed7329
Contents?: true
Size: 393 Bytes
Versions: 1
Compression:
Stored size: 393 Bytes
Contents
module ServerHere class FileWrapper def initialize file @f = file end def last_mod @last_mod ||= File.mtime(@f).strftime '%a, %d %b %Y %T GMT' end def ext File.extname(@f).gsub(/\./, '') end def content_type 'text/' + (%w{html css}.include?(ext) ? ext : 'plain') end def to_body [File.read(@f)] end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
server_here-0.1.0 | lib/server_here/file_wrapper.rb |