Preserve dirname for .with_extension; drop .base

This commit is contained in:
Paul van Tilburg 2021-12-09 17:42:17 +01:00
parent aa605a4306
commit c50791cba1
Signed by: paul
GPG Key ID: C6DE073EDA9EEC4D
1 changed files with 1 additions and 4 deletions

View File

@ -143,12 +143,9 @@ if ARGV.empty?
exit 1
else
infile = Pathname.new(ARGV.shift)
def infile.base
basename(extname)
end
def infile.with_extname(ext)
file = base
file = dirname + basename(extname)
file.extname = ".#{ext}"
file
end