-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
20 changed files
with
447 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,38 +1,63 @@ | ||
require "vobject/property" | ||
require "vobject/parameter" | ||
require "pp" | ||
|
||
module Vcard::V4_0 | ||
class Property < Vobject::Property | ||
end | ||
|
||
def parameter_base_class | ||
version_class.const_get(:Parameter) | ||
end | ||
=begin | ||
def parameter_base_class | ||
version_class.const_get(:Parameter) | ||
end | ||
=end | ||
|
||
def property_base_class | ||
version_class.const_get(:Property) | ||
end | ||
def property_base_class | ||
version_class.const_get(:Property) | ||
end | ||
|
||
=begin | ||
def to_norm | ||
puts "XXX" | ||
if norm.nil? | ||
if multiple.nil? || multiple.empty? | ||
ret = to_norm_line | ||
else | ||
arr = [] | ||
multiple.sort.each do |x| | ||
arr << x.to_norm_line | ||
end | ||
ret = arr.join("") | ||
end | ||
norm = ret | ||
end | ||
norm | ||
end | ||
=end | ||
|
||
def to_norm_line | ||
line = group ? "#{group}." : "" | ||
line << name.to_s.tr("_", "-").upcase | ||
def to_norm_line | ||
line = group ? "#{group}." : "" | ||
line << name.to_s.tr("_", "-").upcase | ||
|
||
# add mandatory VALUE param | ||
outparams = params | ||
outparams[:VALUE] = value.type | ||
# add mandatory VALUE param | ||
outparams = params | ||
if outparams.nil? | ||
outparams = [] | ||
end | ||
outparams = outparams.select { |p| p.param_name != :VALUE } | ||
outparams << Vobject::Parameter.new(:VALUE, value.type) | ||
|
||
(outparams || {}).sort.each do |p| | ||
line << ";#{p.to_norm}" | ||
end | ||
(outparams || {}).sort.each do |p| | ||
line << ";#{p.to_norm}" | ||
end | ||
|
||
line << ":#{value.to_norm}" | ||
line << ":#{value.to_norm}" | ||
|
||
line = Vobject::fold_line(line) << "\n" | ||
line = Vobject::fold_line(line) << "\n" | ||
|
||
line | ||
end | ||
line | ||
end | ||
|
||
def version_class | ||
Vcard::V4_0 | ||
def version_class | ||
Vcard::V4_0 | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
BEGIN:VCARD | ||
VERSION;VALUE="text":4.0 | ||
FN;VALUE="text":Apple Inc. | ||
IMPP;TYPE="HOME","PREF";VALUE="uri";X-SERVICE-TYPE="AIM":aim:aimuser | ||
IMPP;TYPE="WORK";VALUE="uri";X-SERVICE-TYPE="AIM":aim:workaimuser | ||
item10.IMPP;VALUE="uri";X-SERVICE-TYPE="ICQ":aim:i%20seek%20you | ||
item11.IMPP;VALUE="uri";X-SERVICE-TYPE="QQ":x-apple:QQmoar | ||
item12.IMPP;VALUE="uri";X-SERVICE-TYPE="SKYPE":skype:skypie | ||
item13.IMPP;VALUE="uri";X-SERVICE-TYPE="MSN":msnim:msnisnomore | ||
item7.IMPP;VALUE="uri";X-SERVICE-TYPE="FACEBOOK":xmpp:facebookuser | ||
item8.IMPP;VALUE="uri";X-SERVICE-TYPE="GADUGADU":x-apple:gadugaduser | ||
item9.IMPP;VALUE="uri";X-SERVICE-TYPE="GOOGLETALK":xmpp:googleuser | ||
N;VALUE="text":Surnom;Nom;;; | ||
ORG;VALUE="text":Apple Inc.; | ||
PRODID;VALUE="text":-//Apple Inc.//Mac OS X 10.8.4//EN | ||
X-ABSHOWAS;VALUE="text":COMPANY | ||
X-ABUID;VALUE="text":904132B1-9C20-4D38-A1B9-32DE9A621DB8:ABPerson | ||
item10.X-ABLABEL;VALUE="text":other tag | ||
item11.X-ABLABEL;VALUE="text":other tag | ||
item12.X-ABLABEL;VALUE="text":other tag | ||
item13.X-ABLABEL;VALUE="text":other tag | ||
item7.X-ABLABEL;VALUE="text":other tag | ||
item8.X-ABLABEL;VALUE="text":_$!<Other>!$_ | ||
item9.X-ABLABEL;VALUE="text":other tag | ||
END:VCARD |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
BEGIN:VCARD | ||
VERSION;VALUE="text":4.0 | ||
ADR;TYPE="HOME";VALUE="text":;;42 Plantation St.;Baytown;LA;30314;United St | ||
ates of America | ||
ADR;TYPE="PREF","WORK";VALUE="text":;;100 Waters Edge;Baytown;LA;30314;Unit | ||
ed States of America | ||
EMAIL;VALUE="text":forrestgump@example.com | ||
FN;VALUE="text":Forrest Gump | ||
N;VALUE="text":Forrest;Gump;;Mr.; | ||
ORG;VALUE="text":Bubba Gump Shrimp Co. | ||
PHOTO;MEDIATYPE="image/gif";VALUE="uri":http://www.example.com/dir_photos/m | ||
y_photo.gif | ||
REV;VALUE="timestamp":20080424T195243Z | ||
TEL;TYPE="HOME","VOICE";VALUE="uri":tel:+1-404-555-1212 | ||
TEL;TYPE="VOICE","WORK";VALUE="uri":tel:+1-111-555-1212 | ||
TITLE;VALUE="text":Shrimp Man | ||
X-QQ;VALUE="text":21588891 | ||
END:VCARD |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
BEGIN:VCARD | ||
VERSION;VALUE="text":4.0 | ||
CLIENTPIDMAP;VALUE="text":1;urn:uuid:53e374d9-337e-4727-8803-a1e9c14e0556 | ||
CLIENTPIDMAP;VALUE="text":2;urn:uuid:1f762d2b-03c4-4a83-9a03-75ff658a6eee | ||
EMAIL;PID="1.1";VALUE="text":jdoe@example.com | ||
EMAIL;PID="2.1";VALUE="text":boss@example.com | ||
EMAIL;PID="2.2";VALUE="text":ceo@example.com | ||
FN;VALUE="text":J. Doe | ||
N;VALUE="text":Doe;J.;;; | ||
TEL;PID="1.1";VALUE="uri":tel:+1-555-555-5555 | ||
TEL;PID="2.1","2.2";VALUE="uri":tel:+1-666-666-6666 | ||
UID;VALUE="uri":urn:uuid:4fbe8971-0bc3-424c-9c26-36c3e1eff6b1 | ||
END:VCARD |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
BEGIN:VCARD | ||
VERSION;VALUE="text":4.0 | ||
FN;VALUE="text":Testing Vcard | ||
END:VCARD |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,96 @@ | ||
BEGIN:VCARD | ||
VERSION;VALUE="text":4.0 | ||
ADR;TYPE="CUSTOMTYPE";VALUE="text":;CustomExtended;CustomStreet;CustomCity; | ||
CustomState;CustomPostal;CustomCountry | ||
ADR;TYPE="HOME";VALUE="text":;HomeExtended;HomeStreet;HomeCity;HomeState;Ho | ||
mePostal;HomeCountry | ||
ADR;TYPE="OTHER";VALUE="text":;OtherExtended;OtherStreet;OtherCity;OtherSta | ||
te;OtherPostal;OtherCountry | ||
ADR;TYPE="WORK";VALUE="text":;WorkExtended;WorkStreet;WorkCity;WorkState;Wo | ||
rkPostal;WorkCountry | ||
BDAY;ALTID="1";VALUE="date-and-or-time":20160801 | ||
BDAY;ALTID="1";VALUE="text":2016-08-01 | ||
CATEGORIES;VALUE="text":Tag | ||
EMAIL;TYPE="CUSTOMTYPE";VALUE="text":custom@example.com | ||
EMAIL;TYPE="HOME";VALUE="text":home@example.com | ||
EMAIL;TYPE="OTHER";VALUE="text":other@example.com | ||
EMAIL;TYPE="SCHOOL";VALUE="text":school@example.com | ||
EMAIL;TYPE="WORK";VALUE="text":work@example.com | ||
FN;VALUE="text":Prefix FirstName MiddleName LastName Suffix | ||
GENDER;VALUE="text":M | ||
IMPP;VALUE="uri";X-SERVICE-TYPE="AIM":aim:aim | ||
IMPP;VALUE="uri";X-SERVICE-TYPE="CUSTOMTYPE":customtype:custom | ||
IMPP;VALUE="uri";X-SERVICE-TYPE="GTALK":xmpp:gtalk | ||
IMPP;VALUE="uri";X-SERVICE-TYPE="JABBER":xmpp:jabber | ||
IMPP;VALUE="uri";X-SERVICE-TYPE="OTHER":other:other | ||
IMPP;VALUE="uri";X-SERVICE-TYPE="SKYPE":skype:skype | ||
IMPP;VALUE="uri";X-SERVICE-TYPE="YAHOO":ymsgr:yahoo | ||
N;VALUE="text":LastName;FirstName;MiddleName;Prefix;Suffix | ||
NICKNAME;VALUE="text":NickName | ||
NOTE;VALUE="text":Notes line 1\nNotes line 2 | ||
ORG;VALUE="text":Organization1;Department1 | ||
ORG;VALUE="text":Organization2;Department2 | ||
PHOTO;VALUE="uri":https://d2ojpxxtu63wzl.cloudfront.net/static/aa915d1f29f1 | ||
9baf560e5491decdd30a_67c95da9133249fde8b0da7ceebc298bf680117e6f52054f7f5f7 | ||
a95e8377238 | ||
PHOTO;VALUE="uri":https://d3m0kzytmr41b1.cloudfront.net/c335e945d1b60edd9d7 | ||
5eb4837c432f637e95c8a | ||
PHOTO;VALUE="uri":https://d3m0kzytmr41b1.cloudfront.net/c335e945d1b60edd9d7 | ||
5eb4837c432f637e95c8a | ||
PRODID;VALUE="text":ez-vcard 0.9.14-fc | ||
TEL;TYPE="CELL","VOICE";VALUE="text":555-555-1113 | ||
TEL;TYPE="CELL","VOICE";VALUE="text":555-555-1114 | ||
TEL;TYPE="FAX","HOME";VALUE="text":555-555-1116 | ||
TEL;TYPE="FAX","WORK";VALUE="text":555-555-1117 | ||
TEL;TYPE="HOME","VOICE";VALUE="text":555-555-1111 | ||
TEL;TYPE="VOICE","WORK";VALUE="text":555-555-1112 | ||
TEL;TYPE="VOICE";VALUE="text":555-555-1115 | ||
TEL;TYPE="VOICE";VALUE="text":555-555-1118 | ||
TEL;TYPE="VOICE";VALUE="text":555-555-1119 | ||
TITLE;VALUE="text":Title1 | ||
TITLE;VALUE="text":Title2 | ||
URL;VALUE="uri":http://www.blog.com | ||
URL;VALUE="uri":http://www.custom.com | ||
URL;VALUE="uri":http://www.homepage.com | ||
URL;VALUE="uri":http://www.other.com | ||
X-ETAG;VALUE="text":fffffea9056d8166e2b7a427977e570c87dd51279d11d9b137c593e | ||
b | ||
X-FC-LIST-ID;VALUE="text":8ad23200aa3e1984736b11e688dc0add41994b95 | ||
X-FC-TAGS;VALUE="text":579c773f-736d-11e6-8dff-0ac8448704fb | ||
X-FCENCODED-582D46432D4F7468657244617465733A416E6E6976657273617279;VALUE="t | ||
ext":2016-08-02 | ||
X-FCENCODED-582D46432D4F7468657244617465733A437573746F6D54595045;VALUE="tex | ||
t":2016-08-04 | ||
X-FCENCODED-582D46432D4F7468657244617465733A4F74686572;VALUE="text":2016-08 | ||
-03 | ||
X-FCENCODED-582D46432D52656C617465644E616D65733A417373697374616E74;VALUE="t | ||
ext":Assistant | ||
X-FCENCODED-582D46432D52656C617465644E616D65733A42726F74686572;VALUE="text" | ||
:Brother | ||
X-FCENCODED-582D46432D52656C617465644E616D65733A4368696C64;VALUE="text":Chi | ||
ld | ||
X-FCENCODED-582D46432D52656C617465644E616D65733A437573746F6D54595045;VALUE= | ||
"text":Custom | ||
X-FCENCODED-582D46432D52656C617465644E616D65733A466174686572;VALUE="text":F | ||
ather | ||
X-FCENCODED-582D46432D52656C617465644E616D65733A4669616E63C3A9;VALUE="text" | ||
:Fiance | ||
X-FCENCODED-582D46432D52656C617465644E616D65733A467269656E64;VALUE="text":F | ||
riend | ||
X-FCENCODED-582D46432D52656C617465644E616D65733A4D616E61676572;VALUE="text" | ||
:Manager | ||
X-FCENCODED-582D46432D52656C617465644E616D65733A4D6F74686572;VALUE="text":M | ||
other | ||
X-FCENCODED-582D46432D52656C617465644E616D65733A4F74686572;VALUE="text":Oth | ||
er | ||
X-FCENCODED-582D46432D52656C617465644E616D65733A506172656E74;VALUE="text":P | ||
arent | ||
X-FCENCODED-582D46432D52656C617465644E616D65733A506172746E6572;VALUE="text" | ||
:Partner | ||
X-FCENCODED-582D46432D52656C617465644E616D65733A536973746572;VALUE="text":S | ||
ister | ||
X-FCENCODED-582D46432D52656C617465644E616D65733A53706F757365;VALUE="text":S | ||
pouse | ||
X-GENDER;VALUE="text":male | ||
X-ID;VALUE="text":14f9aba0c9422da9ae376fe28bd89c2a.0 | ||
END:VCARD |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
BEGIN:VCARD | ||
VERSION;VALUE="text":4.0 | ||
EMAIL;VALUE="text":xmpp@jabber.org | ||
FN;VALUE="text":jabber.org IM service | ||
GEO;VALUE="uri":geo:42.25\,-91.05 | ||
IMPP;VALUE="uri":xmpp:jabber.org | ||
KIND;VALUE="text":application | ||
LANG;PREF="1";VALUE="language-tag":en | ||
LOGO;VALUE="uri":http://www.jabber.org/images/logo.png | ||
REV;VALUE="timestamp":19990104T122100Z | ||
SOURCE;VALUE="uri":xmpp:jabber.org?vcard | ||
TZ;VALUE="text":America/Chicago | ||
URL;VALUE="uri":http://www.jabber.org/ | ||
END:VCARD |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
BEGIN:VCARD | ||
VERSION;VALUE="text":4.0 | ||
BIRTHPLACE;VALUE="text":Babies'R'Us Hospital | ||
DEATHDATE;VALUE="date-and-or-time":--0415 | ||
DEATHPLACE;VALUE="text":Aboard the Titanic\, near Newfoundland | ||
FN;VALUE="text":Simon Perreault | ||
N;VALUE="text":Perreault;Simon;;;ing. jr,M.Sc. | ||
END:VCARD |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
BEGIN:VCARD | ||
VERSION;VALUE="text":4.0 | ||
BIRTHPLACE;VALUE="uri":http://example.com/hospitals/babiesrus.vcf | ||
DEATHDATE;VALUE="date-and-or-time":19531015T231000Z | ||
DEATHPLACE;VALUE="uri":http://example.com/ships/titanic.vcf | ||
FN;VALUE="text":Simon Perreault | ||
N;VALUE="text":Perreault;Simon;;;ing. jr,M.Sc. | ||
END:VCARD |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
BEGIN:VCARD | ||
VERSION;VALUE="text":4.0 | ||
BIRTHPLACE;VALUE="uri":geo:46.769307\,-71.283079 | ||
DEATHDATE;VALUE="text":circa 1800 | ||
DEATHPLACE;VALUE="uri":geo:41.731944\,-49.945833 | ||
FN;VALUE="text":Simon Perreault | ||
N;VALUE="text":Perreault;Simon;;;ing. jr,M.Sc. | ||
END:VCARD |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
BEGIN:VCARD | ||
VERSION;VALUE="text":4.0 | ||
EXPERTISE;INDEX="1";LEVEL="EXPERT";VALUE="text":chemistry | ||
EXPERTISE;INDEX="2";LEVEL="BEGINNER";VALUE="text":chinese literature | ||
FN;VALUE="text":Simon Perreault | ||
HOBBY;INDEX="1";LEVEL="HIGH";VALUE="text":reading | ||
HOBBY;INDEX="2";LEVEL="HIGH";VALUE="text":sewing | ||
INTEREST;INDEX="1";LEVEL="MEDIUM";VALUE="text":r&b music | ||
INTEREST;INDEX="2";LEVEL="HIGH";VALUE="text":rock 'n' roll music | ||
N;VALUE="text":Perreault;Simon;;;ing. jr,M.Sc. | ||
ORG-DIRECTORY;INDEX="1";VALUE="uri":http://directory.mycompany.example.com | ||
ORG-DIRECTORY;PREF="1";VALUE="uri":ldap://ldap.tech.example/o=Example%20Tec | ||
h,ou=Engineering | ||
END:VCARD |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
BEGIN:VCARD | ||
VERSION;VALUE="text":4.0 | ||
ADR;PREF="1";TYPE="HOME";VALUE="text":;;1 Trafalgar Square;London;;WC2N;Uni | ||
ted Kingdom | ||
EMAIL;PREF="1";TYPE="HOME";VALUE="text":me@joebloggs.com | ||
FN;VALUE="text":Joe Bloggs | ||
IMPP;PREF="1";TYPE="HOME";VALUE="uri":skype:joe.bloggs | ||
N;VALUE="text":Bloggs;Joe;;; | ||
TEL;PREF="1";TYPE="CELL","HOME";VALUE="text":tel:+44 20 1234 5678 | ||
URL;PREF="1";TYPE="HOME";VALUE="uri":http://joebloggs.com | ||
X-SOCIALPROFILE;PREF="1";TYPE="HOME";VALUE="text":twitter:https://twitter.c | ||
om/joebloggs | ||
END:VCARD |
Oops, something went wrong.