-Mike
Mike Reich
Seabourne Consulting
mi...@seabourneconsulting.com
425-296-2440
Thanks for the ultra-quick response! I really appreciate what you're doing. I was amazed how little there was in the Ruby/Google API Arena. I might be able to help contribute a bit here and there possibly as I am using these gems in my CRM software (www.karmacrm.com) to integrate with Google Calendar and hopefully Google Docs down the road (thx to your other handy gem).
I will be pushing the gem to its full capacity as I am planning on offering full Google Calendar syncing to my users including recurring events ETC.
I noticed the GCal4Ruby::Recurrance class had a problem with the #load method based on what Google was returning so I overloaded it as follows:
--------------
#Accepts a string containing a properly formatted ISO 8601 recurrence rule and loads it into the recurrence object
def load(rec)
@frequency = {}
attrs = rec.split("\n")
attrs.each do |val|
key, value = val.split(":")
if key == 'RRULE'
value.split(";").each do |rr|
rr_key, rr_value = rr.split("=")
rr_key = rr_key.downcase.to_sym
unless @frequency.has_key?(rr_key)
if rr_key == :until
@repeat_until = Time.parse_complete(rr_value)
else
@frequency[rr_key] = rr_value
end
end
end
elsif key == 'INTERVAL'
@frequency[:inverval] = value.to_i
elsif key.include?("DTSTART;TZID")
@start_time = Time.parse_complete(value)
elsif key.include?("DTEND;TZID")
@end_time = Time.parse_complete(value)
end
end
end
--------------
With this I was able to build a hash that gave me all the recurrence rules I needed to build a proper recurring event using the IceCube library. This might not jive well with the rest of your code base (which I haven't gotten to yet) so I figured I would show you what I was thinking and maybe there is a way to incorporate the fix back into the code base.
Anyways good to chat with you and keep up the awesome work!
-JP