mirror of
https://github.com/KevinMidboe/linguist.git
synced 2025-10-29 17:50:22 +00:00
Split mime type and content type
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user