I often need to add an extension (be it .tmp or .bak for example).
Writing path.sub_ext("#{path.extname}.tmp") is weird. Likewise for path.sub(/\z/, '.tmp'). And unfortunately + and / have exactly the same semantics, so I can't use that either.
I wish I had add_ext.
Cheers!