mirror of
				https://github.com/KevinMidboe/linguist.git
				synced 2025-10-29 17:50:22 +00:00 
			
		
		
		
	Don't need to support mime fallback
This commit is contained in:
		| @@ -15,7 +15,7 @@ module Linguist | |||||||
|     end |     end | ||||||
|  |  | ||||||
|     def mime_type |     def mime_type | ||||||
|       Mime.lookup(name.extname, @blob.mime_type) |       Mime.lookup(name.extname) | ||||||
|     end |     end | ||||||
|  |  | ||||||
|     def size |     def size | ||||||
|   | |||||||
| @@ -10,13 +10,11 @@ module Linguist | |||||||
|   module Mime |   module Mime | ||||||
|     Special = YAML.load_file(File.expand_path("../special_mime_types.yml", __FILE__)) |     Special = YAML.load_file(File.expand_path("../special_mime_types.yml", __FILE__)) | ||||||
|  |  | ||||||
|     def self.lookup(ext, orginal_type = nil) |     def self.lookup(ext) | ||||||
|       ext ||= '' |       ext ||= '' | ||||||
|  |  | ||||||
|       if orginal_type.nil? |  | ||||||
|       guesses = ::MIME::Types.type_for(ext) |       guesses = ::MIME::Types.type_for(ext) | ||||||
|       orginal_type = guesses.first ? guesses.first.simplified : 'text/plain' |       orginal_type = guesses.first ? guesses.first.simplified : 'text/plain' | ||||||
|       end |  | ||||||
|  |  | ||||||
|       type = Special[orginal_type] || |       type = Special[orginal_type] || | ||||||
|         Special[ext.sub(/^\./, '')] || |         Special[ext.sub(/^\./, '')] || | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user