mirror of
				https://github.com/KevinMidboe/linguist.git
				synced 2025-10-29 17:50:22 +00:00 
			
		
		
		
	Adding back R/Rebol heuristics
This commit is contained in:
		| @@ -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 | ||||
|   | ||||
| @@ -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 | ||||
|   | ||||
		Reference in New Issue
	
	Block a user