mirror of
https://github.com/KevinMidboe/linguist.git
synced 2025-10-29 17:50:22 +00:00
Tweak docs
This commit is contained in:
@@ -110,16 +110,16 @@ module Linguist
|
||||
# Bail early if the blob is binary or empty.
|
||||
return nil if blob.likely_binary? || blob.binary? || blob.empty?
|
||||
|
||||
# Call each strategy until one candidate is returned
|
||||
# Call each strategy until one candidate is returned.
|
||||
STRATEGIES.reduce([]) do |languages, strategy|
|
||||
candidates = strategy.call(blob, languages)
|
||||
if candidates.size == 1
|
||||
return candidates.first
|
||||
elsif candidates.size > 1
|
||||
# More than one candidate was found, pass them to the next strategy
|
||||
# More than one candidate was found, pass them to the next strategy.
|
||||
candidates
|
||||
else
|
||||
# Strategy couldn't find any candidates, so pass on the original list
|
||||
# No candiates were found, pass on languages from the previous strategy.
|
||||
languages
|
||||
end
|
||||
end.first
|
||||
|
||||
Reference in New Issue
Block a user