Preserve dirname for .with_extension; drop .base
This commit is contained in:
parent
aa605a4306
commit
c50791cba1
5
rubberin
5
rubberin
|
@ -143,12 +143,9 @@ if ARGV.empty?
|
||||||
exit 1
|
exit 1
|
||||||
else
|
else
|
||||||
infile = Pathname.new(ARGV.shift)
|
infile = Pathname.new(ARGV.shift)
|
||||||
def infile.base
|
|
||||||
basename(extname)
|
|
||||||
end
|
|
||||||
|
|
||||||
def infile.with_extname(ext)
|
def infile.with_extname(ext)
|
||||||
file = base
|
file = dirname + basename(extname)
|
||||||
file.extname = ".#{ext}"
|
file.extname = ".#{ext}"
|
||||||
file
|
file
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue