Skip to content
Snippets Groups Projects
Commit 6d0f0cb1 authored by Jack Nagel's avatar Jack Nagel
Browse files

metafiles: simplify #copy? further

parent 07257f2f
No related branches found
No related tags found
No related merge requests found
......@@ -378,7 +378,7 @@ class Pathname
def install_metafiles from=Pathname.pwd
Pathname(from).children.each do |p|
next if p.directory?
next unless Metafiles.copy?(p)
next unless Metafiles.copy?(p.basename.to_s)
# Some software symlinks these files (see help2man.rb)
filename = p.resolved_path
# Some software links metafiles together, so by the time we iterate to one of them
......
......@@ -10,16 +10,10 @@ class Metafiles
!copy?(file)
end
def self.copy?(path)
path = path.to_s.downcase
ext = File.extname(path)
if EXTENSIONS.include?(ext)
basename = File.basename(path, ext)
else
basename = File.basename(path)
end
return BASENAMES.include?(basename)
def self.copy?(file)
file = file.downcase
ext = File.extname(file)
file = File.basename(file, ext) if EXTENSIONS.include?(ext)
BASENAMES.include?(file)
end
end
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment