metafiles: reduce pathname conversions in #include?

This commit is contained in:
Jack Nagel 2014-06-07 17:45:13 -05:00
parent cad5704fc7
commit 6524dfc17b

View File

@ -22,17 +22,16 @@ class Metafiles
private private
def include? p def include?(path)
p = p.to_s # Might be a pathname path = path.to_s.downcase
p = p.downcase ext = File.extname(path)
path = Pathname.new(p)
if @exts.include? path.extname if EXTENSIONS.include?(ext)
p = path.basename(path.extname) file = File.basename(path, ext)
else else
p = path.basename file = File.basename(path)
end
p = p.to_s
return @metafiles.include? p
end end
return @metafiles.include?(file)
end
end end