Merge pull request #2533 from github/rrebol

Adding back R/Rebol heuristics
This commit is contained in:
Arfon Smith
2015-08-04 12:45:44 +01:00
2 changed files with 15 additions and 0 deletions

View File

@@ -350,5 +350,13 @@ module Linguist
Language["xBase"]
end
end
disambiguate ".r", ".R" do |data|
if /\bRebol\b/i.match(data)
Language["Rebol"]
elsif data.include?("<-")
Language["R"]
end
end
end
end

View File

@@ -179,4 +179,11 @@ class TestHeuristcs < Minitest::Test
"xBase" => all_fixtures("xBase", ".ch")
})
end
def test_r_by_heuristics
assert_heuristics({
"R" => all_fixtures("R", "*.r") + all_fixtures("R", "*.R"),
"Rebol" => all_fixtures("Rebol", "*.r")
})
end
end