granth green sumo

turkey sandwiches!

IMG_6836 Second Beach Beaver Lake Coal Harbour Photo Photo

Typecast Fix for Backpack Calendar Ruby Library 29 October 2007

The response from the Backpack calendar API changed slightly at some point and broke the Ruby wrapper. I haven’t used my Backpack calendar Quicksilver script in a while, so I don’t know how long this has been the case.

When the library tries to convert the response XML into a nice Ruby object, the typecastvalue method chokes on two new cases:

  1. When you request /calendars.xml the <calendars> element now has a type attribute of array.

  2. The occurs-until element in a calendar-event can be empty but still has a type attribute.

My simplistic patch specifically ignores these two cases. It also changes require-gem to require to stifle a RubyGems warning.

previously: Problem Solved