From monodeck at googlemail.com Wed Feb 7 11:40:16 2007 From: monodeck at googlemail.com (Andreas Aderhold) Date: Wed, 7 Feb 2007 17:40:16 +0100 Subject: [Vpim-talk] How to set TZID in DTSTART? Message-ID: Hello all, I am currently evaluating the vpim libraries and like them very much. However there's one thing I can't get done: How can I set the TZID parameter for DTSTART/END dates so my encoded ICS file looks something like this: BEGIN:VEVENT ... DTSTART;TZID=Eastern Time:20071201T080000 DTEND;TZID=Eastern Time:20071207T110000 ... END:VEVENT I managed to create the VTIMEZONE object, but that only sets up the time-zone itself for reference. To actually use it, I need the TZID thing. UTC does not help me much 'caus I still need to tell the calendar in which time-zone the event happens so it can calculate the local time. I found that I can create fields manually like this: f = Vpim::DirectoryInfo::Field.create('DTSTART', "20071201T080000", "TZID"=>"Eastern Time") f.to_s => "DTSTART;TZID=Eastern Time:20071201T080000\n" That's exactly the format I need. Then again I did not find out how to properly add that to the event object (i.e. event.dtstart(time, {"key" => "value"}) does not work). This led me to monkey-patch the code (see below). I'm not deep into it and don't get quite the structure of the code yet. So even the patch works in my setting, it could screw things. I am grateful for any hints and pointers for an official way of adding the TZID parameter to date/time fields. Andreas --- i'm a monkeeey --- module Vpim::Icalendar::Set::Util alias :original_set_date_or_datetime :set_date_or_datetime def set_date_or_datetime(name, default, value, params = {}) props = original_set_date_or_datetime(name, default, value) params.each { |k,v| props.field(name)[k] = v } props end end module Vpim::Icalendar::Set::Common def dtstart(start, params = {}) set_date_or_datetime 'DTSTART', 'DATE-TIME', start, params self end end class Vpim::Icalendar::Vevent::Maker def dtend(dtend, params = {}) set_date_or_datetime 'DTEND', 'DATE-TIME', dtend, params end end From sroberts at uniserve.com Thu Feb 8 00:07:40 2007 From: sroberts at uniserve.com (Sam Roberts) Date: Wed, 7 Feb 2007 21:07:40 -0800 Subject: [Vpim-talk] How to set TZID in DTSTART? In-Reply-To: References: Message-ID: <20070208050739.GA549@ensemble.local> Quoting monodeck at googlemail.com, on Wed, Feb 07, 2007 at 05:40:16PM +0100: > However there's one thing I can't get done: How can I set the TZID > parameter for DTSTART/END dates so my encoded ICS file looks > something like this: > > BEGIN:VEVENT > ... > DTSTART;TZID=Eastern Time:20071201T080000 > DTEND;TZID=Eastern Time:20071207T110000 > ... > END:VEVENT I've never used timezones, or set tzids, so there is no API for them. But, I'm painfully aware that TZ support is not good in vPim. Since I started working on it, several very nice timezone/date support packages with compiled in tz info have appeared on ruby forge. Your approach seems completely workable. Do you think a full params hash is required? It appears only ;tzid can be set (other than ;value, which should be set already, and the magic hole, x- params). Doesn't a TZID have to map to a VTIMEZONE present in a calendar, to be correctly encoded? Perhaps instead of a string, a Vtimezone object could be passed: module Vpim::Icalendar::Set::Common def dtstart(start, timezone = nil) end end And if there was an Icalendar#tz(tzid = nil) # nil means the single one, raise if there isn't one You could do cal.add_event(start, cal.tz) do |e| # event in the default timezone ... end cal.add_event(start) do |e| # event in "floating" time ... end Just throwing ideas out, you're the user, and the implementor, I'm afraid. Time spent on vPim has become a time sink I can't afford, sorry. If you like, I can arrange commit access. Cheers, Sam From mike at bodaro.com Thu Feb 15 20:17:43 2007 From: mike at bodaro.com (Mike Papper) Date: Thu, 15 Feb 2007 17:17:43 -0800 Subject: [Vpim-talk] Merge or Sync Functionality Message-ID: <45D50637.9050804@bodaro.com> Hi, does anyone have some code, a method or some ideas on writing a merge or sync method for the Vpim::Vcard class? The idea is that the merge or sync method would be an instance method that takes another Vcard as a parameter (presumably with the same name 'N' field value). the method would look at fields of both vcards - merging together fields with the same type/name and adding a superset of un-common fields into the current object. Mike From monodeck at googlemail.com Fri Feb 16 05:54:11 2007 From: monodeck at googlemail.com (Andreas Aderhold) Date: Fri, 16 Feb 2007 11:54:11 +0100 Subject: [Vpim-talk] How to set TZID in DTSTART? In-Reply-To: <20070208050739.GA549@ensemble.local> References: <20070208050739.GA549@ensemble.local> Message-ID: Hey Sam, > > However there's one thing I can't get done: How can I set the TZID > I've never used timezones, or set tzids, so there is no API for them. I see. I've finally switchted to templates for generating calendar files. I found it's the quickest approach for my needs at the moment (I don't need parsing, but a lot of extra dirty X Outlook fields and tweaks). Time zones however are very essential in my case since people importing the ICS files are not in the same time zone. > But, I'm painfully aware that TZ support is not good in vPim. Since I > started working on it, several very nice timezone/date support packages > with compiled in tz info have appeared on ruby forge. I'm not sure if it sould go as far as having a "real" time zone support (involving other libs). In my case i'd only need to say like: "Dates and times for vevent x to be interpreted as local time in time-zone y". So I'd be happy just having the API for supporting VTIMEZONE and TZID wherever I need it. > Do you think a full params hash is required? It appears only ;tzid can be set > (other than ;value, which should be set already, and the magic hole, x- params). If it's constrained that way, the API shoudl reflect it of course. > Just throwing ideas out, you're the user, and the implementor, I'm > afraid. Time spent on vPim has become a time sink I can't afford, > sorry. If you like, I can arrange commit access. Same here. I need a day that counts 48 hours, then I would have OpenSource time again. But i'll send you a patch along as soon as the "tempalte" approach gets to awkward and I need somthing more contained. Thanks you took the time to answer. Andreas From henryj at paradise.net.nz Fri Feb 23 21:38:30 2007 From: henryj at paradise.net.nz (Henry Maddocks) Date: Sat, 24 Feb 2007 15:38:30 +1300 Subject: [Vpim-talk] Incorrect unicode conversion Message-ID: <4425D356-7937-45A8-9E5C-F4477C4EDA7F@paradise.net.nz> vcard#decode fails on UTF-16 files because the test uses the wrong character. It should as follows... vcard.rb 682: when /^\x00\x42/i 683; string = string.unpack('n*').pack('U*') 684: when /^\x42\x00/i 685: string = string.unpack('v*').pack('U*') And there should probably be a similar test for lower case 'b' as well, as per the documentation. From henryj at paradise.net.nz Fri Feb 23 21:31:37 2007 From: henryj at paradise.net.nz (Henry Maddocks) Date: Sat, 24 Feb 2007 15:31:37 +1300 Subject: [Vpim-talk] Missing Uri Message-ID: <399BD57C-EFD0-4D39-BE66-297C15FF5739@paradise.net.nz> When trying to import a vcf with a url I get an error in the following function... vcard.rb 504: def decode_uri(field) #:nodoc: 505: Line.new( field.group, field.name, Uri.new(field.value) ) 506: end There is no class Uri. Any idea where it might have gone? From sroberts at uniserve.com Mon Feb 26 01:29:32 2007 From: sroberts at uniserve.com (Sam Roberts) Date: Sun, 25 Feb 2007 22:29:32 -0800 Subject: [Vpim-talk] Incorrect unicode conversion In-Reply-To: <4425D356-7937-45A8-9E5C-F4477C4EDA7F@paradise.net.nz> References: <4425D356-7937-45A8-9E5C-F4477C4EDA7F@paradise.net.nz> Message-ID: <20070226062932.GB728@ensemble.local> Quoting henryj at paradise.net.nz, on Sat, Feb 24, 2007 at 03:38:30PM +1300: > vcard#decode fails on UTF-16 files because the test uses the wrong > character. It should as follows... > > vcard.rb > 682: when /^\x00\x42/i > 683; string = string.unpack('n*').pack('U*') > 684: when /^\x42\x00/i > 685: string = string.unpack('v*').pack('U*') > > And there should probably be a similar test for lower case 'b' as > well, as per the documentation. The test for 'b' is already there, b is x62. The comparison is supposed to be case-insensitive, and seems to work fine: ensemble:~/p/ruby/svn-trunk % ruby1.8 -e 's="\0B"; p s; p s =~ /\x00\x62/' "\000B" nil ensemble:~/p/ruby/svn-trunk % ruby1.8 -e 's="\0B"; p s; p s =~ /\x00\x62/i' "\000B" 0 I have a suspicion that you are using ruby 1.6, is that possible? I can change the regexs to /^\0B/i and /^B\0/i, which seems to work with ruby 1.6, but I don't believe vPim will work on ruby 1.6 anymore. I used to run the unit tests against it and tried to make it work with both, because I use OS X 10.3 sometimes, but then gave up, it was too hard to stay compatible, and ruby 1.8.1 was released a long, long time ago. Sam From sroberts at uniserve.com Mon Feb 26 01:31:50 2007 From: sroberts at uniserve.com (Sam Roberts) Date: Sun, 25 Feb 2007 22:31:50 -0800 Subject: [Vpim-talk] Missing Uri In-Reply-To: <399BD57C-EFD0-4D39-BE66-297C15FF5739@paradise.net.nz> References: <399BD57C-EFD0-4D39-BE66-297C15FF5739@paradise.net.nz> Message-ID: <20070226063150.GA919@ensemble.local> Quoting henryj at paradise.net.nz, on Sat, Feb 24, 2007 at 03:31:37PM +1300: > When trying to import a vcf with a url I get an error in the > following function... > > vcard.rb > 504: def decode_uri(field) #:nodoc: > 505: Line.new( field.group, field.name, Uri.new(field.value) ) > 506: end > > There is no class Uri. Any idea where it might have gone? Sorry. It went to Attachment::Uri. Sam From henryj at paradise.net.nz Mon Feb 26 03:16:35 2007 From: henryj at paradise.net.nz (Henry Maddocks) Date: Mon, 26 Feb 2007 21:16:35 +1300 Subject: [Vpim-talk] Missing Uri In-Reply-To: <20070226063150.GA919@ensemble.local> References: <399BD57C-EFD0-4D39-BE66-297C15FF5739@paradise.net.nz> <20070226063150.GA919@ensemble.local> Message-ID: <2283BF6B-3266-4B68-9AD6-DC1A8C45AFEF@paradise.net.nz> On 26/02/2007, at 7:31 PM, Sam Roberts wrote: > Quoting henryj at paradise.net.nz, on Sat, Feb 24, 2007 at 03:31:37PM > +1300: >> When trying to import a vcf with a url I get an error in the >> following function... >> >> vcard.rb >> 504: def decode_uri(field) #:nodoc: >> 505: Line.new( field.group, field.name, Uri.new(field.value) ) >> 506: end >> >> There is no class Uri. Any idea where it might have gone? > > Sorry. It went to Attachment::Uri. Attachment::Uri#new take two arguments. What should the second be, the protocol? def initialize(uri, format) #:nodoc: From sroberts at uniserve.com Mon Feb 26 17:11:46 2007 From: sroberts at uniserve.com (Sam Roberts) Date: Mon, 26 Feb 2007 14:11:46 -0800 Subject: [Vpim-talk] Incorrect unicode conversion In-Reply-To: <304E8DFF-EFE5-47D9-9F14-4FB284E80D40@paradise.net.nz> References: <4425D356-7937-45A8-9E5C-F4477C4EDA7F@paradise.net.nz> <20070226062932.GB728@ensemble.local> <304E8DFF-EFE5-47D9-9F14-4FB284E80D40@paradise.net.nz> Message-ID: <20070226221146.GA15035@pebble> On Mon, Feb 26, 2007 at 09:13:35PM +1300, Henry Maddocks wrote: > >>And there should probably be a similar test for lower case 'b' as > >>well, as per the documentation. > > > >The test for 'b' is already there, b is x62. The comparison is > >supposed > >to be case-insensitive, and seems to work fine: > > > >ensemble:~/p/ruby/svn-trunk % ruby1.8 -e 's="\0B"; p s; p s =~ /\x00\x62/' > >"\000B" > >nil > >ensemble:~/p/ruby/svn-trunk % ruby1.8 -e 's="\0B"; p s; p s =~ /\x00\x62/i' > >"\000B" > >0 > > I'm using 1.8.5. You are right, lower case b is x62. Upper case B is > x42 which is why my code was failing. How is the code case insensitive? Can you try these commands? --version -e 's="\0B"; p s; p s =~ /\x00\x62/i' The i option in the regex -----------------------^ makes the comparison insensitive. Sam From henryj at paradise.net.nz Tue Feb 27 03:57:35 2007 From: henryj at paradise.net.nz (Henry Maddocks) Date: Tue, 27 Feb 2007 21:57:35 +1300 Subject: [Vpim-talk] Incorrect unicode conversion In-Reply-To: <20070226221146.GA15035@pebble> References: <4425D356-7937-45A8-9E5C-F4477C4EDA7F@paradise.net.nz> <20070226062932.GB728@ensemble.local> <304E8DFF-EFE5-47D9-9F14-4FB284E80D40@paradise.net.nz> <20070226221146.GA15035@pebble> Message-ID: On 27/02/2007, at 11:11 AM, Sam Roberts wrote: > Can you try these commands? > > --version > -e 's="\0B"; p s; p s =~ /\x00\x62/i' > > The i option in the regex -----------------------^ makes the > comparison > insensitive. henry$ ruby --version ruby 1.8.5 (2006-08-25) [powerpc-darwin8.8.0] henry$ ruby -e 's="\0B"; p s; p s =~ /\x00\x62/i' "\000B" nil henry$ ruby -e 's="\0B"; p s; p s =~ /\x00\x42/i' "\000B" 0 henry$ From sroberts at uniserve.com Sat Mar 3 16:33:09 2007 From: sroberts at uniserve.com (Sam Roberts) Date: Sat, 3 Mar 2007 13:33:09 -0800 Subject: [Vpim-talk] Merge or Sync Functionality In-Reply-To: <45D50637.9050804@bodaro.com> References: <45D50637.9050804@bodaro.com> Message-ID: <20070303213309.GA531@ensemble.local> Quoting mike at bodaro.com, on Thu, Feb 15, 2007 at 05:17:43PM -0800: > does anyone have some code, a method or some ideas on writing a merge or > sync method for the Vpim::Vcard class? Well, I've no code, but if you write something, pls send it! > The idea is that the merge or sync method would be an instance method > that takes another Vcard as a parameter (presumably with the same name > 'N' field value). the method would look at fields of both vcards - > merging together fields with the same type/name and adding a superset of > un-common fields into the current object. I suspect automating it might be hard, I know OS X's address book offers some choices, and allows the person to resolve conflicts. You could built code that was UI-free, though, and then the accept/reject could be in the UI/cmd line, whatever, but the core logic could be in a library. Sam From rberger at ibd.com Sat Apr 7 02:10:28 2007 From: rberger at ibd.com (Robert J. Berger) Date: Fri, 6 Apr 2007 23:10:28 -0700 Subject: [Vpim-talk] Icalendar::Get::Common missing? / cmd-itip.sh fails on getting comment? Message-ID: <37C135AE-E70D-4B49-B2A9-6021D46DFB80@ibd.com> I am brand new to vpim, so I tried to use the example cmd-itip.sh. But it fails on the code: if e.comments with the error message: ./cmd-itip.txt.sh:113: undefined method `comment' for # (NoMethodError) In the rdoc it says there should be Icalendar::Get::Common#comment But there is no module Get in Vpim:Icalendar. There is the module Set... Am I missing something? Thanks Rob ?????????????????????????????? Robert J. Berger - Internet Bandwidth Development, LLC. Voice: 408-882-4755 eFax: +1-408-490-2868 http://www.ibd.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/vpim-talk/attachments/20070406/ae9febad/attachment-0001.html From administration at turns.net Sun Aug 5 03:44:25 2007 From: administration at turns.net (Administration TURNS) Date: Sun, 5 Aug 2007 08:44:25 +0100 Subject: [Vpim-talk] Incorrect unicode conversion Message-ID: <20070805074323.M79256@turns.net> On 27/02/2007, at 03:57 AM, Henry Maddocks wrote: > > Can you try these commands? > > > > --version > > -e 's="\0B"; p s; p s =~ /\x00\x62/i' > > > > The i option in the regex -----------------------^ makes the > > comparison > > insensitive. > > henry$ ruby --version > ruby 1.8.5 (2006-08-25) [powerpc-darwin8.8.0] > henry$ ruby -e 's="\0B"; p s; p s =~ /\x00\x62/i' > "\000B" > nil > henry$ ruby -e 's="\0B"; p s; p s =~ /\x00\x42/i' > "\000B" > 0 > henry$ Hi there, sorry to barge in as a newbie, but did this one ever get resolved? I'm having a problem implementing Joyent Connector and, whilst I don't think it is a Vpim problem, I haven't ruled it out yet. In a nutshell, the application fails tests for vcard processing when presented with UTF16 vcards. I'm running Ruby 1.8.5 on CentOs4 and would like to eliminate Vpim as the cause before looking elsewhere, but this thread has me looking anew at Vpim. Many thanks Silas From sroberts at uniserve.com Fri Sep 21 00:03:54 2007 From: sroberts at uniserve.com (Sam Roberts) Date: Thu, 20 Sep 2007 21:03:54 -0700 Subject: [Vpim-talk] VPIM - outlook contact failed to parse In-Reply-To: <005e01c7d3fa$44fbb5e0$cef321a0$@com> References: <001f01c7cf00$2d9e30c0$88da9240$@com> <20070726160140.GA24135@sam-desktop> <005e01c7d3fa$44fbb5e0$cef321a0$@com> Message-ID: <20070921040353.GC1666@ensemble.local> Quoting timcharper at gmail.com, on Tue, Jul 31, 2007 at 11:10:23PM -0600: > Sam, > > Here's a patch of the fixes I applied to get it to read the outlook card, > plus a copy of the card. Hope these may be of some use there! Thanks Tim, but I think your patch will break valid vcards. Also, the card you sent me is not a valid vcard. I suspect that somehow in the process of extracting it from email, something is being damaged. The problem is here: ---- LABEL;WORK;ENCODING=QUOTED-PRINTABLE:734 Business Street=0D=0A= Provo, UT 84601 ---- It appears Provo was intended to be part of the previous field, doesn't it? But for that to be true the line would have to start with a single whitespace character, such as: ---- LABEL;WORK;ENCODING=QUOTED-PRINTABLE:734 Business Street=0D=0A= Provo, UT 84601 ---- Thats how fields are folded in vcard. If you modify your .vcf file in the several lines where this error occurs, you will see it parses OK. Also, note that your patch does a blanket conversion on the entire vcard! If I had a company named: ORG:sam=11monkeys your patch would treat the =11 as quoted printable. The only thing that is supposed to be quoted-printable is the value of the LABEL field! But! We still aren't out of the woods. If you take: ---- LABEL;WORK;ENCODING=QUOTED-PRINTABLE:734 Business Street=0D=0A= Provo, UT 84601 ---- Apply vcard unfolding, you will get: ---- LABEL;WORK;ENCODING=QUOTED-PRINTABLE:734 Business Street=0D=0A=Provo, UT 84601 ---- Unfotunately, there is a problem here. That lone = at the end of the line: irb(main):001:0> "734 Business Street=0D=0A=Provo, UT 84601".unpack('M*') => ["734 Business Street\r\n"] I really don't know what to make of this file. An = at the end of the line is a "soft-line-break" It means, unfold the following line. But that doesn't make any sense here... It looks to me like the original vcard looked like: ---- LABEL;WORK;ENCODING=QUOTED-PRINTABLE:734 Business Street=0D=0AProvo, UT 84601 ---- (note there isn't an extra "=") Some mail transport software then did some kind of wrapping on it, and marked it as wrapped: ---- LABEL;WORK;ENCODING=QUOTED-PRINTABLE:734 Business Street=0D=0A= Provo, UT 84601 ---- And then somehow you got that data as if it was a valid vcard. Anyhow, the long and the short of it is that if you can't arrange to get undamaged vcards, you'll have to patch them up outside of vpim. I'd like to support broken vcards if possible, but not at the price of misinterpreting valid vcards. My suggestion is to do something like card.gsub(/=\n/, "\n ") Will patch up your vcard so vpim accepts it. Cheers, Sam Btw, I don't understand something in your patch: > Index: lib/vpim/rfc2425.rb > =================================================================== > --- lib/vpim/rfc2425.rb (revision 747) > +++ lib/vpim/rfc2425.rb (revision 748) > @@ -1,3 +1,4 @@ > + > =begin > Copyright (C) 2006 Sam Roberts > > @@ -228,7 +229,7 @@ > end > > def Vpim.encode_text(v) #:nodoc: > - v.to_str.gsub(/([.\n])/) do > + v.to_s.gsub(/([.\n])/) do v is supposed to be a string, or something duck-typed to be a string. Any object that believes itself to be a string implements #to_str, a convention used in ruby itself: irb(main):006:0> class S; def to_str; "hi" end end => nil irb(main):007:0> "hi" + Object.new TypeError: can't convert Object into String from (irb):7:in `+' from (irb):7 irb(main):008:0> "hi" + S.new => "hihi" #to_s is a cast operator, it will coerce something into some kind of string form, but probably not one you want! irb(main):002:0> Object.new.to_s => "#" irb(main):003:0> Object.new.to_str NoMethodError: undefined method `to_str' for # from (irb):3 irb(main):005:0> File.open("_", "w").to_s => "#" With this change pretty much any ruby object would just silently show up as weirdo text. > case $1 > when "\n" > "\\n" > @@ -242,10 +243,10 @@ > > # v is an Array of String, or just a single String > def Vpim.encode_text_list(v, sep = ",") #:nodoc: > - begin > - v.to_ary.map{ |t| Vpim.encode_text(t) }.join(sep) > - rescue > - Vpim.encode_text(v) Ditto for my use of #to_ary, anything that is "array-like" implements #to_ary, your change below checks against an explicit type, anti-duck-typing. > + if Array===v > + v.map{ |t| Vpim.encode_text(t) }.join(sep) > + else > + Vpim.encode_text(v.to_s) > end > end > > Index: lib/vpim/dirinfo.rb > =================================================================== > --- lib/vpim/dirinfo.rb (revision 747) > +++ lib/vpim/dirinfo.rb (revision 748) > @@ -71,7 +71,9 @@ > else > raise ArgumentError, "DirectoryInfo cannot be created from a #{card.type}" > end > - > + # patch to fix outlook vcf cards from failing to load > + string.gsub!("=0D=0A=\n", "=0D=0A") > + string.gsub!("=0D=0A", "=0A") # change \r\n to \n > fields = Vpim.decode(string) > > new(fields) > Index: lib/vpim/vcard.rb > =================================================================== > --- lib/vpim/vcard.rb (revision 747) > +++ lib/vpim/vcard.rb (revision 748) > @@ -386,7 +386,7 @@ > # Override the attr reader to make it dynamic > remove_method :formatted > def formatted #:nodoc: > - f = [ @prefix, @given, @additional, @family ].map{|i| i == '' ? nil : i.strip}.compact.join(' ') > + f = [ @prefix, @given, @additional, @family ].map{|i| (i||"").strip }.select{|x| !x.blank? }.join(' ') > if @suffix != '' > f << ', ' << @suffix > end > @@ -410,7 +410,7 @@ > > def encode #:nodoc: > Vpim::DirectoryInfo::Field.create('N', > - Vpim.encode_text_list([ @family, @given, @additional, @prefix, @suffix ].map{|n| n.strip}, ';') > + Vpim.encode_text_list([ @family, @given, @additional, @prefix, @suffix ].map{|n| (n||"").strip}, ';') > ) > end > def encode_fn #:nodoc: > @@ -1090,7 +1090,7 @@ > end > @card << Vpim::DirectoryInfo::Field.create( 'FN', fullname ); > end > - > + > # Set the name fields, N and FN. > # > # Attributes of +name+ are: > @@ -1175,6 +1175,21 @@ > > @card << Vpim::DirectoryInfo::Field.create( 'NICKNAME', nickname ); > end > + > + > + { > + :job_title => "TITLE", > + :company_name => "ORG", > + :revision => "REV" > + }.each_pair{|method_name, vcard_index| > + class_eval <<-EOF, __FILE__, __LINE__ > + def #{method_name}=(value) > + delete_if { |l| l.name == '#{vcard_index}' } > + > + @card << Vpim::DirectoryInfo::Field.create( '#{vcard_index}', value); > + end > + EOF > + } > > # Add a birthday field, BDAY. > # From sroberts at uniserve.com Thu Sep 20 23:19:02 2007 From: sroberts at uniserve.com (Sam Roberts) Date: Thu, 20 Sep 2007 20:19:02 -0700 Subject: [Vpim-talk] vPim RRULE fix In-Reply-To: <5D7150BC-712C-4DD0-AE2D-CBEDECAD2CEE@37signals.com> References: <5D7150BC-712C-4DD0-AE2D-CBEDECAD2CEE@37signals.com> Message-ID: <20070921031902.GB1504@ensemble.local> Quoting sam at 37signals.com, on Tue, Sep 11, 2007 at 02:41:16PM -0500: > Hi- > > We're using your vPim library at 37signals for the Backpack Calendar > (http://backpackit.com/calendar ) and ran into an issue with the "US > Holidays" calendar available at http://ical.mac.com/ical/US32Holidays.ics . Thanks for the patch and unit test, I've applied it to rubyforge cvs. Sam From yt.dev at neuf.fr Mon Oct 1 04:52:07 2007 From: yt.dev at neuf.fr (Yvon Thoraval) Date: Mon, 01 Oct 2007 10:52:07 +0200 Subject: [Vpim-talk] problem with (french) localisation Message-ID: hey all, here is my script taken from the examples : ---------------------------------------------------------------- #!/usr/bin/env ruby require 'vpim/vcard' require 'vpim/icalendar' $in = ARGV.first ? File.open(ARGV.shift) : $stdin $out = ARGV.first ? File.open(ARGV.shift, 'w') : $stdout cal = Vpim::Icalendar.create Vpim::Vcard.decode($in).each do |card| if card.birthday cal.push Vpim::Icalendar::Vevent.create_yearly( card.birthday, "Birthday for #{card['fn'].strip}" ) $stderr.puts "#{card['fn']} -> bday #{cal.events.last.dtstart}" end end puts cal.encode ---------------------------------------------------------------- calling it by : ./vcf-to-ics.rb Anais.vcf Anais.ics with "Anais.vcf" in the same folder. then, i get an error : ~/work/Ruby/vpim-0.9/essais%> ./vcf-to-ics.rb Anais.vcf Anais.ics ./vcf-to-ics.rb:12: undefined method `birthday' for # (NoMethodError) from ./vcf-to-ics.rb:11:in `each' from ./vcf-to-ics.rb:11 the vCard i've exported being with a birthday field, name in french : "date de naissance" however the vCard itself is exported in english the birthday line of it : BDAY;value=date:1979-06-16 do you think this could be the prob (ie french localisation of AddressBook) ??? vest, Yvon From tijn at soocial.com Mon Oct 1 07:46:37 2007 From: tijn at soocial.com (Tijn Schuurmans - Soocial.com) Date: Mon, 1 Oct 2007 13:46:37 +0200 Subject: [Vpim-talk] VPIM - outlook contact failed to parse Message-ID: <200710011346.37808.tijn@soocial.com> Dear list, Please find attached a patch to rfc2425.rb to handle line breaks in quoted printable fields; like Outlook stores vcards. Note that I did not have to change the unfolding code for this. I believe this patch does not interfere with the parsing of valid vcards. It should only enable vpim to load an invalid vcard that is slightly diverging from the standard in a well defined way. I hope you'll find it useful, I'm looking forward to reading your remarks. -- Best regards, Tijn Schuurmans - Soocial.com PS. My previous message from a week ago never arrived at the mailinglist. What could have happened? -------------- next part -------------- A non-text attachment was scrubbed... Name: handle_borked_quoted_printables.patch Type: text/x-diff Size: 1788 bytes Desc: not available Url : http://rubyforge.org/pipermail/vpim-talk/attachments/20071001/dd01c7b3/attachment.bin From sroberts at uniserve.com Tue Oct 30 01:55:46 2007 From: sroberts at uniserve.com (Sam Roberts) Date: Mon, 29 Oct 2007 22:55:46 -0700 Subject: [Vpim-talk] vpim patch In-Reply-To: References: Message-ID: <20071030055546.GB1449@ensemble.local> Quoting jan.becvar at solnet.cz, on Mon, Jan 08, 2007 at 04:30:39PM +0100: > Hello, > here is small fix to Vpim.encode_text: Yes, I messed up the regex, thanks for the fix. Sam