From sroberts at uniserve.com Sat Jan 1 23:27:40 2005 From: sroberts at uniserve.com (Sam Roberts) Date: Sat Jan 1 23:25:47 2005 Subject: [Vpim-talk] Re: vpim: bug in icalendar.rb, Icalendar#decode_status In-Reply-To: <6D51E836-4B38-11D9-90EB-000393DB7722@northwestern.edu> References: <6D51E836-4B38-11D9-90EB-000393DB7722@northwestern.edu> Message-ID: <20050102042740.GA534@ensemble.local> Thanks for the bug report! I'll get a new release out next week, I've been on vacation for a few weeks and I'm just getting up to speed with being back in a city. In the meantime, the fix is to apply the following patch (in Icalendar.decode_duration). I've also integrated your tests, thanks. Cheers, Sam diff -u -r1.22 icalendar.rb --- vpim/icalendar.rb 17 Nov 2004 05:06:27 -0000 1.22 +++ vpim/icalendar.rb 2 Jan 2005 04:19:28 -0000 @@ -303,6 +303,8 @@ if match[1] && match[1] == '-' dur = -dur end + + dur end # Decode iCalendar data into an array of Icalendar objects. Quoteing mmhohman@northwestern.edu, on Fri, Dec 10, 2004 at 11:49:30PM -0600: > Hi, > > I'm running Ruby 1.8.2 preview 3 on OS X. At the end of > Icalendar#decode_status, you don't return dur if the duration isn't > negative, i.e. > > if match[1] && match[1] == '-' > dur = -dur > end > > is nil if the condition is false. I've attached some unit tests showing > that positive durations aren't decoded correctly. Hope this helps. > > have a good weekend, > > Moses > From sroberts at uniserve.com Mon Jan 17 09:06:26 2005 From: sroberts at uniserve.com (Sam Roberts) Date: Mon Jan 17 09:04:02 2005 Subject: [Vpim-talk] Release 0.12 - now REALLY includes the vCard maker In-Reply-To: <20050102042740.GA534@ensemble.local> References: <6D51E836-4B38-11D9-90EB-000393DB7722@northwestern.edu> <20050102042740.GA534@ensemble.local> Message-ID: <20050117140626.GA1257@ensemble.local> Available from; http://vpim.rubyforge.org/ I forgot the vCard maker in the last release... oops. Heres's the changelog: 0.12 - 2005-01-17 - removed require of pp from the library and utilities where it wasn't needed, it was causing problems because it doesn't exist on ruby 1.6 systems - Added Field#to_date, returns field value as an array of Date objects - Changed Field#to_time - it now auto-detects format of values (DATE/DATE-TIME). and doesn't take/require a default_kind argument. - Added IMPP support to Vpim::Maker::Vcard. - Makefile wasn't copying the Maker classes into the release. - Duration value not returned unless it was negative, fixed. - An RRULE's UNTIL was always being assumed to be a DATE-TIME, but it can be a DATE. I fixed this, but is something of a hack, see comments and TODO. - Use String#scan instead of String#gsub, when appropriate (I didn't know it existed when I stated the project). - Run tests on 3 ruby versions. - Don't include docs in release package, it makes it way too large. - Change: use String.unpack instead of iconv to convert UCS-2 to UTF-8, removing dependency on iconv (it wasn't standard in ruby 1.6). - Change: simplified mutt_ab_query.rb, and renamed to vcf-to-mutt. - Change: reminder.rb sorts todo items by priority. - New: Vtodo#priority - the priority of the vTodo component. Cheers, Sam From at at gclab.org Thu Jan 20 13:22:10 2005 From: at at gclab.org (Akira TAGOH) Date: Thu Jan 20 13:33:33 2005 Subject: [Vpim-talk] wrong number of arguments in to_time Message-ID: <20050121.032210.25130518.at@gclab.org> Hi, I wonder if what I saw is an known bug. I tried vpim-0.12 and I was going to call dtend, dtstamp, dtstart and duration method in Vpim::Icalendar::Vevent class which I got from Vpim::Icalendar#events method. but I encountered a problem here like, ArgumentError: wrong number of arguments (1 for 0) from /usr/lib/ruby/1.8/vpim/vevent.rb:289:in `to_time' from /usr/lib/ruby/1.8/vpim/vevent.rb:289:in `dtend' Though Vevent#dtend is going to call to_time method with 'date-time' argument, Vpim::DirectoryInfo::Field#to_time seems not allowing any arguments. What's wrong then? maybe I could just remove this argument, but I'm not sure what does it mean. BTW I've made a Debian package for vpim and uploaded it. hopefully it will be available soon. Thanks, -- Akira TAGOH : tagoh@gnome.gr.jp / Japan GNOME Users Group at@gclab.org : tagoh@gnome-db.org / GNOME-DB Project : tagoh@redhat.com / Red Hat, Inc. : tagoh@debian.org / Debian Project From sroberts at uniserve.com Thu Jan 20 14:56:26 2005 From: sroberts at uniserve.com (Sam Roberts) Date: Thu Jan 20 14:54:09 2005 Subject: [Vpim-talk] wrong number of arguments in to_time In-Reply-To: <20050121.032210.25130518.at@gclab.org> References: <20050121.032210.25130518.at@gclab.org> Message-ID: <20050120195626.GA12384@certicom.com> Wrote Akira TAGOH , on Fri, Jan 21, 2005 at 03:22:10AM +0900: > I wonder if what I saw is an known bug. I tried vpim-0.12 > and I was going to call dtend, dtstamp, dtstart and duration > method in Vpim::Icalendar::Vevent class which I got from > Vpim::Icalendar#events method. but I encountered a problem > here like, > > ArgumentError: wrong number of arguments (1 for 0) > from /usr/lib/ruby/1.8/vpim/vevent.rb:289:in `to_time' > from /usr/lib/ruby/1.8/vpim/vevent.rb:289:in `dtend' I am pretty sure this is an error in my code, I'll check tonight. > Though Vevent#dtend is going to call to_time method with > 'date-time' argument, Vpim::DirectoryInfo::Field#to_time > seems not allowing any arguments. What's wrong then? maybe > I could just remove this argument, but I'm not sure what > does it mean. > > BTW I've made a Debian package for vpim and uploaded > it. hopefully it will be available soon. That's cool, thank you very much, Akira! I would like to include the dpkg config in the vpim release, would you like that? Also, maybe you already have a way of distributing .dpkgs, if you would like to tell me where it is, I can add a note to the readme. Or, if you would like, you can upload the pkg to rubyforge. Thanks, Sam -- Sam Roberts From at at gclab.org Thu Jan 20 15:50:36 2005 From: at at gclab.org (Akira TAGOH) Date: Thu Jan 20 16:03:47 2005 Subject: [Vpim-talk] wrong number of arguments in to_time In-Reply-To: <20050120195626.GA12384@certicom.com> References: <20050121.032210.25130518.at@gclab.org> <20050120195626.GA12384@certicom.com> Message-ID: <20050121.055036.200778410.at@gclab.org> Hi Sam, >>>>> On Thu, 20 Jan 2005 14:56:26 -0500, >>>>> "SR" == Sam Roberts wrote: SR> I am pretty sure this is an error in my code, I'll check tonight. Thank you :) SR> That's cool, thank you very much, Akira! SR> I would like to include the dpkg config in the vpim release, would you SR> like that? SR> Also, maybe you already have a way of distributing .dpkgs, if you would SR> like to tell me where it is, I can add a note to the readme. SR> Or, if you would like, you can upload the pkg to rubyforge. Well, you mean .deb? well, I'm waiting for the approval which is required for the new package. people who uses Debian will be able to get vpim package for Debian via apt-get after that. the package name is libvpim-ruby1.8. I don't know when it's accepted. if anyone wants to install it before accepting, I can upload it somewhere. Thanks, -- Akira TAGOH : tagoh@gnome.gr.jp / Japan GNOME Users Group at@gclab.org : tagoh@gnome-db.org / GNOME-DB Project : tagoh@redhat.com / Red Hat, Inc. : tagoh@debian.org / Debian Project From sroberts at uniserve.com Thu Jan 20 23:05:36 2005 From: sroberts at uniserve.com (Sam Roberts) Date: Thu Jan 20 23:03:02 2005 Subject: [Vpim-talk] release 0.13 - bug fix Message-ID: <20050121040536.GA11973@ensemble.local> Here's the changes for the last few releases. Cheers, Sam 0.13 - 2005-01-20 - Was calling to_time with an arg, fixed. 0.12 - 2005-01-17 - Removed require of pp from the library and utilities where it wasn't needed, it was causing problems because it doesn't exist on ruby 1.6 systems. - Added Field#to_date, returns field value as an array of Date objects - Changed Field#to_time - it now auto-detects format of values (DATE/DATE-TIME), and doesn't take/require a default_kind argument. - Added IMPP support to Vpim::Maker::Vcard. - Makefile wasn't copying the Maker classes into the release. - Duration value not returned unless it was negative, fixed. - An RRULE's UNTIL was always being assumed to be a DATE-TIME, but it can be a DATE. I fixed this, but is something of a hack, see comments and TODO. - Use String#scan instead of String#gsub, when appropriate (I didn't know it existed when I stated the project). - Run tests on 3 ruby versions. - Don't include docs in release package, it makes it way too large. - Change: use String.unpack instead of iconv to convert UCS-2 to UTF-8, removing dependency on iconv (it wasn't standard in ruby 1.6). - Change: simplified mutt_ab_query.rb, and renamed to vcf-to-mutt. - Change: reminder.rb sorts todo items by priority. - New: Vtodo#priority - the priority of the vTodo component. From sroberts at uniserve.com Thu Jan 20 23:35:21 2005 From: sroberts at uniserve.com (Sam Roberts) Date: Thu Jan 20 23:32:52 2005 Subject: [Vpim-talk] Re: debian packages for vpim In-Reply-To: <20050121.055036.200778410.at@gclab.org> References: <20050121.032210.25130518.at@gclab.org> <20050120195626.GA12384@certicom.com> <20050121.055036.200778410.at@gclab.org> Message-ID: <20050121043521.GA12193@ensemble.local> Quoteing at@gclab.org, on Fri, Jan 21, 2005 at 05:50:36AM +0900: > Hi Sam, > > >>>>> On Thu, 20 Jan 2005 14:56:26 -0500, > >>>>> "SR" == Sam Roberts wrote: > > SR> I am pretty sure this is an error in my code, I'll check tonight. > > Thank you :) Sorry, I'd fixed it locally and not uploaded it. 0.13 was uploaded and should fix this problem. > SR> I would like to include the dpkg config in the vpim release, would you > SR> like that? > > SR> Also, maybe you already have a way of distributing .dpkgs, if you would > SR> like to tell me where it is, I can add a note to the readme. > > SR> Or, if you would like, you can upload the pkg to rubyforge. > > Well, you mean .deb? well, I'm waiting for the approval > which is required for the new package. people who uses > Debian will be able to get vpim package for Debian via > apt-get after that. the package name is libvpim-ruby1.8. I don't know how to make .deb files, even though I develop on debian at work, but I assume there is some kind of config file that you wrote, and you can use it to create .deb files. Is that how it works? I'd like to add whatever it is that you use to make the packages to the standard vpim release. That way, when there is a new vpim release you (or anybody) could just untar it, type "make debian", and have a .deb file for the latest release. Is that even possible? Then I could install development packages on my machine at work easily, and if you ever get tired of uploading the packages to debian, somebody else could take over, and wouldn't have to repeat the work you've done. > I don't know when it's accepted. if anyone wants to install > it before accepting, I can upload it somewhere. I don't know, maybe its not useful, but if it takes a long time to be accepted, you can upload the .deb files to the rubyforge project. Anyhow, I'm not trying to make more work for you! Thanks for trying to get vPim packaged, and if you want to add the package config files or the .deb files to the project, you are welcome to do so. Cheers, Sam From at at gclab.org Fri Jan 21 00:23:25 2005 From: at at gclab.org (Akira TAGOH) Date: Fri Jan 21 00:36:13 2005 Subject: [Vpim-talk] Re: debian packages for vpim In-Reply-To: <20050121043521.GA12193@ensemble.local> References: <20050120195626.GA12384@certicom.com> <20050121.055036.200778410.at@gclab.org> <20050121043521.GA12193@ensemble.local> Message-ID: <20050121.142325.168035714.at@gclab.org> >>>>> On Thu, 20 Jan 2005 23:35:21 -0500, >>>>> "SR" == Sam Roberts wrote: SR> Sorry, I'd fixed it locally and not uploaded it. SR> 0.13 was uploaded and should fix this problem. Cool. thanks! SR> I don't know how to make .deb files, even though I develop on debian at SR> work, but I assume there is some kind of config file that you wrote, and SR> you can use it to create .deb files. Is that how it works? Yes, you need some files under debian/ directory to make .deb file. SR> I'd like to add whatever it is that you use to make the packages to the SR> standard vpim release. That way, when there is a new vpim release you SR> (or anybody) could just untar it, type "make debian", and have a .deb SR> file for the latest release. Is that even possible? Yes, it's possible. but please don't include debian/ directory into the tarball, please. if debian/ directory is maintained in upstream as well, it becomes the native package so that probably there is no changes I should make separately. but vpim isn't the debian-specific. However just including it into the repository for testing may be a good idea. SR> Then I could install development packages on my machine at work easily, SR> and if you ever get tired of uploading the packages to debian, somebody SR> else could take over, and wouldn't have to repeat the work you've done. Well, don't worry. we have the procedure for that. and if I get tired of, I'll do so according to. then, someone else can take over without the lacking of something so that everyone can get the debian source packages from the debian mirror site. SR> I don't know, maybe its not useful, but if it takes a long time to be SR> accepted, you can upload the .deb files to the rubyforge project. Sure. I'll let you know when it's needed. SR> Anyhow, I'm not trying to make more work for you! Thanks for trying to SR> get vPim packaged, and if you want to add the package config files or SR> the .deb files to the project, you are welcome to do so. Thanks, -- Akira TAGOH : tagoh@gnome.gr.jp / Japan GNOME Users Group at@gclab.org : tagoh@gnome-db.org / GNOME-DB Project : tagoh@redhat.com / Red Hat, Inc. : tagoh@debian.org / Debian Project From sroberts at uniserve.com Fri Jan 21 08:41:12 2005 From: sroberts at uniserve.com (Sam Roberts) Date: Fri Jan 21 08:38:41 2005 Subject: [Vpim-talk] Re: debian packages for vpim In-Reply-To: <20050121.142325.168035714.at@gclab.org> References: <20050120195626.GA12384@certicom.com> <20050121.055036.200778410.at@gclab.org> <20050121043521.GA12193@ensemble.local> <20050121.142325.168035714.at@gclab.org> Message-ID: <20050121134112.GB12288@ensemble.local> Quoteing at@gclab.org, on Fri, Jan 21, 2005 at 02:23:25PM +0900: > >>>>> On Thu, 20 Jan 2005 23:35:21 -0500, > >>>>> "SR" == Sam Roberts wrote: > SR> I'd like to add whatever it is that you use to make the packages to the > SR> standard vpim release. That way, when there is a new vpim release you > SR> (or anybody) could just untar it, type "make debian", and have a .deb > SR> file for the latest release. Is that even possible? > > Yes, it's possible. but please don't include debian/ > directory into the tarball, please. if debian/ directory is > maintained in upstream as well, it becomes the native > package so that probably there is no changes I should make > separately. but vpim isn't the debian-specific. However > just including it into the repository for testing may be a > good idea. As you wish. I just thought it might be convenient for some people, I've downloaded packages before with the files needed to make various patches. By the way, anybody else who is listening, if you want to make a package for I'm happy to include your work/packages in vPim, too. Cheers, Sam From at at gclab.org Sun Jan 23 07:50:47 2005 From: at at gclab.org (Akira TAGOH) Date: Sun Jan 23 07:50:32 2005 Subject: [Vpim-talk] time out of range occurs Message-ID: <20050123.215047.139110208.at@gclab.org> Hi again, I encountered another problem now. here is a testcase to reproduce it: $ ruby -rvpim/icalendar -ropen-uri -e 'a = Vpim::Icalendar.decode(open("http://ical.mac.com/ical/Japanese32Holidays.ics").read); a[0].events.each {|e| begin r = e.occurences; r.each(Time.local(2007)) {|f| }; rescue ArgumentError; p r; raise; end;}' It includes some yearly events and it's endless. so I did with dountil parameter. however the result of this testcase was: #"7", "BYDAY"=>"3MO"}, @until=nil, @wkst="MO", @freq="YEARLY", @interval=1, @rrule="FREQ=YEARLY;INTERVAL=1;BYMONTH=7;BYDAY=3MO", @count=nil> /usr/lib/ruby/1.8/vpim/time.rb:21:in `local': time out of range (ArgumentError) from /usr/lib/ruby/1.8/vpim/time.rb:21:in `plus_year' from /usr/lib/ruby/1.8/vpim/rrule.rb:288:in `each' from /usr/lib/ruby/1.8/vpim/rrule.rb:151:in `loop' from /usr/lib/ruby/1.8/vpim/rrule.rb:151:in `each' from -e:1 from -e:1:in `each' from -e:1 It seems because there was no yield from days in rrule.rb:252. so dountil was never checked in this case. though I'm not sure if DaySet should yields anyway, attached patch to be safe solved this problem for me. Any comments? Regards, -- Akira TAGOH : tagoh@gnome.gr.jp / Japan GNOME Users Group at@gclab.org : tagoh@gnome-db.org / GNOME-DB Project : tagoh@redhat.com / Red Hat, Inc. : tagoh@debian.org / Debian Project -------------- next part -------------- --- rrule.rb.orig 2005-01-23 21:45:13.000000000 +0900 +++ rrule.rb 2005-01-23 21:46:13.000000000 +0900 @@ -308,6 +308,7 @@ when nil return self end + return self if dountil && (t > dountil) end end From sroberts at uniserve.com Sun Jan 23 17:16:55 2005 From: sroberts at uniserve.com (Sam Roberts) Date: Sun Jan 23 17:14:18 2005 Subject: [Vpim-talk] problems with Apple calendars (was time out of range occurs) In-Reply-To: <20050123.215047.139110208.at@gclab.org> References: <20050123.215047.139110208.at@gclab.org> Message-ID: <20050123221655.GA14484@ensemble.local> Thanks for this. I had seen this, too, but hadn't got around to fixing it. There are a few things happening here. - 1 bug Yes, you have have correctly identified it. What is happening, is that if a RRULE never results in any events, it never reaches the place where the dountil is checked. Your patch correctly fixes this, thank you. - 2 useability Why not just end the iteration with no error when the boundary of representable time is reached, rather than forcing people to provide a dountil? dountil is still useful as an optimization (if you are only interested in recurrences before the end of the year, might as well say so). Any opinions on this? I've added it and I think I like it. - 3 interop I believe Apple has a bug in their calendar files, and not just in the Japanese one. This bug may be related to a bug I observe in their iCal.app, too. Because of the bug, the recurrence rule for what they want to be the third Monday in July never actually occurs! RRULE:FREQ=yearly;INTERVAL=1;BYMONTH=n;BYDAY=2MO They think this means the 2nd monday in month n, but it doesn't. It means the 2nd monday in the YEAR, if it occurs in month n. I don't know what to do about this. You can see a related bug if you code the following example from the RFC into an ics file (attached): Every 20th Monday of the year, forever: DTSTART;TZID=US-Eastern:19970519T090000 RRULE:FREQ=YEARLY;BYDAY=20MO ==> (1997 9:00 AM EDT)May 19 (1998 9:00 AM EDT)May 18 (1999 9:00 AM EDT)May 17 ... Adding a BYMONTH to this wouldn't mean the BYDAY=20MO suddenly means the 20th monday in the month, when it used to mean the 20th monday of the year. The above ics file is mangled by iCal.app. What Apple should say for "3 MO of July" is not: FREQ=YEARLY;INTERVAL=1;BYMONTH=7;BYDAY=3MO but ./rrule.rb --start "Mon Jul 18 16:32:33 EST 2005" 'FREQ=MONTHLY;INTERVAL=12;BYDAY=3MO' or (less efficient): ./rrule.rb --start "Mon Jul 18 16:32:33 EST 2005" 'FREQ=MONTHLY;INTERVAL=1;BYMONTH=7;BYDAY=3MO' I don't have a clue what to do about this. I think the "right" thing to do is to allow the processing rules to be changed, so that if the user chooses "apple rules" or if we notice the PRODID is Apple we interpret the rules their way, otherwise we do it the right way. I don't have the time to code this up right now but I will have to do it eventually, because I use Candian32Holidays.ics from Apple, and it has similar errors to the Japanese calendar you are using. If anybody on this list has the time or ability to test either http://ical.mac.com/ical/Japanese32Holidays.ics http://ical.mac.com/ical/Canadian32Holidays.ics to see if the 3MO in July is a japanese holiday, or the first MO in August is a Canadian holiday, that would be great. I would like to know how widespread this is. Also, I'm curious about the attached bug.ics, is it correctly showing up as the 20th monday of the year in other calendar programs? Cheers, Sam Quoteing at@gclab.org, on Sun, Jan 23, 2005 at 09:50:47PM +0900: > Hi again, > > I encountered another problem now. here is a testcase to > reproduce it: > > $ ruby -rvpim/icalendar -ropen-uri -e 'a = Vpim::Icalendar.decode(open("http://ical.mac.com/ical/Japanese32Holidays.ics").read); a[0].events.each {|e| begin r = e.occurences; r.each(Time.local(2007)) {|f| }; rescue ArgumentError; p r; raise; end;}' > > It includes some yearly events and it's endless. so I did > with dountil parameter. however the result of this testcase > was: > #"7", "BYDAY"=>"3MO"}, @until=nil, @wkst="MO", @freq="YEARLY", @interval=1, @rrule="FREQ=YEARLY;INTERVAL=1;BYMONTH=7;BYDAY=3MO", @count=nil> > /usr/lib/ruby/1.8/vpim/time.rb:21:in `local': time out of range (ArgumentError) > from /usr/lib/ruby/1.8/vpim/time.rb:21:in `plus_year' > from /usr/lib/ruby/1.8/vpim/rrule.rb:288:in `each' > from /usr/lib/ruby/1.8/vpim/rrule.rb:151:in `loop' > from /usr/lib/ruby/1.8/vpim/rrule.rb:151:in `each' > from -e:1 > from -e:1:in `each' > from -e:1 > > It seems because there was no yield from days in > rrule.rb:252. so dountil was never checked in this > case. though I'm not sure if DaySet should yields anyway, > attached patch to be safe solved this problem for me. > > Any comments? > > Regards, > -- > Akira TAGOH : tagoh@gnome.gr.jp / Japan GNOME Users Group > at@gclab.org : tagoh@gnome-db.org / GNOME-DB Project > : tagoh@redhat.com / Red Hat, Inc. > : tagoh@debian.org / Debian Project > --- rrule.rb.orig 2005-01-23 21:45:13.000000000 +0900 > +++ rrule.rb 2005-01-23 21:46:13.000000000 +0900 > @@ -308,6 +308,7 @@ > when nil > return self > end > + return self if dountil && (t > dountil) > end > end > > _______________________________________________ > Vpim-talk mailing list > Vpim-talk@rubyforge.org > http://rubyforge.org/mailman/listinfo/vpim-talk -------------- next part -------------- A non-text attachment was scrubbed... Name: bug.ics Type: text/calendar Size: 248 bytes Desc: not available Url : http://rubyforge.org/pipermail/vpim-talk/attachments/20050123/b2cfd433/bug.bin