vpim 0.17 → 0.323
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/vpim/dirinfo.rb +11 -5
- data/lib/vpim/field.rb +26 -21
- data/lib/vpim/icalendar.rb +21 -105
- data/lib/vpim/maker/vcard.rb +31 -28
- data/lib/vpim/property/base.rb +63 -0
- data/lib/vpim/property/common.rb +159 -0
- data/lib/vpim/property/location.rb +29 -0
- data/lib/vpim/property/priority.rb +35 -0
- data/lib/vpim/property/resources.rb +16 -0
- data/lib/vpim/rfc2425.rb +21 -4
- data/lib/vpim/rrule.rb +1 -1
- data/lib/vpim/vcard.rb +5 -5
- data/lib/vpim/version.rb +16 -0
- data/lib/vpim/vevent.rb +54 -204
- data/lib/vpim/vpim.rb +10 -15
- data/lib/vpim.rb +14 -0
- metadata +9 -19
- data/lib/vpim/agent/plist.rb +0 -86
- data/lib/vpim/date.rb~ +0 -198
- data/lib/vpim/dirinfo.rb~ +0 -242
- data/lib/vpim/duration.rb~ +0 -121
- data/lib/vpim/enumerator.rb~ +0 -29
- data/lib/vpim/field.rb~ +0 -594
- data/lib/vpim/icalendar.rb~ +0 -548
- data/lib/vpim/maker/vcard.rb~ +0 -382
- data/lib/vpim/rfc2425.rb~ +0 -246
- data/lib/vpim/rrule.rb~ +0 -482
- data/lib/vpim/time.rb~ +0 -42
- data/lib/vpim/vcard.rb~ +0 -232
- data/lib/vpim/vevent.rb~ +0 -381
- data/lib/vpim/vpim.rb~ +0 -128
data/lib/vpim/vpim.rb~
DELETED
@@ -1,128 +0,0 @@
|
|
1
|
-
=begin
|
2
|
-
Copyright (C) 2006 Sam Roberts
|
3
|
-
|
4
|
-
This library is free software; you can redistribute it and/or modify it
|
5
|
-
under the same terms as the ruby language itself, see the file COPYING for
|
6
|
-
details.
|
7
|
-
=end
|
8
|
-
|
9
|
-
#:main:Vpim
|
10
|
-
#:title:vpim - a library to manipulate vCards and iCalendars
|
11
|
-
#
|
12
|
-
# Author:: Sam Roberts <sroberts@uniserve.com>
|
13
|
-
# Copyright:: Copyright (C) 2006 Sam Roberts
|
14
|
-
# License:: May be distributed under the same terms as Ruby
|
15
|
-
# Version:: 0.17
|
16
|
-
# Homepage:: http://vpim.rubyforge.org
|
17
|
-
#
|
18
|
-
# vCard (RFC 2426) is a format for personal information, see Vpim::Vcard and
|
19
|
-
# Vpim::Maker::Vcard.
|
20
|
-
#
|
21
|
-
# iCalendar (RFC 2445) is a format for calendar related information, see
|
22
|
-
# Vpim::Icalendar.
|
23
|
-
#
|
24
|
-
# iCalendar was called vCalendar pre-IETF standaradization, and since both of
|
25
|
-
# these "v-formats" are commonly used personal information management, the
|
26
|
-
# library is called "vpim".
|
27
|
-
#
|
28
|
-
# vCard and iCalendar support is built on top of an implementation of the MIME
|
29
|
-
# Content-Type for Directory Information (RFC 2425). The basic RFC 2425 format
|
30
|
-
# is implemented by Vpim::DirectoryInfo and Vpim::DirectoryInfo::Field.
|
31
|
-
#
|
32
|
-
# The libary is mature to the point of useability, but there is always more
|
33
|
-
# that could be done. I have a very long todo list, so if you think something
|
34
|
-
# is missing, or have API suggestions, please contact me. I can't promise
|
35
|
-
# instantaneous turnaround, but I might be able to suggest another approach,
|
36
|
-
# and features requested by users of vPim are high priority for me.
|
37
|
-
#
|
38
|
-
# = Project Information
|
39
|
-
#
|
40
|
-
# The latest release can be downloaded from the Ruby Forge project page:
|
41
|
-
#
|
42
|
-
# - http://rubyforge.org/projects/vpim
|
43
|
-
#
|
44
|
-
# For notifications about new releases, or asking questions about vPim, please
|
45
|
-
# subscribe to "vpim-talk":
|
46
|
-
#
|
47
|
-
# - http://rubyforge.org/mailman/listinfo/vpim-talk
|
48
|
-
#
|
49
|
-
# = Examples
|
50
|
-
#
|
51
|
-
# Sample utilities are provided as examples of using vPim in samples/.
|
52
|
-
#
|
53
|
-
# vCard examples are:
|
54
|
-
# - link:ex_mkvcard.txt: example of creating a vCard
|
55
|
-
# - link:ex_cpvcard.txt: example of copying and them modifying a vCard
|
56
|
-
# - link:ex_mkv21vcard.txt: example of creating version 2.1 vCard
|
57
|
-
# - link:mutt-aliases-to-vcf.txt: convert a mutt aliases file to vCards
|
58
|
-
# - link:ex_get_vcard_photo.txt: pull photo data from a vCard
|
59
|
-
# - link:ab-query.txt: query the OS X Address Book to find vCards
|
60
|
-
# - link:vcf-to-mutt.txt: query vCards for matches, output in formats useful
|
61
|
-
# with Mutt (see link:README.mutt for details)
|
62
|
-
# - link:tabbed-file-to-vcf.txt: convert a tab-delimited file to vCards, a
|
63
|
-
# (small but) complete application contributed by Dane G. Avilla, thanks!
|
64
|
-
# - link:vcf-to-ics.txt: example of how to create calendars of birthdays from vCards
|
65
|
-
# - link:vcf-dump.txt: utility for dumping contents of .vcf files
|
66
|
-
#
|
67
|
-
# iCalendar examples are:
|
68
|
-
# - link:ics-to-rss.txt: prints todos as RSS, or starts a WEBrick servlet
|
69
|
-
# that publishes todos as a RSS feed. Thanks to Dave Thomas for this idea,
|
70
|
-
# from http://pragprog.com/pragdave/Tech/Blog/ToDos.rdoc.
|
71
|
-
# - link:cmd-itip.txt: prints emailed iCalendar invitations in human-readable
|
72
|
-
# form, and see link:README.mutt for instruction on mutt integration. I get
|
73
|
-
# a lot of meeting invitations from Lotus Notes/Domino users at work, and
|
74
|
-
# this is pretty useful in figuring out where and when I am supposed to be.
|
75
|
-
# - link:reminder.txt: prints upcoming events and todos, by default from
|
76
|
-
# Apple's iCal calendars
|
77
|
-
# - link:rrule.txt: utility for printing recurrence rules
|
78
|
-
# - link:ics-dump.txt: utility for dumping contents of .ics files
|
79
|
-
module Vpim
|
80
|
-
VERSION = "0.17"
|
81
|
-
|
82
|
-
# Return the API version as a string.
|
83
|
-
def Vpim.version
|
84
|
-
VERSION
|
85
|
-
end
|
86
|
-
end
|
87
|
-
|
88
|
-
module Vpim
|
89
|
-
# Exception used to indicate that data being decoded is invalid, the message
|
90
|
-
# usually gives some clue as to exactly what is invalid.
|
91
|
-
class InvalidEncodingError < StandardError; end
|
92
|
-
end
|
93
|
-
|
94
|
-
module Vpim::Methods
|
95
|
-
module_function
|
96
|
-
|
97
|
-
# Case-insensitive comparison of +str0+ to +str1+, returns true or false.
|
98
|
-
# Either argument can be nil, where nil compares not equal to anything other
|
99
|
-
# than nil.
|
100
|
-
#
|
101
|
-
# This is available both as a module function:
|
102
|
-
# Vpim::Methods.casecmp?("yes", "YES")
|
103
|
-
# and an instance method:
|
104
|
-
# include Vpim::Methods
|
105
|
-
# casecmp?("yes", "YES")
|
106
|
-
#
|
107
|
-
# Will work with ruby1.6 and ruby 1.8.
|
108
|
-
#
|
109
|
-
# TODO - could make this be more efficient, but I'm supporting 1.6, not
|
110
|
-
# optimizing for it.
|
111
|
-
def casecmp?(str0, str1)
|
112
|
-
if str0 == nil
|
113
|
-
if str1 == nil
|
114
|
-
return true
|
115
|
-
else
|
116
|
-
return fasle
|
117
|
-
end
|
118
|
-
end
|
119
|
-
|
120
|
-
begin
|
121
|
-
str0.casecmp(str1) == 0
|
122
|
-
rescue NoMethodError
|
123
|
-
str0.downcase == str1.downcase
|
124
|
-
end
|
125
|
-
end
|
126
|
-
|
127
|
-
end
|
128
|
-
|