maint - restore ruby 1.8.7 compatibility

In ruby 1.8.7 the Pathname#to_path method is called Pathname#TO_PATH.  In both
1.9.3 and 1.8.7 it's also aliased to #to_s so switch over to using .to_s
everywhere instead.

http://www.ruby-doc.org/stdlib-1.8.7/libdoc/pathname/rdoc/Pathname.html#method-i-TO_PATH
http://www.ruby-doc.org/stdlib-1.9.3/libdoc/pathname/rdoc/Pathname.html#method-i-to_path
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.
Merge pull request #274 from richardc/tar_ruby_187

maint - restore ruby 1.8.7 compatibility