Disambiguate .r extension between Rebol and R

This commit is contained in:
Barry Walsh
2014-03-27 16:54:24 +00:00
parent c971c14a83
commit bb2afbb03d

View File

@@ -28,6 +28,9 @@ module Linguist
if languages.all? { |l| ["Common Lisp", "OpenCL"].include?(l) }
disambiguate_cl(data, languages)
end
if languages.all? { |l| ["Rebol", "R"].include?(l) }
disambiguate_r(data, languages)
end
end
end
@@ -73,6 +76,13 @@ module Linguist
matches
end
def self.disambiguate_r(data, languages)
matches = []
matches << Language["Rebol"] if /\bRebol\b/i.match(data)
matches << Language["R"] if data.include?("<-")
matches
end
def self.active?
!!ACTIVE
end