From rberger at ibd.com Tue Jan 8 05:11:58 2008 From: rberger at ibd.com (Robert J. Berger) Date: Tue, 8 Jan 2008 02:11:58 -0800 Subject: [Vpim-talk] Any Timezone support coming? Message-ID: <3607E723-989D-4B48-B93A-F127021DB64D@ibd.com> Just wondering if there might be someone who got timezone support of some kind working for vCalendars in VPIM? I have an vCalendar input file started off with something like this: BEGIN:VCALENDAR METHOD:REQUEST PRODID:Microsoft CDO for Microsoft Exchange VERSION:2.0 BEGIN:VTIMEZONE TZID:(GMT-05.00) Eastern Time (US & Canada) X-MICROSOFT-CDO-TZID:10 BEGIN:STANDARD DTSTART:16010101T020000 TZOFFSETFROM:-0400 TZOFFSETTO:-0500 RRULE:FREQ=YEARLY;WKST=MO;INTERVAL=1;BYMONTH=11;BYDAY=1SU END:STANDARD BEGIN:DAYLIGHT DTSTART:16010101T020000 TZOFFSETFROM:-0500 TZOFFSETTO:-0400 RRULE:FREQ=YEARLY;WKST=MO;INTERVAL=1;BYMONTH=3;BYDAY=2SU END:DAYLIGHT END:VTIMEZONE BEGIN:VEVENT DTSTAMP:20080107T155404Z DTSTART;TZID="(GMT-05.00) Eastern Time (US & Canada)":20080107T123000 The event.dstart from the Vpim parsed vCalendar will have its Timezone be set to localtime. It ignores the TZID of the DSTART. Any hints on how to make this work so that ether the event.dstart has the right timezone or can be set to the valid UTC? As far as I can tell, both Vpim and the ruby iCalendar libraries have similar problems handling this. Thanks Rob ?????????????????????????????? Robert J. Berger - Internet Bandwidth Development, LLC. Voice: 408-838-8896 eFax: +1-408-490-2868 http://www.ibd.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/vpim-talk/attachments/20080108/4ccb6c2d/attachment-0001.html From sroberts at uniserve.com Mon Jan 14 23:40:32 2008 From: sroberts at uniserve.com (Sam Roberts) Date: Mon, 14 Jan 2008 20:40:32 -0800 Subject: [Vpim-talk] Any Timezone support coming? In-Reply-To: <3607E723-989D-4B48-B93A-F127021DB64D@ibd.com> References: <3607E723-989D-4B48-B93A-F127021DB64D@ibd.com> Message-ID: <20080115044032.GA1140@ensemble.local> Quoting rberger at ibd.com, on Tue, Jan 08, 2008 at 02:11:58AM -0800: > Just wondering if there might be someone who got timezone support of > some kind working for vCalendars in VPIM? No. When I started vPim there weren't even any libraries in ruby to deal with timezones. They exist now, but I've no need for TZ support, so unless someone steps up to the plate to do the work, it probably won't happen. > As far as I can tell, both Vpim and the ruby iCalendar libraries have > similar problems handling this. Not surprising, iCalendar is a fork of vPim. Sam From rberger at ibd.com Fri Jan 18 22:19:39 2008 From: rberger at ibd.com (Robert J. Berger) Date: Fri, 18 Jan 2008 19:19:39 -0800 Subject: [Vpim-talk] Any Timezone support coming? In-Reply-To: <20080115044032.GA1140@ensemble.local> References: <3607E723-989D-4B48-B93A-F127021DB64D@ibd.com> <20080115044032.GA1140@ensemble.local> Message-ID: Well, I got enough timezone stuff working for my application. I just needed to be able to parse iCalendar files that had a single event and a single timezone (at least so far :-) With the power of Ruby, I was able to create a ruby file that "monkey patches" the vpim library without touching any of the vpim library files and add the functionality I needed. (the file is attached) But I'm sure I didn't do it the best way and there are probably some horrible hacks inside. If people come up with better ways or suggestions for improvement, let me know. The main functionality implemented is the ability to take DTSTART and DTEND times that are in some local time and convert it to UTC. It adds Vtimezone to be a component like, Vevent, Vtodo and Vjournal. It makes StandardTimeRules and DaylightSavingsTimeRules as components of Vtimezone. You can use the to_utz(date-time) method of Vtimezone to get the utc time of a dtstart or dtend (theoretically any object with proptime property). # Example Usage: require 'vpim' require '/vtimezone' icsfile = File.open("some_ical_file.ics").readlines cal = Vpim::Icalendar.decode(icsfile).first timezone = cal.components(Vpim::Icalendar::Vtimezone).first dtstart = cal.components(Vpim::Icalendar::Vevent).first.dtstart dtstart_utc = timezone.to_utc(dtstart) It assumes that a calendar only has one event and one timezone. It doesn't actually use the TZID property of a the date-time object. It just assumes the one timezone matches the timezone of all non-utc date- times. It probably wouldn't be toooo hard to actually support multiple events, and timezones, but I don't need it and don't have the time right now. The Vpim library was quite pleasant to hack. My thanks to Sam Roberts for making it available and doing such a nice job. Also thanks to David Frankel of Telethought / ZipDX (http://www.zipdx.com) whose project this was done for. Its great to be working on a project with Ruby! I would encourage anyone who is up to it, to take this and the library and make this work all the way! -------------- next part -------------- A non-text attachment was scrubbed... Name: vtimezone.rb Type: text/x-ruby-script Size: 10062 bytes Desc: not available Url : http://rubyforge.org/pipermail/vpim-talk/attachments/20080118/6c855a03/attachment.bin -------------- next part -------------- ?????????????????????????????? Robert J. Berger - Internet Bandwidth Development, LLC. Voice: 408-838-8896 eFax: +1-408-490-2868 http://www.ibd.com From rberger at ibd.com Fri Jan 18 22:45:08 2008 From: rberger at ibd.com (Robert J. Berger) Date: Fri, 18 Jan 2008 19:45:08 -0800 Subject: [Vpim-talk] Recurring BYWEEKNO Message-ID: So has anyone had any success implementing recurring BYWEEKNO? ?????????????????????????????? Robert J. Berger - Internet Bandwidth Development, LLC. Voice: 408-838-8896 eFax: +1-408-490-2868 http://www.ibd.com From sroberts at uniserve.com Sat Jan 19 20:00:35 2008 From: sroberts at uniserve.com (Sam Roberts) Date: Sat, 19 Jan 2008 17:00:35 -0800 Subject: [Vpim-talk] Any Timezone support coming? In-Reply-To: References: <3607E723-989D-4B48-B93A-F127021DB64D@ibd.com> <20080115044032.GA1140@ensemble.local> Message-ID: <20080120010035.GA636@ensemble.local> Quoting rberger at ibd.com, on Fri, Jan 18, 2008 at 07:19:39PM -0800: > With the power of Ruby, I was able to create a ruby file that "monkey > patches" the vpim library without touching any of the vpim library > files and add the functionality I needed. (the file is attached) > But I'm sure I didn't do it the best way and there are probably some > horrible hacks inside. If people come up with better ways or > suggestions for improvement, let me know. Can you refactor this as a patch so it can be cleanly integrated? Preferably with some unit tests :-) If commit access would help, tell me your rubyforge username. Cheers, Sam From gsslist+vpim at anthropohedron.net Sun Mar 2 21:21:21 2008 From: gsslist+vpim at anthropohedron.net (Gregory Seidman) Date: Sun, 2 Mar 2008 21:21:21 -0500 Subject: [Vpim-talk] Leap day bug Message-ID: <20080303022119.GA8786@anthropohedron.net> I just ran into this loading (with the latest vpim gem, 0.597) the calendar from http://homepage.mac.com/ical/.calendars/US32Holidays.ics (a standard US holidays calendar provided by Apple). The following script shows the problem I'm having: #!/usr/bin/env ruby require 'rubygems' require 'vpim' Event = Vpim::Icalendar::Vevent leap = Event.create_yearly(Time.mktime(2004, 2, 29), 'Leap day') leap.occurences.each(Time.mktime(2009, 3, 4)) { |time| puts time.to_s } Not only is it showing up for years that aren't leap years, it gets pushed to March 1 on the first non-leap year and stays there even on leap years. Incidentally, why isn't the tracker active for the vpim project? I would have submitted this as a bug otherwise. --Greg From ray.baxter at mindspring.com Mon Mar 3 02:09:12 2008 From: ray.baxter at mindspring.com (Ray Baxter) Date: Sun, 02 Mar 2008 23:09:12 -0800 Subject: [Vpim-talk] Leap day bug In-Reply-To: <20080303022119.GA8786@anthropohedron.net> References: <20080303022119.GA8786@anthropohedron.net> Message-ID: <47CBA418.2050009@mindspring.com> Gregory Seidman wrote: > I just ran into this loading (with the latest vpim gem, 0.597) the calendar > from http://homepage.mac.com/ical/.calendars/US32Holidays.ics (a standard > US holidays calendar provided by Apple). I don't see leap day in that ics file in the file I just retrieved, dated Nov 3, 2006. I don't think that Leap day is a standard US holiday. > The following script shows the > problem I'm having: > > #!/usr/bin/env ruby > > require 'rubygems' > require 'vpim' > > Event = Vpim::Icalendar::Vevent > > leap = Event.create_yearly(Time.mktime(2004, 2, 29), 'Leap day') > > leap.occurences.each(Time.mktime(2009, 3, 4)) { |time| > puts time.to_s > } > > Not only is it showing up for years that aren't leap years, it gets pushed > to March 1 on the first non-leap year and stays there even on leap years. > You are creating a yearly event. According to the rdoc, create_yearly "creates a yearly repeating event, such as for a birthday." If your birthday was leap day, there might be various awkwardnesses, but you would get a year older every year. I believe that most business rules for handling leap day treat leap day as March 1st. For instance, if you opened a yearly subscription on leap day this year, it will renew on March 1 next year. Your subscription would continue to renew on March 1, even in leap years. I think that if you are going to create a Leap Day holiday, you are going to have to do it with recurrence rules, but I'm not sure why you would be doing that, so perhaps I don't understand your situation. Which brings me back to the ics file from Apple. -- Ray From sroberts at uniserve.com Mon Mar 3 01:56:44 2008 From: sroberts at uniserve.com (Sam Roberts) Date: Sun, 2 Mar 2008 22:56:44 -0800 Subject: [Vpim-talk] Leap day bug In-Reply-To: <20080303022119.GA8786@anthropohedron.net> References: <20080303022119.GA8786@anthropohedron.net> Message-ID: <20080303065630.GA871@ensemble.gateway.2wire.net> Quoting gsslist+vpim at anthropohedron.net, on Sun, Mar 02, 2008 at 09:21:21PM -0500: > leap = Event.create_yearly(Time.mktime(2004, 2, 29), 'Leap day') > > leap.occurences.each(Time.mktime(2009, 3, 4)) { |time| > puts time.to_s > } > > Not only is it showing up for years that aren't leap years, it gets pushed > to March 1 on the first non-leap year and stays there even on leap years. Sorry about that. vPim uses ruby's Date class. Add a year to 2004-02-29, and you get: irb(main):011:0> Time.mktime(2005, 2, 29) => Tue Mar 01 00:00:00 -0800 2005 Here's another example from my notes: " - bug: deal with "round down" that Date does when you add a month, and the dofmonth is not " in valid range -> if you have jan31 repeating monthly with iCal, you shouldn't get an " occurence in Feb " " ensemble:~/p/ruby/vpim % ./rrule.rb --start '20050131T000000Z' 'FREQ=MONTHLY' | head " Start: Mon Jan 31 00:00:00 EST 2005 " Rrule: FREQ=MONTHLY " count= 0 Mon Jan 31 00:00:00 EST 2005 " count= 1 Mon Feb 28 00:00:00 EST 2005 " count= 2 Mon Mar 28 00:00:00 EST 2005 " count= 3 Thu Apr 28 00:00:00 EDT 2005 " count= 4 Sat May 28 00:00:00 EDT 2005 " count= 5 Tue Jun 28 00:00:00 EDT 2005 " count= 6 Thu Jul 28 00:00:00 EDT 2005 " count= 7 Sun Aug 28 00:00:00 EDT 2005 " " I need to keep my own date/time, and not use Time as the basic object in my iteration. " " Then, I can eliminate non-existent times before yielding them. I'll see what this involves, maybe I can correct for some of Date's problems without reimplementing it, which I don't have the time for, though I might have to do it for timezone support. > Incidentally, why isn't the tracker active for the vpim project? I would > have submitted this as a bug otherwise. Would you have preferred to submit with a tracker? I could turn it on, I just thought people would rather email me if they had a comment, or subscribe to the list. My direct email address is part of the docs. Cheers, Sam From gsslist+vpim at anthropohedron.net Mon Mar 3 09:59:03 2008 From: gsslist+vpim at anthropohedron.net (Gregory Seidman) Date: Mon, 3 Mar 2008 09:59:03 -0500 Subject: [Vpim-talk] Leap day bug In-Reply-To: <47CBA418.2050009@mindspring.com> References: <20080303022119.GA8786@anthropohedron.net> <47CBA418.2050009@mindspring.com> Message-ID: <20080303145903.GB14920@anthropohedron.net> On Sun, Mar 02, 2008 at 11:09:12PM -0800, Ray Baxter wrote: > Gregory Seidman wrote: > > I just ran into this loading (with the latest vpim gem, 0.597) the calendar > > from http://homepage.mac.com/ical/.calendars/US32Holidays.ics (a standard > > US holidays calendar provided by Apple). > > I don't see leap day in that ics file in the file I just retrieved, > dated Nov 3, 2006. I don't think that Leap day is a standard US holiday. [...] Whoops! You are correct. I thought it was in that file and it turned out to be in one of my own. It is a yearly recurring event on Feb. 29, and it is correctly displayed in at least two other calendaring programs (Apple's ical and Mozilla Sunbird/Lightning). > > Not only is it showing up for years that aren't leap years, it gets pushed > > to March 1 on the first non-leap year and stays there even on leap years. > > You are creating a yearly event. According to the rdoc, create_yearly > "creates a yearly repeating event, such as for a birthday." If your > birthday was leap day, there might be various awkwardnesses, but you > would get a year older every year. I believe that most business rules > for handling leap day treat leap day as March 1st. For instance, if you > opened a yearly subscription on leap day this year, it will renew on > March 1 next year. Your subscription would continue to renew on March 1, > even in leap years. > > I think that if you are going to create a Leap Day holiday, you are > going to have to do it with recurrence rules, but I'm not sure why you > would be doing that, so perhaps I don't understand your situation. Which > brings me back to the ics file from Apple. You are talking about business needs, which has nothing to do with what one means by "every February 29". Suppose you plan a party for every leap day, and want to be reminded a week ahead of time. You only want to be reminded on years when leap day occurs. No one needs to be reminded to be a year older. > Ray --Greg From gsslist+vpim at anthropohedron.net Mon Mar 3 10:06:04 2008 From: gsslist+vpim at anthropohedron.net (Gregory Seidman) Date: Mon, 3 Mar 2008 10:06:04 -0500 Subject: [Vpim-talk] Leap day bug In-Reply-To: <20080303065630.GA871@ensemble.gateway.2wire.net> References: <20080303022119.GA8786@anthropohedron.net> <20080303065630.GA871@ensemble.gateway.2wire.net> Message-ID: <20080303150604.GC14920@anthropohedron.net> On Sun, Mar 02, 2008 at 10:56:44PM -0800, Sam Roberts wrote: > Quoting gsslist+vpim at anthropohedron.net, on Sun, Mar 02, 2008 at 09:21:21PM -0500: > > leap = Event.create_yearly(Time.mktime(2004, 2, 29), 'Leap day') > > > > leap.occurences.each(Time.mktime(2009, 3, 4)) { |time| > > puts time.to_s > > } > > > > Not only is it showing up for years that aren't leap years, it gets > > pushed to March 1 on the first non-leap year and stays there even on > > leap years. > > Sorry about that. vPim uses ruby's Date class. Add a year to 2004-02-29, > and you get: > > irb(main):011:0> Time.mktime(2005, 2, 29) > => Tue Mar 01 00:00:00 -0800 2005 > > Here's another example from my notes: > > " - bug: deal with "round down" that Date does when you add a month, and the dofmonth is not > " in valid range -> if you have jan31 repeating monthly with iCal, you shouldn't get an > " occurence in Feb [...] > " I need to keep my own date/time, and not use Time as the basic object in my iteration. > " > " Then, I can eliminate non-existent times before yielding them. > > I'll see what this involves, maybe I can correct for some of Date's > problems without reimplementing it, which I don't have the time for, > though I might have to do it for timezone support. I think you should be able to do it with a quick check on mday. If calculated_time.mday != original_time.mday then skip it and move on. You'll need to keep a separate iteration variable from the time itself, so instead of adding a month or a year to a Time you are adding i*(month or year) to the dtstart. I haven't dug into the code to see if it's an easy fix. If I'd noticed the issue earlier in the weekend, I would have had time. Alas... BTW, this is coming up in the context of my (new this weekend, but already up and working) CalTerm project (find it on rubyforge). > > Incidentally, why isn't the tracker active for the vpim project? I would > > have submitted this as a bug otherwise. > > Would you have preferred to submit with a tracker? I could turn it on, I > just thought people would rather email me if they had a comment, or > subscribe to the list. My direct email address is part of the docs. I like submitting to a tracker in large part because I can check if it's come up before and, if so, simply comment on the previous bug. If it hasn't come up before, I can submit it. Either way, any discussion on it (and patches, if any) stay associated with the issue. > Cheers, > Sam --Greg From sroberts at uniserve.com Mon Mar 3 13:24:40 2008 From: sroberts at uniserve.com (Sam Roberts) Date: Mon, 3 Mar 2008 10:24:40 -0800 Subject: [Vpim-talk] Fwd: Leap day bug In-Reply-To: <17eac67c0803031023s24a2bd3fp6f90ca746199eb58@mail.gmail.com> References: <20080303022119.GA8786@anthropohedron.net> <47CBA418.2050009@mindspring.com> <17eac67c0803031023s24a2bd3fp6f90ca746199eb58@mail.gmail.com> Message-ID: <17eac67c0803031024y5074b34bub122d06b38cb1793@mail.gmail.com> ---------- Forwarded message ---------- From: Sam Roberts Date: Mon, Mar 3, 2008 at 10:23 AM Subject: Re: [Vpim-talk] Leap day bug To: Ray Baxter On Sun, Mar 2, 2008 at 11:09 PM, Ray Baxter wrote: > > Not only is it showing up for years that aren't leap years, it gets pushed > > to March 1 on the first non-leap year and stays there even on leap years. > > > > You are creating a yearly event. According to the rdoc, create_yearly > "creates a yearly repeating event, such as for a birthday." If your > birthday was leap day, there might be various awkwardnesses, but you > would get a year older every year. I believe that most business rules > for handling leap day treat leap day as March 1st. For instance, if you > opened a yearly subscription on leap day this year, it will renew on > March 1 next year. Your subscription would continue to renew on March 1, > even in leap years. That explains why ruby's Date class behaviour isn't considered a bug. Unfortunately for vPim, the RFC is clear on this. A monthly event occurring on the 31 should occur only on those months that have a 31. If someone wanted the last day of each month -1 can be used for the day. Sam From gsslist+vpim at anthropohedron.net Mon Mar 3 13:41:33 2008 From: gsslist+vpim at anthropohedron.net (Gregory Seidman) Date: Mon, 3 Mar 2008 13:41:33 -0500 Subject: [Vpim-talk] Leap day bug In-Reply-To: <17eac67c0803031032v70c6a37cof8ce8183b14164a6@mail.gmail.com> References: <20080303022119.GA8786@anthropohedron.net> <20080303065630.GA871@ensemble.gateway.2wire.net> <20080303150604.GC14920@anthropohedron.net> <17eac67c0803031032v70c6a37cof8ce8183b14164a6@mail.gmail.com> Message-ID: <20080303184131.GA25147@anthropohedron.net> On Mon, Mar 03, 2008 at 10:32:46AM -0800, Sam Roberts wrote: > On Mon, Mar 3, 2008 at 7:06 AM, Gregory Seidman > wrote: > > I think you should be able to do it with a quick check on mday. If > > calculated_time.mday != original_time.mday then skip it and move on. > > You'll need to keep a separate iteration variable from the time > > itself, so instead of adding a month or a year to a Time you are > > adding i*(month or year) to the dtstart. > > There are other areas this shows up, it might not be so simple, or > perhaps it will. Do you know offhand where it comes up other than occurences iteration? On a separate note, occurences should be occurrences (i.e. it's misspelled). Changing it would be bad for backward compatibility, but maybe an alias? > > BTW, this is coming up in the context of my (new this weekend, but > > already up and working) CalTerm project (find it on rubyforge). > > Looks fun. I'd like to have CalDAV support in vPim, so if you do some > work on that consider contributing it to the project. Even if its > simple support, its better than nothing. Also, gcalendar integration > might be nice to have outside of the context of CalTerm, so feel free > to contribute that, too! I don't know when I'll get to it (I had a miraculously free weekend which is how I hammered out what I have so far), but I expect it will make more sense to work that stuff into vpim than outside of it anyway. I'll definitely contribute my work. When I start implementing writing it will be first to the filesystem, then via WebDAV, and then I'll start looking into CalDAV and (maybe) GData. All my calendars are currently hosted on one WebDAV server or another, so I don't have much of an itch to scratch for either GData or CalDAV right now. > Thanks, > Sam --Greg From jonas.gauffin at gmail.com Tue Mar 11 05:38:27 2008 From: jonas.gauffin at gmail.com (Jonas Gauffin) Date: Tue, 11 Mar 2008 10:38:27 +0100 Subject: [Vpim-talk] Empty phone numbers Message-ID: Hello Thanks for a great gem. Can you add support for empty phone numbers? Regards, Jonas From sroberts at uniserve.com Thu Mar 13 02:06:32 2008 From: sroberts at uniserve.com (Sam Roberts) Date: Wed, 12 Mar 2008 23:06:32 -0700 Subject: [Vpim-talk] Empty phone numbers In-Reply-To: References: Message-ID: <17eac67c0803122306h518f4fa8q266e0b75f31dc84d@mail.gmail.com> On Tue, Mar 11, 2008 at 2:38 AM, Jonas Gauffin wrote: > Can you add support for empty phone numbers? What are you trying to do? Do you have some sample code? Or can you tell me what APIs, and how you want them to behave? Cheers, Sam From vieuxtech at gmail.com Thu Mar 13 17:05:24 2008 From: vieuxtech at gmail.com (Sam Roberts) Date: Thu, 13 Mar 2008 14:05:24 -0700 Subject: [Vpim-talk] Empty phone numbers In-Reply-To: References: <17eac67c0803122306h518f4fa8q266e0b75f31dc84d@mail.gmail.com> Message-ID: <17eac67c0803131405o92485d4kc3b4512d1fe31b70@mail.gmail.com> On Thu, Mar 13, 2008 at 2:12 AM, Jonas Gauffin wrote: > I used a online vcard generator, and it generates empty fields like > the one below. > > "TEL;HOME;FAX: " > > this makes vpim to throw an exception and abort. I wish that it > ignored the field and continued (or added it as an empty field). I understand. That's a bug, I'll fix it. Thanks, Sam From vieuxtech at gmail.com Fri Mar 14 02:33:15 2008 From: vieuxtech at gmail.com (Sam Roberts) Date: Thu, 13 Mar 2008 23:33:15 -0700 Subject: [Vpim-talk] test of sending attachments Message-ID: <20080314063315.GA798@ensemble.gateway.2wire.net> A test to ensure attachments make it onto the list. Sam -------------- next part -------------- A non-text attachment was scrubbed... Name: card.zip Type: application/x-zip-compressed Size: 308 bytes Desc: not available Url : http://rubyforge.org/pipermail/vpim-talk/attachments/20080313/77792236/attachment.bin From vieuxtech at gmail.com Fri Mar 14 02:38:21 2008 From: vieuxtech at gmail.com (Sam Roberts) Date: Thu, 13 Mar 2008 23:38:21 -0700 Subject: [Vpim-talk] Empty phone numbers In-Reply-To: References: <17eac67c0803122306h518f4fa8q266e0b75f31dc84d@mail.gmail.com> Message-ID: <20080314063821.GA809@ensemble.gateway.2wire.net> Quoting jonas.gauffin at gmail.com, on Thu, Mar 13, 2008 at 10:12:18AM +0100: > I used a online vcard generator, and it generates empty fields like > the one below. > > "TEL;HOME;FAX: " > > this makes vpim to throw an exception and abort. I wish that it > ignored the field and continued (or added it as an empty field). Fixed in latest release. Cheers, Sam From jonas.gauffin at gmail.com Fri Mar 14 04:21:14 2008 From: jonas.gauffin at gmail.com (Jonas Gauffin) Date: Fri, 14 Mar 2008 09:21:14 +0100 Subject: [Vpim-talk] Empty phone numbers In-Reply-To: <20080314063821.GA809@ensemble.gateway.2wire.net> References: <17eac67c0803122306h518f4fa8q266e0b75f31dc84d@mail.gmail.com> <20080314063821.GA809@ensemble.gateway.2wire.net> Message-ID: Excellent, thank you. On Fri, Mar 14, 2008 at 7:38 AM, Sam Roberts wrote: > Quoting jonas.gauffin at gmail.com, on Thu, Mar 13, 2008 at 10:12:18AM +0100: > > I used a online vcard generator, and it generates empty fields like > > the one below. > > > > "TEL;HOME;FAX: " > > > > this makes vpim to throw an exception and abort. I wish that it > > ignored the field and continued (or added it as an empty field). > > Fixed in latest release. > > Cheers, > Sam > > From vieuxtech at gmail.com Mon Mar 17 13:57:51 2008 From: vieuxtech at gmail.com (Sam Roberts) Date: Mon, 17 Mar 2008 10:57:51 -0700 Subject: [Vpim-talk] Empty phone numbers In-Reply-To: <20080317093842.xas35rw1vjcwoo0s@webmail.srishtisoft.com> References: <17eac67c0803122306h518f4fa8q266e0b75f31dc84d@mail.gmail.com> <20080314063821.GA809@ensemble.gateway.2wire.net> <20080317093842.xas35rw1vjcwoo0s@webmail.srishtisoft.com> Message-ID: <17eac67c0803171057w431c72d2u177500e03d35dde9@mail.gmail.com> On Sun, Mar 16, 2008 at 9:08 PM, wrote: > > Hi All, > > I am able to generate vcard.Also I am adding mobile number in to that. > > But when I try to open that vcard in outlook or thunderbird, all fields are > coming except mobile number... Any thing need to do while adding mobile number > in to vcard??? > > Please help me... Please send the code you use to generate your vcard, and the vcard you generated that doesn't work. Cheers, Sam From vieuxtech at gmail.com Fri Mar 21 20:24:02 2008 From: vieuxtech at gmail.com (Sam Roberts) Date: Fri, 21 Mar 2008 17:24:02 -0700 Subject: [Vpim-talk] Fwd: [ vpim-Feature Requests-18920 ] Parse Recurrence Rules in TODOs In-Reply-To: <20080322000207.52B5C18586B7@rubyforge.org> References: <20080322000207.52B5C18586B7@rubyforge.org> Message-ID: <17eac67c0803211724l5b1db4b2w783b215b9e840a46@mail.gmail.com> There's no contact info for the author of this feature request... are you on this list? Cheers, Sam Feature Requests item #18920, was opened at 2008-03-18 12:25 You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=910&aid=18920&group_id=218 Category: None Group: None Status: Open Priority: 3 Submitted By: Nobody (None) Assigned to: Nobody (None) Summary: Parse Recurrence Rules in TODOs Initial Comment: Recurrence rules don't seem to parse on TODOs ---------------------------------------------------------------------- >Comment By: Sam Roberts (sam) Date: 2008-03-21 17:17 Message: Please attach an example. I don't know what you're seeing, but it seems to work OK. Here's a unit test: # Tracker #18920 def test_recurring_todos icstodo =<<___ BEGIN:VCALENDAR VERSION:2.0 BEGIN:VTODO SUMMARY:todo DTSTART:20040415T120000 RRULE:FREQ=WEEKLY;COUNT=2 END:VTODO END:VCALENDAR ___ cal = Icalendar.decode(icstodo).first todo = cal.todos.first assert(todo) assert_equal(todo.occurences.to_a.size, 2) end From vpim-talk at maxwerner.de Wed Apr 23 07:47:51 2008 From: vpim-talk at maxwerner.de (Max Jonas Werner) Date: Wed, 23 Apr 2008 13:47:51 +0200 Subject: [Vpim-talk] Attachment for Patch #19685 Message-ID: Hi, it seems I forgot to attach my patch file for the reported patch. So I've attached it here. Sam, what do you say? Cheers! Max -------------- next part -------------- A non-text attachment was scrubbed... Name: vpim-patch-fix-rrule-time-creation.patch Type: text/x-diff Size: 657 bytes Desc: not available Url : http://rubyforge.org/pipermail/vpim-talk/attachments/20080423/c3544cd2/attachment.bin From ricsrock at gmail.com Thu Apr 24 12:33:57 2008 From: ricsrock at gmail.com (ricsrock) Date: Thu, 24 Apr 2008 11:33:57 -0500 Subject: [Vpim-talk] #to_time conflict with rails Message-ID: Hello, I'm using vpim with rails. Getting the following error: date is before the start of system time Part of the stack... /usr/local/lib/ruby/gems/1.8/gems/vpim-0.619/lib/vpim/date.rb: 20:in `to_time' /home/lkenyan/railsapp/app/models/person.rb:72:in `age' The #age method in my 'person' model calls #to_time (the rails one). Vpim also extends Date with a #to_time method of it's own. Train wreck. Is there a fix or workaround for this? Thanks, ricsrock From vieuxtech at gmail.com Thu Apr 24 16:47:38 2008 From: vieuxtech at gmail.com (Sam Roberts) Date: Thu, 24 Apr 2008 13:47:38 -0700 Subject: [Vpim-talk] #to_time conflict with rails In-Reply-To: References: Message-ID: <17eac67c0804241347j1c2b7fcfi146c1523f066a418@mail.gmail.com> On Thu, Apr 24, 2008 at 9:33 AM, ricsrock wrote: > Hello, > I'm using vpim with rails. Getting the following error: > > date is before the start of system time > > Part of the stack... > /usr/local/lib/ruby/gems/1.8/gems/vpim-0.619/lib/vpim/date.rb: > 20:in `to_time' > /home/lkenyan/railsapp/app/models/person.rb:72:in `age' > > The #age method in my 'person' model calls #to_time (the rails one). > > Vpim also extends Date with a #to_time method of it's own. Train wreck. > > Is there a fix or workaround for this? Besides not using rails? :-) Try renaming to_time to vpim_to_time, and sending me a patch that passes the unit tests (i.e., change where it's called, too, its probably only a few places, maybe only one place). Check the code out from cvs, its the best way to get diffs. Remember to use "cvs diff -u". Cheers, Sam From vieuxtech at gmail.com Fri Apr 25 02:56:46 2008 From: vieuxtech at gmail.com (Sam Roberts) Date: Thu, 24 Apr 2008 23:56:46 -0700 Subject: [Vpim-talk] Attachment for Patch #19685 In-Reply-To: References: Message-ID: <17eac67c0804242356t213b78f4y981f7cba679c0e90@mail.gmail.com> On Wed, Apr 23, 2008 at 4:47 AM, Max Jonas Werner wrote: > Hi, > > it seems I forgot to attach my patch file for the reported patch. So I've > attached it here. > > Sam, what do you say? What is it intended to solve? It seems it changes the meaning of DTSTART. A meeting starting at 9AM in toronto, daily, 5 times shouldn't turn into a meeting at 6AM daily, which would happen if I called start.getlocal on the west coast. Can you explain what you are trying to do? Maybe provide some sample data/unit tests, something? Cheers, Sam From vpim-talk at maxwerner.de Sun Apr 27 12:48:08 2008 From: vpim-talk at maxwerner.de (Max Jonas Werner) Date: Sun, 27 Apr 2008 18:48:08 +0200 Subject: [Vpim-talk] Attachment for Patch #19685 In-Reply-To: <17eac67c0804242356t213b78f4y981f7cba679c0e90@mail.gmail.com> References: <17eac67c0804242356t213b78f4y981f7cba679c0e90@mail.gmail.com> Message-ID: <200804271848.08714.vpim-talk@maxwerner.de> Hi Sam, On Friday 25 April 2008 08:56:46 Sam Roberts wrote: > On Wed, Apr 23, 2008 at 4:47 AM, Max Jonas Werner > wrote: > > Hi, > > > > it seems I forgot to attach my patch file for the reported patch. So I've > > attached it here. > > > > Sam, what do you say? > > What is it intended to solve? > > It seems it changes the meaning of DTSTART. A meeting starting at 9AM > in toronto, daily, 5 times shouldn't turn into a meeting at 6AM daily, > which would happen if I called start.getlocal on the west coast. > > Can you explain what you are trying to do? Maybe provide some sample > data/unit tests, something? I've tried to explaing what the patch does in the patch description: http://rubyforge.org/tracker/index.php?func=detail&aid=19685&group_id=218&atid=909 The problem is that if you don't set dtstart to start.getlocal, you have a date in whatever time zone it is saved in in the iCalendar file. But line 271 creates a Time object in local time from the values in dtstart (implicitly) disregarding the actual time zone from the original DTSTART value from the iCalendar file. Max From vieuxtech at gmail.com Tue Apr 29 00:52:50 2008 From: vieuxtech at gmail.com (Sam Roberts) Date: Mon, 28 Apr 2008 21:52:50 -0700 Subject: [Vpim-talk] Attachment for Patch #19685 In-Reply-To: <200804271848.08714.vpim-talk@maxwerner.de> References: <17eac67c0804242356t213b78f4y981f7cba679c0e90@mail.gmail.com> <200804271848.08714.vpim-talk@maxwerner.de> Message-ID: <17eac67c0804282152n7acb30aex78a5f43e0c7dcb99@mail.gmail.com> On Sun, Apr 27, 2008 at 9:48 AM, Max Jonas Werner wrote: > Hi Sam, > On Friday 25 April 2008 08:56:46 Sam Roberts wrote: > > Can you explain what you are trying to do? Maybe provide some sample > > data/unit tests, something? > > I've tried to explaing what the patch does in the patch description: > http://rubyforge.org/tracker/index.php?func=detail&aid=19685&group_id=218&atid=909 Sorry, I didn't notice the example VEVENT you posted. > The problem is that if you don't set dtstart to start.getlocal, you have a > date in whatever time zone it is saved in in the iCalendar file. But line 271 > creates a Time object in local time from the values in dtstart (implicitly) > disregarding the actual time zone from the original DTSTART value from the > iCalendar file. vPim doesn't support timezones, but I guess this patch doesn't break anything worse than it was. The times yielded should be 9:30 AM UTC, with this patch they are yielded in local time, but at least it is the local time equivalent of the the UTC time. Notice that with this hack, any recurrence rule clauses that modify hours, like BYHOUR=9,3 (say the meeting happens twice a day) will be completely broken. Luckily (?), vPim doesn't support BYHOUR. The right thing is to recognize the timezone of the DTSTART, do date arithmetic in its timezone, and yield times in that timezone, but that will wait until I need it, or somebody else needs it enough to get it implemented. Anyhow, thanks for the patch and testcase, Max, I'll apply it. Cheers, Sam From jb at joergbattermann.com Mon May 5 12:48:49 2008 From: jb at joergbattermann.com (=?ISO-8859-1?Q?J=F6rg_Battermann?=) Date: Mon, 5 May 2008 18:48:49 +0200 Subject: [Vpim-talk] Invalid ics file for Apple iCal? Message-ID: Hello there, I am using (or try to do so) vpim in a rails app to create ics files based upon my own "event"-model and the code below works fine, creates something that looks fine to me, but Apple's iCal is complaining that it is not valid. Using Mozilla Sunbird to import that file works perfectly fine, but I am wondering what I am missing here. The Code block is the following (show.ics.erb - :ics being registered properly in the mime_types.rb file under config/initializers): <% require 'vpim/icalendar' cal = Vpim::Icalendar.create2 cal.add_event do |e| e.dtstart @event.starttime e.dtend @event.endtime != nil ? @event.endtime : @event.starttime + 15.minutes e.summary @event.title e.description !@event.description.blank? ? @event.description : "" e.categories [ 'PROJECTS' ] e.url !@event.url.blank? ? @event.url : "" e.sequence 0 e.access_class "PRIVATE" e.transparency 'OPAQUE' e.created @event.created_at e.lastmod @event.updated_at e.organizer do |o| o.cn = @user.full_name o.uri = "mailto:#{@user.email}" end attendee = Vpim::Icalendar::Address.create("mailto:#{@user.email}") attendee.rsvp = true e.add_attendee attendee end icsfile = cal.encode %> <%= icsfile %> ... an exemplary output file would be: BEGIN:VCALENDAR VERSION:2.0 PRODID:-//Ensemble Independent//vPim 0.619//EN CALSCALE:Gregorian BEGIN:VEVENT DTSTART:20080505T183000 DTEND:20080505T223000 SUMMARY:test!? DESCRIPTION: CATEGORIES:PROJECTS URL:http://blogwi.se SEQUENCE:0 CLASS:PRIVATE CREATED:20080505T163212 LAST-MODIFIED:20080505T163214 ORGANIZER;CN=Joerg Battermann:mailto:jb at joergbattermann.com ATTENDEE;RSVP=true:mailto:jb at joergbattermann.com END:VEVENT END:VCALENDAR .... hrm. Now what's wrong here? Anything obvious? Can't really find anything :-( Best Regards / Mit freundlichen Gruessen, Joerg Battermann -- Freelancer, Entrepreneur, Open Source Advocate E-Mail: jb at joergbattermann.com Cell: +49 179 7861273 Skype: joerg.battermann Web: http://joergbattermann.com ----------------------------------------------------------- Xing Profile: https://www.xing.com/profile/Joerg_Battermann -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 2427 bytes Desc: not available URL: From vieuxtech at gmail.com Tue May 6 00:30:22 2008 From: vieuxtech at gmail.com (Sam Roberts) Date: Mon, 5 May 2008 21:30:22 -0700 Subject: [Vpim-talk] Invalid ics file for Apple iCal? In-Reply-To: References: Message-ID: <17eac67c0805052130k6bb6273cl99cf7162e588543@mail.gmail.com> On Mon, May 5, 2008 at 9:48 AM, J?rg Battermann wrote: > Hello there, > > I am using (or try to do so) vpim in a rails app to create ics files based > upon my own "event"-model and the code below works fine, creates something > that looks fine to me, but Apple's iCal is complaining that it is not valid. > Using Mozilla Sunbird to import that file works perfectly fine, but I am > wondering what I am missing here. Not having ever used Rails, I can't actually run your sample code, but I appreciate reading it! Knowing how people use vPim gives me ideas for how to improve it, and some of what you had to do seems uncessarily painful. Anyhow, as for your specific problem, I took your calendar example, saved it in a file, and opened it in "Apple iCal 3.0.2 (1236)". It worked fine, I think Can you try doing that? In what way didn't it work? If it just refused to parse, maybe Console.app will show some error messages logged by iCal. If opening from a file works, maybe its the MIME type you've associated with the data when it gets served using HTTP? Not sure how you make the mapping, but it should be "text/calendar". Thanks, Sam From jb at joergbattermann.com Tue May 6 11:17:45 2008 From: jb at joergbattermann.com (=?ISO-8859-1?Q?J=F6rg_Battermann?=) Date: Tue, 6 May 2008 17:17:45 +0200 Subject: [Vpim-talk] Invalid ics file for Apple iCal? In-Reply-To: <17eac67c0805052130k6bb6273cl99cf7162e588543@mail.gmail.com> References: <17eac67c0805052130k6bb6273cl99cf7162e588543@mail.gmail.com> Message-ID: <096692B2-2F3F-4827-A332-461EA4E9C5A1@joergbattermann.com> Sam, oh boy - the 'problem' was, that the final file had a blank line at the very top. Removing that line helped iCal recognize the content/ data properly and everything works just fine. Really didn't expect it to be so sensitive. But thanks for the quick reply! Best Regards / Mit freundlichen Gruessen, Joerg Battermann -- Freelancer, Entrepreneur, Open Source Advocate E-Mail: jb at joergbattermann.com Cell: +49 179 7861273 Skype: joerg.battermann Web: http://joergbattermann.com ----------------------------------------------------------- Xing Profile: https://www.xing.com/profile/Joerg_Battermann On May 6, 2008, at 6:30 AM, Sam Roberts wrote: > On Mon, May 5, 2008 at 9:48 AM, J?rg Battermann > wrote: >> Hello there, >> >> I am using (or try to do so) vpim in a rails app to create ics >> files based >> upon my own "event"-model and the code below works fine, creates >> something >> that looks fine to me, but Apple's iCal is complaining that it is >> not valid. >> Using Mozilla Sunbird to import that file works perfectly fine, but >> I am >> wondering what I am missing here. > > Not having ever used Rails, I can't actually run your sample code, but > I appreciate > reading it! Knowing how people use vPim gives me ideas for how to > improve it, and > some of what you had to do seems uncessarily painful. > > Anyhow, as for your specific problem, I took your calendar example, > saved it in > a file, and opened it in "Apple iCal 3.0.2 (1236)". It worked fine, > I think > > Can you try doing that? In what way didn't it work? If it just refused > to parse, maybe > Console.app will show some error messages logged by iCal. > > If opening from a file works, maybe its the MIME type you've > associated with the > data when it gets served using HTTP? Not sure how you make the > mapping, but it > should be "text/calendar". > > Thanks, > Sam > _______________________________________________ > Vpim-talk mailing list > Vpim-talk at rubyforge.org > http://rubyforge.org/mailman/listinfo/vpim-talk -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 2427 bytes Desc: not available URL: From vieuxtech at gmail.com Tue May 6 12:15:42 2008 From: vieuxtech at gmail.com (Sam Roberts) Date: Tue, 6 May 2008 09:15:42 -0700 Subject: [Vpim-talk] Invalid ics file for Apple iCal? In-Reply-To: <096692B2-2F3F-4827-A332-461EA4E9C5A1@joergbattermann.com> References: <17eac67c0805052130k6bb6273cl99cf7162e588543@mail.gmail.com> <096692B2-2F3F-4827-A332-461EA4E9C5A1@joergbattermann.com> Message-ID: <17eac67c0805060915l7dce00d7h39510e9699a4de20@mail.gmail.com> On Tue, May 6, 2008 at 8:17 AM, J?rg Battermann wrote: > oh boy - the 'problem' was, that the final file had a blank line at the very > top. Removing that line helped iCal recognize the content/data properly and > everything works just fine. Really didn't expect it to be so sensitive. Its just following the spec. randomly inserted whitespace is not allowed! Cheers, Sam From mattias at oncotype.dk Wed May 28 09:16:26 2008 From: mattias at oncotype.dk (Mattias Bodlund) Date: Wed, 28 May 2008 15:16:26 +0200 Subject: [Vpim-talk] Nordic chars in vcard Message-ID: <79562BDE-91BC-495C-977A-ED1FA3C5BE39@oncotype.dk> Hi I use vpim to generate v-cards and all is fine on OS X but on Win systems all my nordic chars look like there in the wrong charset. Can this be controlled from within vpim? cheers Mattias From vieuxtech at gmail.com Wed May 28 12:29:26 2008 From: vieuxtech at gmail.com (Sam Roberts) Date: Wed, 28 May 2008 09:29:26 -0700 Subject: [Vpim-talk] Nordic chars in vcard In-Reply-To: <79562BDE-91BC-495C-977A-ED1FA3C5BE39@oncotype.dk> References: <79562BDE-91BC-495C-977A-ED1FA3C5BE39@oncotype.dk> Message-ID: <17eac67c0805280929x4d289784mdbf6f655bc748d75@mail.gmail.com> On Wed, May 28, 2008 at 6:16 AM, Mattias Bodlund wrote: > Hi > > I use vpim to generate v-cards and all is fine on OS X but on Win systems > all my nordic chars look like there in the wrong charset. Can this be > controlled from within vpim? Generate a vCard using whatever software you are using (Outlook?) that has nordic characters and that you can reimport. Zip it up, and send it to me so I know what is needed. It should be possible. If you have a choice over vCard format, make sure to export vCard 3.0, not vCard 2.0. Cheers, Sam From vieuxtech at gmail.com Thu May 29 12:50:07 2008 From: vieuxtech at gmail.com (Sam Roberts) Date: Thu, 29 May 2008 09:50:07 -0700 Subject: [Vpim-talk] Nordic chars in vcard In-Reply-To: <1F999DD6-1B32-4AC5-B57A-EA6A38D8099D@oncotype.dk> References: <79562BDE-91BC-495C-977A-ED1FA3C5BE39@oncotype.dk> <17eac67c0805280929x4d289784mdbf6f655bc748d75@mail.gmail.com> <1F999DD6-1B32-4AC5-B57A-EA6A38D8099D@oncotype.dk> Message-ID: <17eac67c0805290950s6ed73326o977891e941091335@mail.gmail.com> On Thu, May 29, 2008 at 2:28 AM, Mattias Bodlund wrote: > Hi again > > I can see that the vcard I generate with vpim is utf-8 and the WIndows are > in iso-8859-1. Could that be the issue? Probably. vCard 2.1 is supposed to contain a charset parameter, that card doesn't, so its just using an abitrary character set. Not so standard. Could you try these things, and tell me which of them results in vCards that are importable: - convert vPim's output to ucs-2 (try with and without the BOM, to see if it makes a difference) - prepend a utf-8 BOM to vPim's output - convert vPim's output to iso-8859-1 Tell me what works, and I'll think about a way for vPim to make this easier. Just using latin-1 is obviously the lamest of all possible solutions. Sam From vieuxtech at gmail.com Mon Jun 2 12:46:02 2008 From: vieuxtech at gmail.com (Sam Roberts) Date: Mon, 2 Jun 2008 09:46:02 -0700 Subject: [Vpim-talk] Nordic chars in vcard In-Reply-To: <2B530192-EC1D-4A10-BD1E-10A5AF285969@oncotype.dk> References: <79562BDE-91BC-495C-977A-ED1FA3C5BE39@oncotype.dk> <17eac67c0805280929x4d289784mdbf6f655bc748d75@mail.gmail.com> <1F999DD6-1B32-4AC5-B57A-EA6A38D8099D@oncotype.dk> <17eac67c0805290950s6ed73326o977891e941091335@mail.gmail.com> <2B530192-EC1D-4A10-BD1E-10A5AF285969@oncotype.dk> Message-ID: <17eac67c0806020946k33539b42ped79e154f413f90d@mail.gmail.com> On Mon, Jun 2, 2008 at 1:53 AM, Mattias Bodlund wrote: > UCS-2 > Works fine both with and without BOM on OS X but shows nothing in XP - shows > as blank crads. > > UTF-8 with BOM > Stops working in both OS X and Win XP > > iso-8859-1 > All fields including nordic chars gets excluded in OS X - works fine in Win > XP. OK, so basically there is no solution that works for both addressbook implementations. Great. Perhaps the best that can be done is a comment in the documentation, then, or do you have any other suggestions? Sam From bbaase at openobjectives.com Wed Jun 11 07:10:25 2008 From: bbaase at openobjectives.com (Bernhard Baase) Date: Wed, 11 Jun 2008 13:10:25 +0200 Subject: [Vpim-talk] Vtodo Message-ID: <484FB2A1.30708@openobjectives.com> Hi, I'm new to Ruby and I tried and searched a lot how to use vpim to generate a vtodo. But as the encode method only works for the Icalendar class I didn't managed to render out a Vtodo. Can someone paste a simple example how to do this. Thanks Bernhard From vieuxtech at gmail.com Wed Jun 11 20:44:38 2008 From: vieuxtech at gmail.com (Sam Roberts) Date: Wed, 11 Jun 2008 17:44:38 -0700 Subject: [Vpim-talk] Vtodo In-Reply-To: <484FB2A1.30708@openobjectives.com> References: <484FB2A1.30708@openobjectives.com> Message-ID: <17eac67c0806111744ub44eb65k71694d8100020964@mail.gmail.com> On Wed, Jun 11, 2008 at 4:10 AM, Bernhard Baase wrote: > Hi, > > I'm new to Ruby and I tried and searched a lot how to use vpim to generate a > vtodo. But as the encode method only works for the Icalendar class I didn't > managed to render out a Vtodo. Can someone paste a simple example how to do > this. A TODO can exist only as a component in a calendar (but it can be the only component). Create a Vtodo object, add it to an Icalendar object (with #push). Then encode the Icalendar. Cheers, Sam From vieuxtech at gmail.com Sat Jun 14 17:33:27 2008 From: vieuxtech at gmail.com (Sam Roberts) Date: Sat, 14 Jun 2008 14:33:27 -0700 Subject: [Vpim-talk] Bug and patch for vpim-0.619 In-Reply-To: References: Message-ID: <17eac67c0806141433id1bbd35h24753c6a2070a05f@mail.gmail.com> On Sat, Jun 14, 2008 at 10:42 AM, Christopher J. Bottaro wrote: > I noticed two little bugs when using your vpim module in a Rails application. > > 1) The vpim module overwrites Rail's implementation of Date#to_time. > 2) The vpim module's implementation of Date#to_time causes > Date.today.to_time to return a Time that is a day in the past. > > I don't know how to fix issue 2, but I have attached a small patch > that makes vpim's Date#to_time use any existing implementation before > just defining it itself. > > Please let me know if the patch is accepted. Vpim's Date#to_time may break rails', but the opposite is also true. With your patch Rails will work, but Vpim will be broken. If you can give me a patch that renames Vpim's Date#to_time (and the calls to it) with something like Date#vpim_to_time, I would very happily merge that. Thanks, Sam From vieuxtech at gmail.com Wed Jun 18 12:58:56 2008 From: vieuxtech at gmail.com (Sam Roberts) Date: Wed, 18 Jun 2008 09:58:56 -0700 Subject: [Vpim-talk] Vpim gem In-Reply-To: References: Message-ID: <17eac67c0806180958s6cc4f289i976c5114c753df81@mail.gmail.com> On Wed, Jun 18, 2008 at 6:32 AM, Joost Hietbrink wrote: > Hi Sam Roberts, > First of all. Thanks for the Vpim gem. We use it at www.yelloyello.com and > it works great. I'm glad to hear that. > We've only encountered the following error: > # NoMethodError (undefined method `to_str' for []:Array): > # > /usr/local/lib/ruby/gems/1.8/gems/vpim-0.619/lib/vpim/rfc2425.rb:256:in > `encode_text' > Maybe it should state .to_s instead of .to_str ? I don't have the code in front of me, but you are trying to encode a text field, it seems (#encode_text), so you need to pass it something that is "text", but are passing a compound data type (an Array). Using #to_s would "work" in the sense that it would silently produce garbage: irb(main):001:0> STDIN.to_s => "#" irb(main):002:0> ["sam","roberts"].to_s => "samroberts" #to_s is intended for debugging/logging purposes, not for clubbing everything into string form. What field are you setting, whats in the Array you are using as input, and what do you expect it to be in the vCard (or iCalendar)? Cheers, Sam From vieuxtech at gmail.com Wed Jun 18 15:24:34 2008 From: vieuxtech at gmail.com (Sam Roberts) Date: Wed, 18 Jun 2008 12:24:34 -0700 Subject: [Vpim-talk] Vpim gem In-Reply-To: References: <17eac67c0806180958s6cc4f289i976c5114c753df81@mail.gmail.com> Message-ID: <17eac67c0806181224m7a61c65fyb5e397f2096f5659@mail.gmail.com> On Wed, Jun 18, 2008 at 11:45 AM, Joost Hietbrink wrote: > Hi Sam, > Thanks for your quick response. This is what I'm doing: > def to_vcf(options = {}) > card = Vpim::Vcard::Maker.make2 do |maker| > maker.add_addr do |addr| > addr.location = 'work' > addr.street = self.street_address > addr.locality = self.locality > addr.region = self.administrative_area > addr.postalcode = self.postal_code > addr.country = self.country > end > end > If I'm correct all things put in are String. But maybe I'm wrong? Or maybe there is a bug. Can you send the complete stack trace? Sam > Cheers, > Joost > > An email from Joopp. > > Joost Hietbrink > > Call me +31 (0)6 14896541 > Skype me joosthietbrink > Mail me joost at joopp.com > Visit us Joopp. > Patrijsweg 74 > 2289EX Rijswijk > On Jun 18, 2008, at 6:58 PM, Sam Roberts wrote: > > On Wed, Jun 18, 2008 at 6:32 AM, Joost Hietbrink wrote: > > Hi Sam Roberts, > > First of all. Thanks for the Vpim gem. We use it at www.yelloyello.com and > > it works great. > > I'm glad to hear that. > > We've only encountered the following error: > > # NoMethodError (undefined method `to_str' for []:Array): > > # > > /usr/local/lib/ruby/gems/1.8/gems/vpim-0.619/lib/vpim/rfc2425.rb:256:in > > `encode_text' > > Maybe it should state .to_s instead of .to_str ? > > I don't have the code in front of me, but you are trying to encode a > text field, it seems (#encode_text), so you need to pass it something > that is "text", but are passing a compound data type (an Array). > > Using #to_s would "work" in the sense that it would silently produce > garbage: > irb(main):001:0> STDIN.to_s > => "#" > irb(main):002:0> ["sam","roberts"].to_s > => "samroberts" > > #to_s is intended for debugging/logging purposes, not for clubbing > everything into string form. > > What field are you setting, whats in the Array you are using as input, > and what do you expect it to be in the vCard (or iCalendar)? > > Cheers, > Sam > > From vieuxtech at gmail.com Fri Aug 15 02:03:21 2008 From: vieuxtech at gmail.com (Sam Roberts) Date: Thu, 14 Aug 2008 23:03:21 -0700 Subject: [Vpim-talk] Release vpim-0.658 uploaded Message-ID: <17eac67c0808142303s6af56d8fxda381641779c3de@mail.gmail.com> Changes: - Date#to_time renamed to Date#vpim_to_time. Apparently Rails also patches the core. - Debian doesn't like RFCs. I think there is a problem with the DFG, not the IETF. The value of a standard is that it can't be modified (if anybody could publish a modified version of an RFC without restriction chaos would ensue). Still, we lost that argument, and I'll try and help packagers out. - View, gives various views of calendars. Experimental. - Fixed doc comment refs to common Property module. - Vtodo#duration and #due now work correctly (the missing one will be calculated from the other). - Vevent::Maker#add_rrule, #set_rrule are new, using Rrule::Maker. - There is now (half-of) an Rrule::Maker class to help construct RRULE values. - Vjournal can be encoded now (it was broken). - Better code coverage by the tests. - Recurrence#occurrences now returns an Enumerator instead of an Rrule. Both have #each, and both yield the same thing, so that isn't an API change. However, Rrule had an each_until, and the Enumerator doesn't. Use the dountil argument to #occurrences to get the same effect. The asymetry of this API caused me (non-aesthetic) trouble, now Rrule is an internal implementation detail. Also, this would have had to change eventually, because occurrences need to be the union of multiple RRULE and RDATE fields. - Recurrence#rrule, returns an Rrule for the first RRULE field. Can be used as transition. - Icalendar#calscale was broken, and is now unit tested, along with #version and #protocol?. - Icalendar#{each,events,todos,journals} all yield components, or return an enumerator. - Icalendar is enumerable. - Repo and Repo::Calendar are enumerable. - #occurrences will call Rrule#each if a block is provided - Recurrence rules with DTSTART in UTC will now sortof work (thanks to Max Werner for providing the patch). - Added convenience methods for setting and getting title and org fiels (thanks to Jade Meskill for providing the patch). - Modified Icalendar#create2 so only prodid can be supplied and cal is yielded so events/etc. can be pushed. - Support Highrisehq.com's broken google talk field (see test_vcard.rb for examples, thanks to Terry Tong for reporting). From martin.streicher at gmail.com Fri Aug 15 13:34:22 2008 From: martin.streicher at gmail.com (Martin Streicher) Date: Fri, 15 Aug 2008 13:34:22 -0400 Subject: [Vpim-talk] Migrations for cards and calendars? Message-ID: Has anyone created a workable Rails migration for storing cards and calendar events? Martin From jeff at wigaldesign.com Fri Aug 29 12:09:01 2008 From: jeff at wigaldesign.com (Jeff Wigal) Date: Fri, 29 Aug 2008 12:09:01 -0400 Subject: [Vpim-talk] Adding location to Icalendar event Message-ID: <3a1553070808290909s4c8e783flecb421b49c61900f@mail.gmail.com> Just starting to play around with the VPIM gem, how do I add a location to an Icalendar event? I've looked over the basic example: cal = Vpim::Icalendar.create2 cal.add_event do |e| e.dtstart Date.new(2005, 04, 28) e.dtend Date.new(2005, 04, 29) e.summary "Monthly meet-the-CEO day" e.categories [ 'APPOINTMENT' ] e.categories do |c| c.push 'EDUCATION' end e.url 'http://www.example.com' e.location "My House" #my addition to the example e.sequence 0 e.access_class "PRIVATE" e.transparency 'OPAQUE' now = Time.now e.created now e.lastmod now e.organizer do |o| o.cn = "Example Organizer, Mr." o.uri = "mailto:organizer at example.com" end attendee = Vpim::Icalendar::Address.create("mailto:attendee at example.com") attendee.rsvp = true e.add_attendee attendee puts e.methods end I tried adding 'location' below 'url'. What am I missing? Thanks in advance-- Jeff Wigal From vieuxtech at gmail.com Mon Sep 1 01:39:07 2008 From: vieuxtech at gmail.com (Sam Roberts) Date: Mon, 1 Sep 2008 12:39:07 +0700 Subject: [Vpim-talk] Adding location to Icalendar event In-Reply-To: <3a1553070808290909s4c8e783flecb421b49c61900f@mail.gmail.com> References: <3a1553070808290909s4c8e783flecb421b49c61900f@mail.gmail.com> Message-ID: <17eac67c0808312239y4af933a7o5ce7bc1d699926d1@mail.gmail.com> I'm on vacation with no access to source for 3 more weeks, sorry. Looking at Icalendar::Maker or grepping source might help. Sam On Fri, Aug 29, 2008 at 11:09 PM, Jeff Wigal wrote: > Just starting to play around with the VPIM gem, how do I add a > location to an Icalendar event? > > I've looked over the basic example: > > cal = Vpim::Icalendar.create2 > cal.add_event do |e| > e.dtstart Date.new(2005, 04, 28) > e.dtend Date.new(2005, 04, 29) > e.summary "Monthly meet-the-CEO day" > e.categories [ 'APPOINTMENT' ] > e.categories do |c| c.push 'EDUCATION' end > e.url 'http://www.example.com' > e.location "My House" #my addition to the example > e.sequence 0 > e.access_class "PRIVATE" > e.transparency 'OPAQUE' > now = Time.now > e.created now > e.lastmod now > e.organizer do |o| > o.cn = "Example Organizer, Mr." > o.uri = "mailto:organizer at example.com" > end > attendee = Vpim::Icalendar::Address.create("mailto:attendee at example.com") > attendee.rsvp = true > e.add_attendee attendee > puts e.methods > end > > I tried adding 'location' below 'url'. What am I missing? > > Thanks in advance-- > > Jeff Wigal > _______________________________________________ > Vpim-talk mailing list > Vpim-talk at rubyforge.org > http://rubyforge.org/mailman/listinfo/vpim-talk > From rick.denatale at gmail.com Thu Sep 4 14:39:07 2008 From: rick.denatale at gmail.com (Rick DeNatale) Date: Thu, 4 Sep 2008 14:39:07 -0400 Subject: [Vpim-talk] Timezone support? Message-ID: This is a follow-up to the thread ending with: http://rubyforge.org/pipermail/vpim-talk/2008/000120.html I too am in search of some ruby parser for icalendar which properly handles timezones on the datetimes in the icalendar RFC. As I understand it there are actually three types of times. 1) UTC times with a string form of yyyymmddThhmmssZ note the trailing Z indicates zulu time aka utc. 2) Local times with a string form of TZID=ttttttt:yyyymmddThhmmss where ttttt is a variable length timezone id 'defined' in a timezone component in the containing calendar. A little experimentation with both Google calendar, and iCal.app for the Mac indicates that they at least seem to use timezone ids which are known to the TZInfo gem, but there's no guarantee. 3) Floating times with a string form of 20080715T010000 note there is no timezone either. According to the RFC these are to presented to the user as if they were in whatever timezone the user is. An example of a floating time might be midnight between New Years eve and New Years day. I've tried a little experiment to compare how both the vpim and icalendar gems handle such time specifications. Here's my code: require 'rubygems' require 'icalendar' require 'date' require 'vpim' icalendar_events = [] vpim_events = [] File.open("/Users/rick/Testing.ics") do | ical_file | calendar = Icalendar::Parser.new(ical_file).parse.first icalendar_events = calendar.events.to_a end File.open("/Users/rick/Testing.ics") do | ical_file | calendar = Vpim::Icalendar.decode(ical_file).first vpim_events = calendar.events.to_a end icalendar_events.zip(vpim_events).each do |ic, vp | puts "Processing event #{vp.summary}" puts " icalendar dtstart: #{ic.dtstart} datetime" puts " vpim dtstart: #{DateTime.parse(vp.dtstart.to_s)}" puts " #{vp.dtstart}" puts puts " icalendar dtend: #{ic.dtend} #{ic.dtend.class}" puts " vpim dtend: #{DateTime.parse(vp.dtend.to_s)}" puts " #{vp.dtend}" puts puts end And here's an edited icalendar file exported from ical.app (I've stripped out some attributes to keep it short and added some blank lines to separate events, feel free to ask for the full file) BEGIN:VCALENDAR VERSION:2.0 BEGIN:VTIMEZONE TZID:America/Chicago BEGIN:DAYLIGHT TZOFFSETFROM:-0600 TZOFFSETTO:-0500 DTSTART:20070311T020000 RRULE:FREQ=YEARLY;BYMONTH=3;BYDAY=2SU TZNAME:CDT END:DAYLIGHT BEGIN:STANDARD TZOFFSETFROM:-0500 TZOFFSETTO:-0600 DTSTART:20071104T020000 RRULE:FREQ=YEARLY;BYMONTH=11;BYDAY=1SU TZNAME:CST END:STANDARD END:VTIMEZONE BEGIN:VTIMEZONE TZID:US/Eastern BEGIN:DAYLIGHT TZOFFSETFROM:-0500 TZOFFSETTO:-0400 DTSTART:20070311T020000 RRULE:FREQ=YEARLY;BYMONTH=3;BYDAY=2SU TZNAME:EDT END:DAYLIGHT BEGIN:STANDARD TZOFFSETFROM:-0400 TZOFFSETTO:-0500 DTSTART:20071104T020000 RRULE:FREQ=YEARLY;BYMONTH=11;BYDAY=1SU TZNAME:EST END:STANDARD END:VTIMEZONE BEGIN:VEVENT SUMMARY:In Eastern 7/22/2008 00:00-01:00 DTSTART;TZID=US/Eastern:20080722T000000 DTEND;TZID=US/Eastern:20080722T010000 END:VEVENT BEGIN:VEVENT SUMMARY:In Chicago 7/8/2008 00:00-01:00 DTSTART;TZID=America/Chicago:20080708T000000 DTEND;TZID=America/Chicago:20080708T010000 END:VEVENT BEGIN:VEVENT SUMMARY:Floating 7/15/2008 00:00-01:00 DTSTART:20080715T000000 DTEND:20080715T010000 END:VEVENT BEGIN:VEVENT SUMMARY:UTC 7/01/2008 00:00-01:00 DTSTART:20080701T000000Z DTEND:20080701T010000Z END:VEVENT END:VCALENDAR And here's the output from the program: Processing event In Eastern 7/22/2008 00:00-01:00 icalendar dtstart: 2008-07-22T00:00:00+00:00 datetime vpim dtstart: 2008-07-22T00:00:00-04:00 Tue Jul 22 00:00:00 -0400 2008 icalendar dtend: 2008-07-22T01:00:00+00:00 DateTime vpim dtend: 2008-07-22T01:00:00-04:00 Tue Jul 22 01:00:00 -0400 2008 Processing event In Chicago 7/8/2008 00:00-01:00 icalendar dtstart: 2008-07-08T00:00:00+00:00 datetime vpim dtstart: 2008-07-08T00:00:00-04:00 Tue Jul 08 00:00:00 -0400 2008 icalendar dtend: 2008-07-08T01:00:00+00:00 DateTime vpim dtend: 2008-07-08T01:00:00-04:00 Tue Jul 08 01:00:00 -0400 2008 Processing event Floating 7/15/2008 00:00-01:00 icalendar dtstart: 2008-07-15T00:00:00+00:00 datetime vpim dtstart: 2008-07-15T00:00:00-04:00 Tue Jul 15 00:00:00 -0400 2008 icalendar dtend: 2008-07-15T01:00:00+00:00 DateTime vpim dtend: 2008-07-15T01:00:00-04:00 Tue Jul 15 01:00:00 -0400 2008 Processing event UTC 7/01/2008 00:00-01:00 icalendar dtstart: 2008-07-01T00:00:00+00:00 datetime vpim dtstart: 2008-07-01T00:00:00+00:00 Tue Jul 01 00:00:00 UTC 2008 icalendar dtend: 2008-07-01T01:00:00+00:00 DateTime vpim dtend: 2008-07-01T01:00:00+00:00 Tue Jul 01 01:00:00 UTC 2008 I set up the summaries to indicate the timezone/float status of each event and the start and end times as displayed to the user in iCal.app. Note that the icalendar gem just seems to ignore any timezone information, it justs returns a UTC time which is not adjusted from the true time when the timezone is, vpim recognizes the Z and returns a UTC time, but if no Z is there it seems to always give the time as the local (again unadjusted) time. There is no recognition of floating times. I'm not sure how the API should work, barring backwards compatibility, attributes like dtstart/dtend etc should probably return an object which contains both a time and an indication of the timezone or its absence in the case of a floating time. An alternative might be additional parameters, dtstart_with_timezone ... although this seems messy. Ideas, comments? -- Rick DeNatale My blog on Ruby http://talklikeaduck.denhaven2.com/ -------------- next part -------------- An HTML attachment was scrubbed... URL: From vieuxtech at gmail.com Sat Sep 6 23:57:58 2008 From: vieuxtech at gmail.com (Sam Roberts) Date: Sun, 7 Sep 2008 10:57:58 +0700 Subject: [Vpim-talk] Timezone support? In-Reply-To: References: Message-ID: <17eac67c0809062057m14044559k56e5cd127228470e@mail.gmail.com> I'm on vacation far from computers right now, will comment when I get back, ~sept 24. Thanks for your interest in vpim. In summary, I think vpim should deal not with built-in time and datetime class, they inherite the insufficient timezone support of the C libraries. They should do all manipulations and returns with something that knows timezones. If you are interested in implementing this, I'd be happy to give you suggestions, and I've some hacked together code that might help do something "good enough". Sam On Fri, Sep 5, 2008 at 1:39 AM, Rick DeNatale wrote: > This is a follow-up to the thread ending with: > http://rubyforge.org/pipermail/vpim-talk/2008/000120.html > > I too am in search of some ruby parser for icalendar which properly handles > timezones on the datetimes in the icalendar RFC. > > As I understand it there are actually three types of times. > > 1) UTC times with a string form of yyyymmddThhmmssZ > note the trailing Z indicates zulu time aka utc. > > 2) Local times with a string form of TZID=ttttttt:yyyymmddThhmmss > where ttttt is a variable length timezone id 'defined' in a timezone > component in the containing calendar. > A little experimentation with both Google calendar, and iCal.app for the > Mac indicates that they at least seem to use > timezone ids which are known to the TZInfo gem, but there's no guarantee. > > 3) Floating times with a string form of 20080715T010000 > note there is no timezone either. According to the RFC these are to > presented to the user as if they were in whatever timezone the user is. > An example of a floating time might be midnight between New Years eve > and New Years day. > > I've tried a little experiment to compare how both the vpim and icalendar > gems handle such time specifications. Here's my code: > > require 'rubygems' > require 'icalendar' > require 'date' > > require 'vpim' > > icalendar_events = [] > vpim_events = [] > > File.open("/Users/rick/Testing.ics") do | ical_file | > calendar = Icalendar::Parser.new(ical_file).parse.first > icalendar_events = calendar.events.to_a > end > File.open("/Users/rick/Testing.ics") do | ical_file | > calendar = Vpim::Icalendar.decode(ical_file).first > vpim_events = calendar.events.to_a > end > > icalendar_events.zip(vpim_events).each do |ic, vp | > puts "Processing event #{vp.summary}" > puts " icalendar dtstart: #{ic.dtstart} datetime" > puts " vpim dtstart: #{DateTime.parse(vp.dtstart.to_s)}" > puts " #{vp.dtstart}" > puts > puts " icalendar dtend: #{ic.dtend} #{ic.dtend.class}" > puts " vpim dtend: #{DateTime.parse(vp.dtend.to_s)}" > puts " #{vp.dtend}" > puts > puts > end > > And here's an edited icalendar file exported from ical.app (I've stripped > out some attributes to keep it short and added some blank lines to separate > events, feel free to ask for the full file) > > BEGIN:VCALENDAR > VERSION:2.0 > BEGIN:VTIMEZONE > TZID:America/Chicago > BEGIN:DAYLIGHT > TZOFFSETFROM:-0600 > TZOFFSETTO:-0500 > DTSTART:20070311T020000 > RRULE:FREQ=YEARLY;BYMONTH=3;BYDAY=2SU > TZNAME:CDT > END:DAYLIGHT > BEGIN:STANDARD > TZOFFSETFROM:-0500 > TZOFFSETTO:-0600 > DTSTART:20071104T020000 > RRULE:FREQ=YEARLY;BYMONTH=11;BYDAY=1SU > TZNAME:CST > END:STANDARD > END:VTIMEZONE > BEGIN:VTIMEZONE > TZID:US/Eastern > BEGIN:DAYLIGHT > TZOFFSETFROM:-0500 > TZOFFSETTO:-0400 > DTSTART:20070311T020000 > RRULE:FREQ=YEARLY;BYMONTH=3;BYDAY=2SU > TZNAME:EDT > END:DAYLIGHT > BEGIN:STANDARD > TZOFFSETFROM:-0400 > TZOFFSETTO:-0500 > DTSTART:20071104T020000 > RRULE:FREQ=YEARLY;BYMONTH=11;BYDAY=1SU > TZNAME:EST > END:STANDARD > END:VTIMEZONE > > BEGIN:VEVENT > SUMMARY:In Eastern 7/22/2008 00:00-01:00 > DTSTART;TZID=US/Eastern:20080722T000000 > DTEND;TZID=US/Eastern:20080722T010000 > END:VEVENT > > BEGIN:VEVENT > SUMMARY:In Chicago 7/8/2008 00:00-01:00 > DTSTART;TZID=America/Chicago:20080708T000000 > DTEND;TZID=America/Chicago:20080708T010000 > END:VEVENT > > BEGIN:VEVENT > SUMMARY:Floating 7/15/2008 00:00-01:00 > DTSTART:20080715T000000 > DTEND:20080715T010000 > END:VEVENT > > BEGIN:VEVENT > SUMMARY:UTC 7/01/2008 00:00-01:00 > DTSTART:20080701T000000Z > DTEND:20080701T010000Z > END:VEVENT > END:VCALENDAR > > And here's the output from the program: > > Processing event In Eastern 7/22/2008 00:00-01:00 > icalendar dtstart: 2008-07-22T00:00:00+00:00 datetime > vpim dtstart: 2008-07-22T00:00:00-04:00 > Tue Jul 22 00:00:00 -0400 2008 > > icalendar dtend: 2008-07-22T01:00:00+00:00 DateTime > vpim dtend: 2008-07-22T01:00:00-04:00 > Tue Jul 22 01:00:00 -0400 2008 > > > Processing event In Chicago 7/8/2008 00:00-01:00 > icalendar dtstart: 2008-07-08T00:00:00+00:00 datetime > vpim dtstart: 2008-07-08T00:00:00-04:00 > Tue Jul 08 00:00:00 -0400 2008 > > icalendar dtend: 2008-07-08T01:00:00+00:00 DateTime > vpim dtend: 2008-07-08T01:00:00-04:00 > Tue Jul 08 01:00:00 -0400 2008 > > > Processing event Floating 7/15/2008 00:00-01:00 > icalendar dtstart: 2008-07-15T00:00:00+00:00 datetime > vpim dtstart: 2008-07-15T00:00:00-04:00 > Tue Jul 15 00:00:00 -0400 2008 > > icalendar dtend: 2008-07-15T01:00:00+00:00 DateTime > vpim dtend: 2008-07-15T01:00:00-04:00 > Tue Jul 15 01:00:00 -0400 2008 > > > Processing event UTC 7/01/2008 00:00-01:00 > icalendar dtstart: 2008-07-01T00:00:00+00:00 datetime > vpim dtstart: 2008-07-01T00:00:00+00:00 > Tue Jul 01 00:00:00 UTC 2008 > > icalendar dtend: 2008-07-01T01:00:00+00:00 DateTime > vpim dtend: 2008-07-01T01:00:00+00:00 > Tue Jul 01 01:00:00 UTC 2008 > > I set up the summaries to indicate the timezone/float status of each event > and the start and end times as displayed to the user in iCal.app. > > Note that the icalendar gem just seems to ignore any timezone information, > it justs returns a UTC time which is not adjusted from the true time when > the timezone is, > vpim recognizes the Z and returns a UTC time, but if no Z is there it seems > to always give the time as the local (again unadjusted) time. There is no > recognition of floating times. > > > I'm not sure how the API should work, barring backwards compatibility, > attributes like dtstart/dtend etc should probably return an object which > contains both a time and an indication of the timezone or its absence in the > case of a floating time. > > An alternative might be additional parameters, dtstart_with_timezone ... > although this seems messy. > > Ideas, comments? > > -- > Rick DeNatale > > My blog on Ruby > http://talklikeaduck.denhaven2.com/ > > _______________________________________________ > Vpim-talk mailing list > Vpim-talk at rubyforge.org > http://rubyforge.org/mailman/listinfo/vpim-talk > From jeff at wigaldesign.com Sun Sep 7 17:00:00 2008 From: jeff at wigaldesign.com (Jeff Wigal) Date: Sun, 7 Sep 2008 17:00:00 -0400 Subject: [Vpim-talk] Vcards & OS X Address Book Message-ID: <3a1553070809071400t35e785fk1e3a1a7a3906499a@mail.gmail.com> I saw a couple of references in the VPIM-talk archives about OS X Address book throwing a message of "no importable cards were found". I ran into this address when I threw some code into the my rails application. I used the .vcard extension for my vcard and saw this message for OS X address book. Once I changed the extension to .vcf, it recognized it right away as a valid vcard file. Just wanted to throw this out there in case someone else runs into this. Jeff Wigal Referee Assistant www.referee-assistant.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From jeff at wigaldesign.com Wed Oct 1 22:18:29 2008 From: jeff at wigaldesign.com (Jeff Wigal) Date: Wed, 1 Oct 2008 22:18:29 -0400 Subject: [Vpim-talk] Adding location to Icalendar event In-Reply-To: <3a1553070808290909s4c8e783flecb421b49c61900f@mail.gmail.com> References: <3a1553070808290909s4c8e783flecb421b49c61900f@mail.gmail.com> Message-ID: <3a1553070810011918q4dce0753jadc7bb2b6330196a@mail.gmail.com> Just looking to see if anyone has any advice on this. Thanks! On Fri, Aug 29, 2008 at 12:09 PM, Jeff Wigal wrote: > Just starting to play around with the VPIM gem, how do I add a > location to an Icalendar event? > > I've looked over the basic example: > > cal = Vpim::Icalendar.create2 > cal.add_event do |e| > e.dtstart Date.new(2005, 04, 28) > e.dtend Date.new(2005, 04, 29) > e.summary "Monthly meet-the-CEO day" > e.categories [ 'APPOINTMENT' ] > e.categories do |c| c.push 'EDUCATION' end > e.url 'http://www.example.com' > e.location "My House" #my addition to the example > e.sequence 0 > e.access_class "PRIVATE" > e.transparency 'OPAQUE' > now = Time.now > e.created now > e.lastmod now > e.organizer do |o| > o.cn = "Example Organizer, Mr." > o.uri = "mailto:organizer at example.com" > end > attendee = Vpim::Icalendar::Address.create("mailto:attendee at example.com") > attendee.rsvp = true > e.add_attendee attendee > puts e.methods > end > > I tried adding 'location' below 'url'. What am I missing? > > Thanks in advance-- > > Jeff Wigal > From vieuxtech at gmail.com Thu Oct 2 12:22:38 2008 From: vieuxtech at gmail.com (Sam Roberts) Date: Thu, 2 Oct 2008 09:22:38 -0700 Subject: [Vpim-talk] Adding location to Icalendar event In-Reply-To: <3a1553070810011918q4dce0753jadc7bb2b6330196a@mail.gmail.com> References: <3a1553070808290909s4c8e783flecb421b49c61900f@mail.gmail.com> <3a1553070810011918q4dce0753jadc7bb2b6330196a@mail.gmail.com> Message-ID: <17eac67c0810020922y519fffe4p9a725277d39b5041@mail.gmail.com> On Wed, Oct 1, 2008 at 7:18 PM, Jeff Wigal wrote: > Just looking to see if anyone has any advice on this. Thanks! >> cal = Vpim::Icalendar.create2 >> cal.add_event do |e| >> e.dtstart Date.new(2005, 04, 28) >> e.dtend Date.new(2005, 04, 29) >> e.summary "Monthly meet-the-CEO day" >> e.categories [ 'APPOINTMENT' ] >> e.categories do |c| c.push 'EDUCATION' end >> e.url 'http://www.example.com' >> e.location "My House" #my addition to the example There is currently no API to set location. It would go in common.rb. I accept patches. However, it's a TEXT property, so should be: e.set_text("LOCATION", "My House") >> I tried adding 'location' below 'url'. What am I missing? This sounds like you might think that the properties are order dependant. Just FYI, they are not. Sam From jnylund at yahoo.com Sun Oct 5 09:43:05 2008 From: jnylund at yahoo.com (Joel Nylund) Date: Sun, 5 Oct 2008 09:43:05 -0400 Subject: [Vpim-talk] attachments in email Message-ID: <3DAE533A-95D1-41C0-9B9E-8FF5D29C0C59@yahoo.com> Hi, sorry if this is a dumb question, but is it possible to put a encoded ics as an email attachment, if so is there anything special I need to do? Some people seem to send email with a link to download the ics, vs ical seems to send an email that is the ics. I have an html email that I want a user to be able to click a link to get the event into their calendar and im not sure which approach is best. thanks Joel From vieuxtech at gmail.com Sun Oct 5 13:19:49 2008 From: vieuxtech at gmail.com (Sam Roberts) Date: Sun, 5 Oct 2008 10:19:49 -0700 Subject: [Vpim-talk] attachments in email In-Reply-To: <17eac67c0810051019j5eeb3490g8561cab4f73fad75@mail.gmail.com> References: <3DAE533A-95D1-41C0-9B9E-8FF5D29C0C59@yahoo.com> <17eac67c0810051019j5eeb3490g8561cab4f73fad75@mail.gmail.com> Message-ID: <17eac67c0810051019y282987b0j408b5a2d3bf1aca5@mail.gmail.com> On Sun, Oct 5, 2008 at 6:43 AM, Joel Nylund wrote: > Hi, sorry if this is a dumb question, but is it possible to put a encoded > ics as an email attachment, if so is there anything special I need to do? Yes, you need to construct the icalendar as an event invitation. iTIP and iMIP describe how to do this. See http://en.wikipedia.org/wiki/ICalendar#iCalendar_Data_Exchange , it has links to the RFCs. Probably just making them attachments with a MIME type of text/calendar would be sufficient, you'd want to test it. And if you find anything interesting, post back here, it might help the next person who wants to do this. > Some people seem to send email with a link to download the ics, vs ical > seems to send an email that is the ics. I have an html email that I want a iCal uses iMIP. > user to be able to click a link to get the event into their calendar and im > not sure which approach is best. Which do you want? :-) If you want them to click a link, you know what to do, just do it, if you want the events automatically delivered to their scheduling software (assuming they have some!), then they need to be text/calendar attachments. Sam From grant at fakeboard.com Thu Oct 9 11:32:03 2008 From: grant at fakeboard.com (Grant Ammons) Date: Thu, 9 Oct 2008 11:32:03 -0400 Subject: [Vpim-talk] possible outlook formatting error fix Message-ID: <23b316a00810090832w612f47d9p3dd6216714fd5869@mail.gmail.com> Hi, So on our web application we allow users to upload vcards, and as you might expect, some vcards break the vpim parser. I've noticed that the vast majority of these are from outlook. Here is what I think the issue is -- outlook is not respecting the 'soft line break' correctly, and is not putting a space in front of the line after a soft line break. Consider the following: ADR;WORK;PREF:;;445 S. Longridge Road;Indianapolis;IN;46219;United States of America LABEL;WORK;PREF;ENCODING=QUOTED-PRINTABLE:445 S. Longridge Road=0D=0A= Indianapolis, IN 46219 The last line is the obvious error, as the 2nd line has the soft break (the equals sign), and the 3rd line does NOT have a space in front of it, as it needs. So the solution I cooked up was to run the whole file through this filter: filedata.gsub!(/=\r\n/,"=") this will search for any = that is followed directly by a line break, and simply remove the line break, thus creating one long continuous line. Now the questions are: 1. is this safe? 2. is this the right way to handle the outlook issue? I've run my solution through a bunch of examples and have yet to break it. However, I don't know about vcards (and outlook) to conclude that this is the best solution. Please advise. Grant Ammons From vieuxtech at gmail.com Thu Oct 9 11:45:11 2008 From: vieuxtech at gmail.com (Sam Roberts) Date: Thu, 9 Oct 2008 08:45:11 -0700 Subject: [Vpim-talk] possible outlook formatting error fix In-Reply-To: <23b316a00810090832w612f47d9p3dd6216714fd5869@mail.gmail.com> References: <23b316a00810090832w612f47d9p3dd6216714fd5869@mail.gmail.com> Message-ID: <17eac67c0810090845u53249a74sfba48cda63c3de27@mail.gmail.com> On Thu, Oct 9, 2008 at 8:32 AM, Grant Ammons wrote: > Here is what I think the issue is -- outlook is not respecting the > 'soft line break' correctly, and is not putting a space in front of > the line after a soft line break. > > Consider the following: > > ADR;WORK;PREF:;;445 S. Longridge Road;Indianapolis;IN;46219;United > States of America > LABEL;WORK;PREF;ENCODING=QUOTED-PRINTABLE:445 S. Longridge Road=0D=0A= > Indianapolis, IN 46219 > > > The last line is the obvious error, as the 2nd line has the soft break > (the equals sign), and the 3rd line does NOT have a space in front of > it, as it needs. I can't tell which lines are which, can you attach a sample card as an attachment instead of pasted inline? > So the solution I cooked up was to run the whole file through this filter: > > filedata.gsub!(/=\r\n/,"=") > > this will search for any = that is followed directly by a line break, > and simply remove the line break, thus creating one long continuous > line. I think replacing with "=\r\n " might be better. Send me a sample file and I can look more closely. Sam From vieuxtech at gmail.com Fri Oct 24 00:14:12 2008 From: vieuxtech at gmail.com (Sam Roberts) Date: Thu, 23 Oct 2008 21:14:12 -0700 Subject: [Vpim-talk] possible outlook formatting error fix In-Reply-To: <23b316a00810090832w612f47d9p3dd6216714fd5869@mail.gmail.com> References: <23b316a00810090832w612f47d9p3dd6216714fd5869@mail.gmail.com> Message-ID: <17eac67c0810232114y764a5e2fu42d92202e5405657@mail.gmail.com> On Thu, Oct 9, 2008 at 8:32 AM, Grant Ammons wrote: > So on our web application we allow users to upload vcards, and as you > might expect, some vcards break the vpim parser. I've noticed that > the vast majority of these are from outlook. > > Here is what I think the issue is -- outlook is not respecting the > 'soft line break' correctly, and is not putting a space in front of > the line after a soft line break. These are actually version 2.1 vCards, and vPim implements 3.0. But, vPim tries to be useful anyhow. I think I've looked at it before, and concluded that it isn't even valid in vCard 2.1, though :-(. Your strategy won't work in general, because any field could just happen to end with a = sign, its a perfectly valid character in any string fields. Here's a card I exported from AddressBook.app. Assume "=" is the name of a conceptual artist. BEGIN:VCARD VERSION:3.0 N:=;=;;; FN:= = CATEGORIES:f - Vancouver X-ABUID:76D3ED90-4BB4-49A9-B9DE-3E99408CF03C\:ABPerson END:VCARD > Consider the following: > > ADR;WORK;PREF:;;445 S. Longridge Road;Indianapolis;IN;46219;United > States of America > LABEL;WORK;PREF;ENCODING=QUOTED-PRINTABLE:445 S. Longridge Road=0D=0A= > Indianapolis, IN 46219 > So the solution I cooked up was to run the whole file through this filter: > > filedata.gsub!(/=\r\n/,"=") > I think I've seen this a few times before, and you would be better with /=0D=0A=\r?\n([^ \t])/i replaced with "=0D=0A\1" In other words, catch the full pattern, a qp-escaped CRLF, followed by the qp =\r\n, followed by a non-SPC stuffed. Also, I'd suggest trying to parse without the mangling, then catching an invalid encoding error, and retrying after gsubbing. > Now the questions are: > > 1. is this safe? I wouldn't do it on all cards, but for cards that fail, its a decent heuristic - better than failing. > 2. is this the right way to handle the outlook issue? > I've run my solution through a bunch of examples and have yet to break > it. However, I don't know about vcards (and outlook) to conclude that > this is the best solution. Please advise. My example is a bit contrived, but the gsub would break it. In general, an = can show up anywhere, though, such as notes fields, category names, locally defined fields. Etc. You will also have a problem with the blank line after the b64 encoded picture. That I think might be easier to deal with, because it's always invalid. Actually, maybe vPim deals with that already, there are lots of cards around that have randomly inserted blank lines. Anyhow, consecutive CRNL pairs can be concatenated into a single one safely. Any remaining cards that don't pass, I'd be interested in seeing. Also, because it can damage valid cards, I can't make your behaviour the default, but if you'd like to submit a patch, maybe a Vcard.decode_broken() that implements your scheme, it would be really great. I'd merge something like that in a second, faster if it came in unified diff with a unit test... Thanks, Sam From tijn at soocial.com Fri Oct 24 05:07:46 2008 From: tijn at soocial.com (Tijn Schuurmans) Date: Fri, 24 Oct 2008 11:07:46 +0200 Subject: [Vpim-talk] possible outlook formatting error fix In-Reply-To: <23b316a00810090832w612f47d9p3dd6216714fd5869@mail.gmail.com> References: <23b316a00810090832w612f47d9p3dd6216714fd5869@mail.gmail.com> Message-ID: On Thu, Oct 9, 2008 at 5:32 PM, Grant Ammons wrote: > So on our web application we allow users to upload vcards, and as you > might expect, some vcards break the vpim parser. I've noticed that > the vast majority of these are from outlook. We have the same problem. I feel your pain. > Here is what I think the issue is -- outlook is not respecting the > 'soft line break' correctly, and is not putting a space in front of > the line after a soft line break. > > Consider the following: > > ADR;WORK;PREF:;;445 S. Longridge Road;Indianapolis;IN;46219;United > States of America > LABEL;WORK;PREF;ENCODING=QUOTED-PRINTABLE:445 S. Longridge Road=0D=0A= > Indianapolis, IN 46219 > > > The last line is the obvious error, as the 2nd line has the soft break > (the equals sign), and the 3rd line does NOT have a space in front of > it, as it needs. > > So the solution I cooked up was to run the whole file through this filter: > > filedata.gsub!(/=\r\n/,"=") > > this will search for any = that is followed directly by a line break, > and simply remove the line break, thus creating one long continuous > line. > > Now the questions are: > > 1. is this safe? No, I don't think so. > 2. is this the right way to handle the outlook issue? I concluded the problem was only with quoted-printable encoded fields so I made an exception handler for it. Parsing your example will raise an exception; we then conclude the vcard is broken and we'll do our best to fix it. Our best guess is this: # we will search for lines for which if line =~ /ENCODING=QUOTED-PRINTABLE/i and line =~ /=$/ and lines.length>i+1 # is true # then remove the soft-line break i.e. the last character (=)... # (The decoder does not mind processing lines longer than the maximum of 76 chars # that are allowed in a quoted-printable encoded string.) and we concatenate those lines. This is similar to your approach; the big difference is that we're doing this in an exception. I posted the patch some time ago to this or another vpim-mailinglist. I can send it to you of course, just drop me a mail. Cheers, Tijn