mirror of
				https://github.com/KevinMidboe/linguist.git
				synced 2025-10-29 17:50:22 +00:00 
			
		
		
		
	Simplify detect
This commit is contained in:
		| @@ -15,11 +15,7 @@ module Linguist | |||||||
|       # Returns an Array with one Language if the blob has a Vim or Emacs modeline |       # Returns an Array with one Language if the blob has a Vim or Emacs modeline | ||||||
|       # that matches a Language name or alias. Returns an empty array if no match. |       # that matches a Language name or alias. Returns an empty array if no match. | ||||||
|       def self.call(blob, _ = nil) |       def self.call(blob, _ = nil) | ||||||
|         if language = Language.find_by_alias(modeline(blob.data)) |         Array(Language.find_by_alias(modeline(blob.data))) | ||||||
|           return [language] |  | ||||||
|         else |  | ||||||
|           return [] |  | ||||||
|         end |  | ||||||
|       end |       end | ||||||
|  |  | ||||||
|       # Public: Get the modeline from the first n-lines of the file |       # Public: Get the modeline from the first n-lines of the file | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user