Sha256: adf0db82e957ae3b99f627e85fe7ef2564c7f071f7fdd2b820b0f71902ca97ba

Contents?: true

Size: 483 Bytes

Versions: 24

Compression:

Stored size: 483 Bytes

Contents

#!/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

Version data entries

24 entries across 24 versions & 11 rubygems

Version Path
vpim-0.619 samples/vcf-to-ics.rb
vpim-0.658 samples/vcf-to-ics.rb
vpim-0.602 samples/vcf-to-ics.rb
vpim-0.695 samples/vcf-to-ics.rb