diff --git a/lib/linguist/heuristics.rb b/lib/linguist/heuristics.rb index 13033579..dd1585f8 100644 --- a/lib/linguist/heuristics.rb +++ b/lib/linguist/heuristics.rb @@ -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