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
#<Vpim::Vcard:0x10d81c0> (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