Synchronizing Files 2

Posted by science on December 23, 2007

Syncronized Photons

Science regularly has to synchronize files across file systems. Normally, this would involve a Ruby script or something heinous in a shell language. But that’s just business. When the synchronization is complex, the problem is much more difficult. Answering questions like these becomes a major painola: was the file deleted from one side, or added to the other? Was the folder renamed or removed?

It’s possible to try to be clever and check all your things into SVN to manage the changes, but with gigabytes of music files, for example, this could be another kind of pain (if I delete “Wham Rap” from my collection - not that I would - I don’t want it kicking around in the SVN repo taking up space).

There’s a better way. Continue reading…

Using ActiveMerchant to process credit cards in Ruby/Rails 3

Posted by science on December 13, 2007

Ionic pillar

ActiveMerchant is a very nice little Ruby library that permits connecting to payment processing gateways to charge money against credit cards. To understand how this works, you need to know that there are two separate entities, a “payment gateway” and a “merchant account” (aka a bank). The Payment Gateway receives your request over the Internet for a charge, and authorizes that charge in real-time. The Gateway then hands the authorization/transaction over to the Merchant Account, which converts that credit card transaction into money in your account.

Continue reading…