maint - 1.8.7 lacks Pathname#sub_ext

Ruby 1.8.7 lacks Pathname#sub_ext, so write out the slightly wordier regular
expression for 'last extension' and use Pathname#sub.