From eb0bf16cce4b41c1ada6c031c37414c41deb9ceb Mon Sep 17 00:00:00 2001 From: Paul Chaignon Date: Tue, 4 Aug 2015 17:28:52 +0200 Subject: [PATCH] Case-insensitive extension match for heuristic rules --- lib/linguist/heuristics.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/linguist/heuristics.rb b/lib/linguist/heuristics.rb index a6346005..fc8699c5 100644 --- a/lib/linguist/heuristics.rb +++ b/lib/linguist/heuristics.rb @@ -56,7 +56,7 @@ module Linguist # Internal: Check if this heuristic matches the candidate languages. def matches?(filename) - @extensions.any? { |ext| filename.end_with?(ext) } + @extensions.any? { |ext| filename.downcase.end_with?(ext) } end # Internal: Perform the heuristic @@ -351,7 +351,7 @@ module Linguist end end - disambiguate ".r", ".R" do |data| + disambiguate ".r" do |data| if /\bRebol\b/i.match(data) Language["Rebol"] elsif data.include?("<-")