Sha256: 928ed2fe3bebc49a5a9e5b2784086bd14486a3f231816c65677a182a8a9e16dc

Contents?: true

Size: 645 Bytes

Versions: 1

Compression:

Stored size: 645 Bytes

Contents

module Paperclip
  class << self
    if defined? Rack::Mime
      def content_type_for(type) #:nodoc:
        Rack::Mime.mime_type(".#{type}")
      end
    else
      def content_type_for(type) #:nodoc:
        case type
        when %r"jpe?g"                 then "image/jpeg"
        when %r"tiff?"                 then "image/tiff"
        when %r"png", "gif", "bmp"     then "image/#{type}"
        when "txt"                     then "text/plain"
        when %r"html?"                 then "text/html"
        when "csv", "xml", "css", "js" then "text/#{type}"
        else "application/x-#{type}"
        end
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
phildarnowsky-paperclip-2.2.10 lib/paperclip/content_type.rb