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 | ||||
|  | ||||
|     def mime_type | ||||
|       Mime.lookup(name.extname, @blob.mime_type) | ||||
|       Mime.lookup(name.extname) | ||||
|     end | ||||
|  | ||||
|     def size | ||||
|   | ||||
| @@ -10,13 +10,11 @@ module Linguist | ||||
|   module Mime | ||||
|     Special = YAML.load_file(File.expand_path("../special_mime_types.yml", __FILE__)) | ||||
|  | ||||
|     def self.lookup(ext, orginal_type = nil) | ||||
|     def self.lookup(ext) | ||||
|       ext ||= '' | ||||
|  | ||||
|       if orginal_type.nil? | ||||
|         guesses = ::MIME::Types.type_for(ext) | ||||
|         orginal_type = guesses.first ? guesses.first.simplified : 'text/plain' | ||||
|       end | ||||
|       guesses = ::MIME::Types.type_for(ext) | ||||
|       orginal_type = guesses.first ? guesses.first.simplified : 'text/plain' | ||||
|  | ||||
|       type = Special[orginal_type] || | ||||
|         Special[ext.sub(/^\./, '')] || | ||||
|   | ||||
		Reference in New Issue
	
	Block a user