# Help with iCalendar Gem

**URL:** <https://www.ruby-forum.com/t/help-with-icalendar-gem/133839>\
**Category:** Ruby\
**Created:** [April 4, 2008, 6:05am UTC](https://www.ruby-forum.com/t/help-with-icalendar-gem/133839 "2008-04-04T06:05:33Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![cparticle](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/2bfe46/32.png) [@cparticle](https://www.ruby-forum.com/u/cparticle)\
**Post date:** [April 4, 2008, 6:05am UTC](https://www.ruby-forum.com/t/help-with-icalendar-gem/133839/1 "2008-04-04T06:05:33Z")

</div>

Hi,

Does anyone have any experience with the iCalendar Gem.

I’m having trouble understanding how to make changes to my ics once  
its been read in and I’ve found and the event I want to change.

#read events from ics file  
ics\_calendar\_file = File.open(“mycalendar.ics”)  
cals = Icalendar.parse(ics\_calendar\_file)  
myICSArray = cals.first

#parse the vcal so that information can be updated  
parsedVCAL = Icalendar.parse(my\_vCal\_string)  
#modify the event in place  
myICSArray.find\_event(parsedVCal.uid) = parsedVCal

For some reason the above code didn’t work

Also does anyone know if the icalendar Gem can support all the  
icalendar features. Basically I’d like to sync against some events  
that are coming over as text. Even more specifically I’m trying to  
sync a MS Exchange calendar with an ics file via IMAP. I can get  
stuff to and from IMAP and have them show as proper events. Now I  
need to know how to get stuff through to ICS. I’d prefer to us the  
icalendar Gem so I can avoid some extra parsing logic, but Ican go  
without.

If any one can help that would be awesome. I’d be happy to post my  
script once I get it running.

Thanks.

CParticle

---

<div class="post-metadata">

**Author:** ![cparticle](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/2bfe46/32.png) [@cparticle](https://www.ruby-forum.com/u/cparticle)\
**Post date:** [April 4, 2008, 2:19pm UTC](https://www.ruby-forum.com/t/help-with-icalendar-gem/133839/2 "2008-04-04T14:19:37Z")

</div>

On Fri, Apr 04, 2008 at 01:05:17PM +0900, CParticle wrote:

> Does anyone have any experience with the iCalendar Gem.  
> […]

I found the vpim gem both more functional and more obviously (to me)  
organized than the iCalendar gem. I recommend it. I am using it in my  
project [http://calterm.rubyforge.org/](http://calterm.rubyforge.org/) with great success. Over the  
coming  
months I expect to participate in developing CalDAV support for it (i.e.  
for vpim, so I can use it in CalTerm).

> Thanks.  
> CParticle  
> –Greg

---

<div class="post-metadata">

**Author:** ![cparticle](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/2bfe46/32.png) [@cparticle](https://www.ruby-forum.com/u/cparticle)\
**Post date:** [April 4, 2008, 7:15pm UTC](https://www.ruby-forum.com/t/help-with-icalendar-gem/133839/3 "2008-04-04T19:15:55Z")

</div>

On Apr 4, 8:19 am, Gregory S. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
wrote:

> > Thanks.  
> > CParticle
> 
> –Greg

Greg,

Without getting to deep how does vpim handle and ics file does it  
break it down to an array of objects like icalendar or does it do  
something different. I’m just trying to avoid having to redo code for  
a different methodology.

Thanks

CParticle

---

<div class="post-metadata">

**Author:** ![cparticle](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/2bfe46/32.png) [@cparticle](https://www.ruby-forum.com/u/cparticle)\
**Post date:** [April 5, 2008, 5:47pm UTC](https://www.ruby-forum.com/t/help-with-icalendar-gem/133839/4 "2008-04-05T17:47:27Z")

</div>

On Sat, Apr 05, 2008 at 02:15:17AM +0900, CParticle wrote:

> > months I expect to participate in developing CalDAV support for it (i.e.  
> > break it down to an array of objects like icalendar or does it do  
> > something different. I’m just trying to avoid having to redo code for  
> > a different methodology.

A Vpim::Icalendar provides an events accessor that contains a collection  
of  
events, if that’s what you mean.

> Thanks  
> CParticle  
> –Greg
