simplevpim 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 9362acdf2acbd5c07c1fb4975e0a333ff68a1d5e
4
+ data.tar.gz: 2814abb6790accdcad97bdf2178dce485a93a971
5
+ SHA512:
6
+ metadata.gz: e274e2eabb052859aa77b210a6a2295bee0d7a50d051b1b1d03bddcf7b30cef08d7ec9cd2d788606b63af7f9097d2fde830a1e03ce752b1afd8933b2bacdf667
7
+ data.tar.gz: 88638f35b42c26c49f7fd50ef91c1c6e94652f199cec4b07495f0ce0fc6fc80e370942eb80a80de1fab38fafa418ca2febb1758c3cf841cc82ad47cd8bb1be59
checksums.yaml.gz.sig ADDED
Binary file
data/lib/simplevpim.rb ADDED
@@ -0,0 +1,65 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ # file: simplevpim.rb
4
+
5
+ require 'vpim/vcard'
6
+ require 'simple-config'
7
+
8
+
9
+ class SimpleVpim
10
+
11
+ attr_reader :to_vcard
12
+
13
+ def initialize(s)
14
+
15
+ h = SimpleConfig.new(s).to_h
16
+
17
+ if h[:name] then
18
+ @to_vcard = make_vcard h
19
+ end
20
+
21
+ end
22
+
23
+ private
24
+
25
+ def make_vcard(h)
26
+
27
+ prefix = h[:prefix]
28
+ suffix = h[:suffix]
29
+ a = h[:name].split
30
+
31
+ if a.length == 2 then
32
+ firstname, lastname = a
33
+ elsif a[0][/^Mrs?|Ms|Miss|Dr/] then
34
+
35
+ prefix = a.shift
36
+
37
+ if a.length == 2 then
38
+ firstname, lastname = a
39
+ else
40
+ firstname, middlename, lastname = a
41
+ fullname = a.join ' '
42
+ end
43
+ else
44
+ firstname, middlename, lastname = a
45
+ fullname = a.join ' '
46
+ end
47
+
48
+ card = Vpim::Vcard::Maker.make2 do |maker|
49
+ maker.add_name do |name|
50
+ name.prefix = prefix if prefix
51
+ name.given = firstname
52
+ name.family = lastname
53
+ name.suffix = suffix if suffix
54
+ name.fullname = fullname if fullname
55
+ end
56
+
57
+ e = h[:email]
58
+ eh = h[:email][:home]
59
+ ew = h[:email][:work]
60
+ maker.add_email(ew) { |e| e.location = 'work' } if ew
61
+ maker.add_email(eh) { |e| e.location = 'home' } if eh
62
+ end
63
+ end
64
+
65
+ end
data.tar.gz.sig ADDED
@@ -0,0 +1,3 @@
1
+ �ֈ�[��.[�,�%G�� :)0�}oI��Q�w9����(� �����&��_|&��F��g��;;��_�����I"���Gx<42n�Z�
2
+ �>�ɏ��H��w����~(
3
+ ;�(��CnM��at�j����Q��:@�!|�fQ��ə��!�K~��w���x�)v����Ჸ^�k�i��%�:��y�g�}�C��JMl&T��#�$�UN��O/�TQ�h�`|o��ު�9��Ǚ�
metadata ADDED
@@ -0,0 +1,107 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: simplevpim
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.1
5
+ platform: ruby
6
+ authors:
7
+ - James Robertson
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain:
11
+ - |
12
+ -----BEGIN CERTIFICATE-----
13
+ MIIDljCCAn6gAwIBAgIBATANBgkqhkiG9w0BAQUFADBIMRIwEAYDVQQDDAlnZW1t
14
+ YXN0ZXIxHjAcBgoJkiaJk/IsZAEZFg5qYW1lc3JvYmVydHNvbjESMBAGCgmSJomT
15
+ 8ixkARkWAmV1MB4XDTE0MTEwNDE4MDQxNVoXDTE1MTEwNDE4MDQxNVowSDESMBAG
16
+ A1UEAwwJZ2VtbWFzdGVyMR4wHAYKCZImiZPyLGQBGRYOamFtZXNyb2JlcnRzb24x
17
+ EjAQBgoJkiaJk/IsZAEZFgJldTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoC
18
+ ggEBAOIxezQlow3Mc2hiMUYKNfXS0aeuDaDshlHayqGprhcjcC26JheR6fw5LC5q
19
+ O2cLSN2X4/y1Ejpl3rDCaEQ2uTM+0oQdlEdOZaMDiPAYmkNHOursxMQ/ztylpgmZ
20
+ hKYDn5NYhlh/HDAWgE4OJCsyTxR8/tUMQ2JsTNbh7iq2T2e9ruZK6+WO1uBxV299
21
+ W9XJYLNQ+TNX1UyTlISTPz46ZHrW0jlBU5Jhkq+4qrvkHl0+CouJ8z+gHjZi1Zph
22
+ mTWY3O4z5C/T9+7+8TdfRVIphUHrdbSaT4Q38uyGN3c4XTgd5gNDTjNVvTzHze4e
23
+ dnNRUQeBAplZ0eNzi1Y0tlJNL78CAwEAAaOBijCBhzAJBgNVHRMEAjAAMAsGA1Ud
24
+ DwQEAwIEsDAdBgNVHQ4EFgQUtPSjl4Y/eGVgqBWQtt7eRXrUWUowJgYDVR0RBB8w
25
+ HYEbZ2VtbWFzdGVyQGphbWVzcm9iZXJ0c29uLmV1MCYGA1UdEgQfMB2BG2dlbW1h
26
+ c3RlckBqYW1lc3JvYmVydHNvbi5ldTANBgkqhkiG9w0BAQUFAAOCAQEAqTJgPKUN
27
+ e9qRhikLsNIlI6KKbawhXeXCKUidNfPUC+ixm/jB5KZmC+jMCG4E6yhcbeHGLGAg
28
+ D/nL4AYOQBiQAwhg6OZsScmz0mWAgU+T7/zgWpqlKPS0zAFCd6xaz2dAruQ7HeSb
29
+ MHzJFvp/uiOm+4+zJmeaLfxC+XIqV2EzaY7IlNk3VO/eviBf5m0yymLXduGpc3O9
30
+ H0WHqa7sI+WFHROziaQIz7hhd7qhJVuaTdqLb2NIcrz8jbvpFEeaBJWQB8P+1z+K
31
+ h7sjjIWKCtgcFF+5Gf5AtJf6C0PlDSh7mc8uoo2XSef/GV6YvwUrQbPtFakM7LDs
32
+ a3f37q6Z/UCE6w==
33
+ -----END CERTIFICATE-----
34
+ date: 2014-11-04 00:00:00.000000000 Z
35
+ dependencies:
36
+ - !ruby/object:Gem::Dependency
37
+ name: line-tree
38
+ requirement: !ruby/object:Gem::Requirement
39
+ requirements:
40
+ - - "~>"
41
+ - !ruby/object:Gem::Version
42
+ version: '0.1'
43
+ - - ">="
44
+ - !ruby/object:Gem::Version
45
+ version: 0.1.7
46
+ type: :runtime
47
+ prerelease: false
48
+ version_requirements: !ruby/object:Gem::Requirement
49
+ requirements:
50
+ - - "~>"
51
+ - !ruby/object:Gem::Version
52
+ version: '0.1'
53
+ - - ">="
54
+ - !ruby/object:Gem::Version
55
+ version: 0.1.7
56
+ - !ruby/object:Gem::Dependency
57
+ name: vpim
58
+ requirement: !ruby/object:Gem::Requirement
59
+ requirements:
60
+ - - "~>"
61
+ - !ruby/object:Gem::Version
62
+ version: '13.11'
63
+ - - ">="
64
+ - !ruby/object:Gem::Version
65
+ version: 13.11.11
66
+ type: :runtime
67
+ prerelease: false
68
+ version_requirements: !ruby/object:Gem::Requirement
69
+ requirements:
70
+ - - "~>"
71
+ - !ruby/object:Gem::Version
72
+ version: '13.11'
73
+ - - ">="
74
+ - !ruby/object:Gem::Version
75
+ version: 13.11.11
76
+ description:
77
+ email: james@r0bertson.co.uk
78
+ executables: []
79
+ extensions: []
80
+ extra_rdoc_files: []
81
+ files:
82
+ - lib/simplevpim.rb
83
+ homepage: https://github.com/jrobertson/simplevpim
84
+ licenses:
85
+ - MIT
86
+ metadata: {}
87
+ post_install_message:
88
+ rdoc_options: []
89
+ require_paths:
90
+ - lib
91
+ required_ruby_version: !ruby/object:Gem::Requirement
92
+ requirements:
93
+ - - ">="
94
+ - !ruby/object:Gem::Version
95
+ version: '0'
96
+ required_rubygems_version: !ruby/object:Gem::Requirement
97
+ requirements:
98
+ - - ">="
99
+ - !ruby/object:Gem::Version
100
+ version: '0'
101
+ requirements: []
102
+ rubyforge_project:
103
+ rubygems_version: 2.2.2
104
+ signing_key:
105
+ specification_version: 4
106
+ summary: A simple wrapper for the vPim gem
107
+ test_files: []
metadata.gz.sig ADDED
@@ -0,0 +1,3 @@
1
+ ��� L�J�%
2
+ �_��?����Me-� �$&}��-��8B^�O�d�(�P\nX]��ŀ/jHI�E}�F�tM�>�ʉ��=5�����0��w9w�L���;��̀|D �����>av���'�� ���]�������Փ��z=q܄��w�� ^���O6�-ȓ��z��F�l�۫
3
+ �\D�I/�