Fix error when matching languages against heuristics: if no language, no heuristic rule should be used

This commit is contained in:
Paul Chaignon
2014-12-02 16:41:39 -05:00
parent 39037d5bfb
commit 37ffdb9020

View File

@@ -53,7 +53,7 @@ module Linguist
# Internal: Check if this heuristic matches the candidate languages.
def matches?(candidates)
candidates.all? { |l| @languages.include?(l.name) }
candidates.any? && candidates.all? { |l| @languages.include?(l.name) }
end
# Internal: Perform the heuristic