Split mime type and content type

This commit is contained in:
Joshua Peek
2011-05-20 11:24:32 -05:00
parent 0f0f6d282b
commit 0651355e71
7 changed files with 83 additions and 45 deletions

View File

@@ -34,11 +34,19 @@ module Linguist
end
def mime_type
@mime_type ||= Mime.lookup(extname)
@mime_type ||= Mime.mime_for(extname)
end
def media_type
mime_type.split('/').first
mime_type.split('/')[0]
end
def sub_type
mime_type.split('/')[1]
end
def content_type
@content_type ||= Mime.content_type_for(extname)
end
def to_s