Inline mime type lookup into blob helper

This commit is contained in:
Joshua Peek
2012-08-20 11:33:16 -05:00
parent 64f3509222
commit b85aeaad3e
3 changed files with 4 additions and 67 deletions

View File

@@ -32,7 +32,10 @@ module Linguist
#
# Returns a mime type String.
def mime_type
@mime_type ||= Mime.mime_for(extname.to_s)
@mime_type ||= begin
mime_type = Mime.lookup_mime_type_for(extname.to_s)
mime_type ? mime_type.to_s : 'text/plain'
end
end
# Public: Get the Content-Type header value