From 208ec3906ff1ad60fd869713a51adcf5ddc54407 Mon Sep 17 00:00:00 2001 From: Arfon Smith Date: Tue, 4 Aug 2015 12:06:41 +0100 Subject: [PATCH] Fixing up some new heuristics --- lib/linguist/heuristics.rb | 6 +++--- test/test_heuristics.rb | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/linguist/heuristics.rb b/lib/linguist/heuristics.rb index d3cbc167..66980945 100644 --- a/lib/linguist/heuristics.rb +++ b/lib/linguist/heuristics.rb @@ -329,7 +329,7 @@ module Linguist end end - disambiguate "Groff", "Nemerle" do |data| + disambiguate ".n" do |data| if /^[.']/.match(data) Language["Groff"] elsif /^(module|namespace|using)\s/.match(data) @@ -337,7 +337,7 @@ module Linguist end end - disambiguate "GAS", "Groff" do |data| + disambiguate ".ms" do |data| if /^[.'][a-z][a-z](\s|$)/i.match(data) Language["Groff"] elsif /((^|\s)move?[. ])|\.(include|globa?l)\s/.match(data) @@ -345,7 +345,7 @@ module Linguist end end - disambiguate "xBase", "Charity" do |data| + disambiguate ".ch" do |data| if /^\s*#\s*(if|ifdef|ifndef|define|command|xcommand|translate|xtranslate|include|pragma|undef)\b/i.match(data) Language["xBase"] end diff --git a/test/test_heuristics.rb b/test/test_heuristics.rb index 33bdf161..94418b3b 100644 --- a/test/test_heuristics.rb +++ b/test/test_heuristics.rb @@ -176,7 +176,7 @@ class TestHeuristcs < Minitest::Test def test_ch_by_heuristics assert_heuristics({ - "xBase" => all_fixtures("xBase") + "xBase" => all_fixtures("xBase", ".ch") }) end end