Justin James Grevich
2010-Mar-12 21:01 UTC
[iCalendar-devel] Writing calendar files to .ics with more than one event.
Hi, I have a huge (2.2 MB) .ics file that I am trying to import into Google Calendar. Google suggests file sizes no greater than 1 MB. Unfortunately, it fails when I try to upload it in it''s entirety or when I try to manually split it up into smaller chunks (6-800k). I have now looked into the iCalendar gem as a way to split up the .ics file into calendars by year (there are about 8000 events (8 years worth) ). Here is the code I used to create a .ics file for all 2010 events: http://pastie.org/867072. That fails with a "NoMethodError: Method Name: <=>"; here''s the full backtrace: http://pastie.org/867074 I then modified my first script so that it will write each event as an individual .ics file thinking there was a corrupt event (aka. needle in the hay stack): http://pastie.org/867078 . Instead of finding the corrupt event, this worked just fine and produced a correct .ics for each event. BTW, Have we thought of adding methods to the gem for merging/splitting .ics files? That might be useful. After looking into the errors with the first script, I noticed it is caused whenever you try to do a .to_ical on a Calendar object with more than 1 event. Am I missing something here? Any help or suggestions will be greatly appreciated. Thanks, justin