Hominid Gem Version 2.0.2
We’ve updated the Hominid gem to version 2.0.2 over the weekend, and the update is a pretty big one. Hominid is a Ruby gem for interacting with the Mailchimp API, allowing Ruby developers to easily integrate their applications with Mailchimp’s email marketing service.
Changes to Hominid
First of all, I think it’s important to note that this update will probably break any older code. Previously, thanks to Michael StrĂ¼der, we had organized the gem to be object-oriented with respect to the resources at Mailchimp that someone would be working with, such as a campaign or a mailing list. This has been removed, in favor of making a single class that can access all methods of the API. This way, when you create a Hominid object in your applications, it represents a connection to a particular Mailchimp account, rather than a connection to just one resource. Because of this, some methods have been renamed, so:
list = Hominid::List.find_by_name("My Mailing List")
has now become:
h = Hominid::Base.new({:api_key => API_KEY})
list = h.find_list_by_name("My Mailing List")
No More Configuration File
Another big change to this update is that we have removed Rails-specific code from the gem, such as the configuration file that was previously required, and the rake task to generate this file. We opted to go more “Ruby like” with it, so that when creating a Hominid object you just need to pass in your Mailchimp API key, and any other configuration options that you want to override from the defaults. I recommend using something like SettingsLogic or environment variables to store your API key.
A Complete API Wrapper
Also, as a bonus, I have also added support for all the missing methods that were not previously supported, making Hominid a complete wrapper for the Mailchimp API. There were only a few methods missing, but they are now available, and I have tried very hard to make the documentation consistent and complete. Simply refer to the files to find out what methods are available, and how to use them.
As always, if anyone finds a bug please let us know. If you happen to see room for improvement, please let us know. Hominid is an open source project and you can view the code at Github.