mirror of
https://github.com/KevinMidboe/linguist.git
synced 2025-10-29 17:50:22 +00:00
Fix #1731 to allow samples with multiple file extension segments.
This commit is contained in:
committed by
Brandon Keepers
parent
80ed2d6d30
commit
6ae39e50ae
@@ -548,7 +548,7 @@ module Linguist
|
|||||||
|
|
||||||
if extnames = extensions[name]
|
if extnames = extensions[name]
|
||||||
extnames.each do |extname|
|
extnames.each do |extname|
|
||||||
if !options['extensions'].include?(extname)
|
if !options['extensions'].index { |x| x.end_with? extname }
|
||||||
warn "#{name} has a sample with extension (#{extname}) that isn't explicitly defined in languages.yml" unless extname == '.script!'
|
warn "#{name} has a sample with extension (#{extname}) that isn't explicitly defined in languages.yml" unless extname == '.script!'
|
||||||
options['extensions'] << extname
|
options['extensions'] << extname
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -43,7 +43,7 @@ class TestSamples < Test::Unit::TestCase
|
|||||||
if extnames = Samples.cache['extnames'][name]
|
if extnames = Samples.cache['extnames'][name]
|
||||||
extnames.each do |extname|
|
extnames.each do |extname|
|
||||||
next if extname == '.script!'
|
next if extname == '.script!'
|
||||||
assert options['extensions'].include?(extname), "#{name} has a sample with extension (#{extname}) that isn't explicitly defined in languages.yml"
|
assert options['extensions'].index { |x| x.end_with? extname }, "#{name} has a sample with extension (#{extname}) that isn't explicitly defined in languages.yml"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user