Gem update incorportating changes by other users

Would you please consider merging these changes and uploading a new gem to RubyGems please?
This gem is useful but hasn't seen attention for a few years. It would be nice to get a new Gem version to release the changes that other contributors have made.

I did this because I found it breaks with a path-less remote URI becuase it tries and fails to create a directory from a nil string. I fixed this myself locally before noticing that @pablasso had submitted a fix for the same problem two years ago.

It would help immensely if we could get the latest code base onto RubyGems so it's easy to install the latest version that includes these bugfixes and enhancements.