Authenticating to Amazon Product API in ruby

So, the Amazon Product Advertising API (formerly known as Amazon E-Commerce API, formerly known as just Amazon Web Services back when it was the only one) will require a cryptographic signature on all requests in order to use it, after August 15th.

Not really very much code, but does anyone think I should turn it into a free-standing gem? If so, anyone want to tell me how to do that? And, for non-Rails-specific gems, what’s the current best practice as far as what framework to use for included unit tests?

Oh, and even though it’s not very much code, it would have been a pain to figure out if I hadn’t just copied it from Chris Roos, thanks Chris! The only issue with Chris’s code is it didn’t properly escape input before generating a signature according to Amazon’s specs; perhaps this wasn’t an issue with the sort of input you’d generally have with whatever other (not Product Advertising API) services Chris actually wrote his code for (or maybe those other Amazon services actually had a different escaping spec).

Yep, I’ve been using it for months. (Even before August 15, you could optionally sign your requests, and I confirmed that if you signed them with the above code it worked, and if you signed them with a made up known bad signature, you got an error).

Hmm, weird. I am actually currently on leave, I wonder if my production code is actually currently not working. Guess I’ll find out when I return.

But no, here’s an example of my production app that’s still using the amazon product api: