metafiles: reduce pathname conversions in #include?
This commit is contained in:
parent
cad5704fc7
commit
6524dfc17b
@ -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
|
|
||||||
p = path.basename(path.extname)
|
|
||||||
else
|
|
||||||
p = path.basename
|
|
||||||
end
|
|
||||||
p = p.to_s
|
|
||||||
return @metafiles.include? p
|
|
||||||
end
|
|
||||||
|
|
||||||
|
if EXTENSIONS.include?(ext)
|
||||||
|
file = File.basename(path, ext)
|
||||||
|
else
|
||||||
|
file = File.basename(path)
|
||||||
|
end
|
||||||
|
|
||||||
|
return @metafiles.include?(file)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user