diff --git a/lib/linguist/heuristics.rb b/lib/linguist/heuristics.rb index 53bb10a9..d6c097ce 100644 --- a/lib/linguist/heuristics.rb +++ b/lib/linguist/heuristics.rb @@ -40,6 +40,9 @@ module Linguist if languages.all? { |l| ["FORTRAN", "Forth"].include?(l) } result = disambiguate_f(data) end + if name.end_with? ".tst" and languages.all? { |l| ["GAP", "Scilab"].include?(l) } + result = disambiguate_tst(data) + end return result end end @@ -98,6 +101,16 @@ module Linguist matches end + def self.disambiguate_tst(data) + matches = [] + if (data.include?("gap> ")) + matches << Language["GAP"] + else + matches << Language["Scilab"] + end + matches + end + def self.disambiguate_cl(data) matches = [] if data.include?("(defun ")