Tweak docs

This commit is contained in:
Brandon Keepers
2014-11-28 17:36:14 -06:00
parent e42ccf0d82
commit 577fb95384

View File

@@ -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