Project

simplevpim

0.0
No commit activity in last 3 years
No release in over 3 years
A simple wrapper for the vPim gem.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Runtime

~> 0.6, >= 0.6.3
~> 1.0, >= 1.0.3
>= 0.4.0, ~> 0.4
~> 13.11, >= 13.11.11
 Project Readme

Creating an event using the SimpleVpim gem

require 'simplevpim'

s = '
# vevent

title: Book Festival
start: 15 Aug
end:   17 Aug
location: Edinburgh
description: Refreshments included
'

card = SimpleVpim.new(s).to_vevent
puts card

Output:

BEGIN:VEVENT
SUMMARY:Book Festival
DTSTART;VALUE=DATE:20210815
DTEND;VALUE=DATE:20210817
LOCATION:Edinburgh
DESCRIPTION:Refreshments included
END:VEVENT

simplevpim event calendar vevent

The SimplevPim gem version 0.1.2

This morning I read that the government were adopting the vCard and iCalendar formats as standard. Out of interest I discovered there was a Ruby gem which could generate a vCard, and iCalendar format, however it didn't seem that convenient to use. Which is why I created the SimplevPim gem which is a wrapper for the vPim gem.

e.g.

require 'simplevpim'

s = '
# vcard

name: James Robertson
email:
  home: james@jamesrobertson.eu
  work: jrobertsonfunjob@gmail.com
'

card = SimpleVpim.new(s).to_vcard
puts card
BEGIN:VCARD
VERSION:3.0
N:Robertson;James;;;
FN:James Robertson
EMAIL;TYPE=work:jrobertsonfunjob@gmail.com
EMAIL;TYPE=home:james@jamesrobertson.eu
END:VCARD

I only just wrote the gem today, however it has potential to be a convenient tool for anyone wanting to generate their own vCard.

update: 04-Nov-2014 @ 21:02

The gem can now handle a single URL or multiple URLs:

e.g.

require 'simplevpim'

s = '
# vcard

name: James Robertson
email:
  home: james@jamesrobertson.eu
  work: jrobertsonfunjob@gmail.com
url:  http://www.jamesrobertson.eu/
'

card = SimpleVpim.new(s).to_vcard
puts card
BEGIN:VCARD
VERSION:3.0
N:Robertson;James;;;
FN:James Robertson
EMAIL;TYPE=work:jrobertsonfunjob@gmail.com
EMAIL;TYPE=home:james@jamesrobertson.eu
URL:http://www.jamesrobertson.eu/
END:VCARD
require 'simplevpim'

s = '
# vcard

name: James Robertson
email:
  home: james@jamesrobertson.eu
  work: jrobertsonfunjob@gmail.com
url:
  http://www.jamesrobertson.eu/
  https://github.com/jrobertson/
'

card = SimpleVpim.new(s).to_vcard
puts card
BEGIN:VCARD
VERSION:3.0
N:Robertson;James;;;
FN:James Robertson
EMAIL;TYPE=work:jrobertsonfunjob@gmail.com
EMAIL;TYPE=home:james@jamesrobertson.eu
URL:http://www.jamesrobertson.eu/
URL:https://github.com/jrobertson/
END:VCARD

Resources

simplevpim gem vpim vcard