pressly/uber-s3 — pull request #15 by drsharp (2014-12-08 21:23:06+00:00)
Title: Upgraded mime-types, fixed url underscores, fix blank? not defined

DO NOT MERGE....

Hi!

You probably don't want to merge this PR outright, but I hope it gives you some ideas. I had to fork your repo and make these changes to get them to work for a project I'm working on. The issues were:
1) it's a Ruby only system (not Rails), so ".blank?" isn't defined.
2) We have some S3 buckets that pre-date their requirement to NOT use underscores. The URI.parse() method was blowing up with URLs that have underscores. Turns out the uri object is only needed to pull out the host and port for the connect, and otherwise the req_klass just connects to the URL string, so the changes here allowed it to work even if there are underscores in the subdomain (which can happen with older S3 buckets)
3) The mime-types change is probably not necessary. I had a Bundler error early on, but it seems to work fine with 1.19 or 2.4.3, so that part isn't important.

Anyway, if you like, I can clean up #1 and #2 so that they are merge-able... i.e. not just check for nil but also check for empty... maybe something like: self.region.to_s.empty? which would work if self.region is nil or self.region is an empty string.