fraser-vpim-rails 0.658

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (61) hide show
  1. data/CHANGES +504 -0
  2. data/COPYING +58 -0
  3. data/README +182 -0
  4. data/lib/atom.rb +728 -0
  5. data/lib/plist.rb +22 -0
  6. data/lib/vpim/address.rb +219 -0
  7. data/lib/vpim/attachment.rb +102 -0
  8. data/lib/vpim/date.rb +222 -0
  9. data/lib/vpim/dirinfo.rb +277 -0
  10. data/lib/vpim/duration.rb +119 -0
  11. data/lib/vpim/enumerator.rb +32 -0
  12. data/lib/vpim/field.rb +614 -0
  13. data/lib/vpim/icalendar.rb +381 -0
  14. data/lib/vpim/maker/vcard.rb +16 -0
  15. data/lib/vpim/property/base.rb +193 -0
  16. data/lib/vpim/property/common.rb +315 -0
  17. data/lib/vpim/property/location.rb +38 -0
  18. data/lib/vpim/property/priority.rb +43 -0
  19. data/lib/vpim/property/recurrence.rb +69 -0
  20. data/lib/vpim/property/resources.rb +24 -0
  21. data/lib/vpim/repo.rb +181 -0
  22. data/lib/vpim/rfc2425.rb +367 -0
  23. data/lib/vpim/rrule.rb +589 -0
  24. data/lib/vpim/time.rb +40 -0
  25. data/lib/vpim/vcard.rb +1429 -0
  26. data/lib/vpim/version.rb +18 -0
  27. data/lib/vpim/vevent.rb +187 -0
  28. data/lib/vpim/view.rb +90 -0
  29. data/lib/vpim/vjournal.rb +58 -0
  30. data/lib/vpim/vpim.rb +65 -0
  31. data/lib/vpim/vtodo.rb +103 -0
  32. data/lib/vpim.rb +13 -0
  33. data/samples/README.mutt +93 -0
  34. data/samples/ab-query.rb +57 -0
  35. data/samples/cmd-itip.rb +156 -0
  36. data/samples/ex_cpvcard.rb +55 -0
  37. data/samples/ex_get_vcard_photo.rb +22 -0
  38. data/samples/ex_mkv21vcard.rb +34 -0
  39. data/samples/ex_mkvcard.rb +64 -0
  40. data/samples/ex_mkyourown.rb +29 -0
  41. data/samples/ics-dump.rb +210 -0
  42. data/samples/ics-to-rss.rb +84 -0
  43. data/samples/mutt-aliases-to-vcf.rb +45 -0
  44. data/samples/osx-wrappers.rb +86 -0
  45. data/samples/reminder.rb +203 -0
  46. data/samples/rrule.rb +71 -0
  47. data/samples/tabbed-file-to-vcf.rb +390 -0
  48. data/samples/vcf-dump.rb +86 -0
  49. data/samples/vcf-lines.rb +61 -0
  50. data/samples/vcf-to-ics.rb +22 -0
  51. data/samples/vcf-to-mutt.rb +121 -0
  52. data/test/test_all.rb +17 -0
  53. data/test/test_date.rb +120 -0
  54. data/test/test_dur.rb +41 -0
  55. data/test/test_field.rb +156 -0
  56. data/test/test_ical.rb +415 -0
  57. data/test/test_repo.rb +158 -0
  58. data/test/test_rrule.rb +1030 -0
  59. data/test/test_vcard.rb +973 -0
  60. data/test/test_view.rb +79 -0
  61. metadata +129 -0
data/README ADDED
@@ -0,0 +1,182 @@
1
+ Author:: Sam Roberts <vieuxtech@gmail.com>
2
+ Copyright:: Copyright (C) 2008 Sam Roberts
3
+ License:: May be distributed under the same terms as Ruby
4
+ Homepage:: http://vpim.rubyforge.org
5
+ Download:: http://rubyforge.org/projects/vpim
6
+ Install:: sudo gem install vpim
7
+
8
+ vPim provides calendaring, scheduling, and contact support for Ruby through the
9
+ standard iCalendar and vCard data formats for "personal information" exchange.
10
+
11
+ = Thanks
12
+
13
+ - http://ZipDX.com: for sponsoring development of FREQ=weekly and BYSETPOS in
14
+ recurrence rules.
15
+ - http://RubyForge.org: for their generous hosting of this project.
16
+
17
+ = Installation
18
+
19
+ There is a vPim package installable using ruby-gems:
20
+
21
+ # sudo gem install vpim (may require root privilege)
22
+
23
+ It is also installable in the standard way. Untar the package, and do:
24
+
25
+ $ ruby setup.rb --help
26
+
27
+ or do:
28
+
29
+ $ ruby setup.rb config
30
+ $ ruby setup.rb setup
31
+ # ruby setup.rb install (may require root privilege)
32
+
33
+ = Overview
34
+
35
+ vCard (RFC 2426) is a format for personal information, see Vpim::Vcard and
36
+ Vpim::Maker::Vcard.
37
+
38
+ iCalendar (RFC 2445) is a format for calendar related information, see
39
+ Vpim::Icalendar.
40
+
41
+ vCard and iCalendar support is built on top of an implementation of the MIME
42
+ Content-Type for Directory Information (RFC 2425). The basic RFC 2425 format is
43
+ implemented by Vpim::DirectoryInfo and Vpim::DirectoryInfo::Field.
44
+
45
+ The libary is quite useful, but improvements are ongoing. If you find
46
+ something missing or have suggestions, please contact me. I can't promise
47
+ instantaneous turnaround, but I might be able to suggest another approach, and
48
+ features requested by users of vPim go to the top of the todo list. If you need
49
+ a feature for a commercial project, consider sponsoring development.
50
+
51
+ = Examples
52
+
53
+ Here's an example to give a sense for how iCalendars are encoded and decoded:
54
+
55
+ require 'vpim/icalendar'
56
+
57
+ cal = Vpim::Icalendar.create2
58
+
59
+ cal.add_event do |e|
60
+ e.dtstart Date.new(2005, 04, 28)
61
+ e.dtend Date.new(2005, 04, 29)
62
+ e.summary "Monthly meet-the-CEO day"
63
+ e.description <<'---'
64
+ Unlike last one, this meeting will change your life because
65
+ we are going to discuss your likely demotion if your work isn't
66
+ done soon.
67
+ ---
68
+ e.categories [ 'APPOINTMENT' ]
69
+ e.categories do |c| c.push 'EDUCATION' end
70
+ e.url 'http://www.example.com'
71
+ e.sequence 0
72
+ e.access_class "PRIVATE"
73
+ e.transparency 'OPAQUE'
74
+
75
+ now = Time.now
76
+ e.created now
77
+ e.lastmod now
78
+
79
+
80
+ e.organizer do |o|
81
+ o.cn = "Example Organizer, Mr."
82
+ o.uri = "mailto:organizer@example.com"
83
+ end
84
+
85
+ attendee = Vpim::Icalendar::Address.create("mailto:attendee@example.com")
86
+ attendee.rsvp = true
87
+ e.add_attendee attendee
88
+ end
89
+
90
+ icsfile = cal.encode
91
+
92
+ puts '--- Encode:'
93
+
94
+ puts icsfile
95
+
96
+ puts '--- Decode:'
97
+
98
+ cal = Vpim::Icalendar.decode(icsfile).first
99
+
100
+ cal.components do |e|
101
+ puts e.summary
102
+ puts e.description
103
+ puts e.dtstart.to_s
104
+ puts e.dtend.to_s
105
+ end
106
+
107
+ This produces:
108
+
109
+ --- Encode:
110
+ BEGIN:VCALENDAR
111
+ VERSION:2.0
112
+ PRODID:-//Ensemble Independent//vPim 0.357//EN
113
+ CALSCALE:Gregorian
114
+ BEGIN:VEVENT
115
+ DTSTART;VALUE=DATE:20050428
116
+ DTEND;VALUE=DATE:20050429
117
+ SUMMARY:Monthly meet-the-CEO day
118
+ DESCRIPTION:Unlike last one, this meeting will change your life because\nwe
119
+ are going to discuss your likely demotion if your work isn't\ndone soon.\n
120
+ CATEGORIES:APPOINTMENT,EDUCATION
121
+ URL:http://www.example.com
122
+ SEQUENCE:0
123
+ CLASS:PRIVATE
124
+ CREATED:20060402T231755
125
+ LAST-MODIFIED:20060402T231755
126
+ ORGANIZER;CN="Example Organizer, Mr.":mailto:organizer@example.com
127
+ ATTENDEE;RSVP=true:mailto:attendee@example.com
128
+ END:VEVENT
129
+ END:VCALENDAR
130
+ --- Decode:
131
+ Monthly meet-the-CEO day
132
+ Unlike last one, this meeting will change your life because
133
+ we are going to discuss your likely demotion if your work isn't
134
+ done soon.
135
+ Thu Apr 28 00:00:00 UTC 2005
136
+ Fri Apr 29 00:00:00 UTC 2005
137
+
138
+
139
+ More examples of using vPim are provided in samples/.
140
+
141
+ vCard examples are:
142
+ - link:ex_mkvcard.txt: example of creating a vCard
143
+ - link:ex_cpvcard.txt: example of copying and them modifying a vCard
144
+ - link:ex_mkv21vcard.txt: example of creating version 2.1 vCard
145
+ - link:mutt-aliases-to-vcf.txt: convert a mutt aliases file to vCards
146
+ - link:ex_get_vcard_photo.txt: pull photo data from a vCard
147
+ - link:ab-query.txt: query the OS X Address Book to find vCards
148
+ - link:vcf-to-mutt.txt: query vCards for matches, output in formats useful
149
+ with Mutt (see link:README.mutt for details)
150
+ - link:tabbed-file-to-vcf.txt: convert a tab-delimited file to vCards, a
151
+ (small but) complete application contributed by Dane G. Avilla, thanks!
152
+ - link:vcf-to-ics.txt: example of how to create calendars of birthdays from vCards
153
+ - link:vcf-dump.txt: utility for dumping contents of .vcf files
154
+
155
+ iCalendar examples are:
156
+ - link:ics-to-rss.txt: prints todos as RSS, or starts a WEBrick servlet
157
+ that publishes todos as a RSS feed. Thanks to Dave Thomas for this idea,
158
+ from http://pragprog.com/pragdave/Tech/Blog/ToDos.rdoc.
159
+ - link:cmd-itip.txt: prints emailed iCalendar invitations in human-readable
160
+ form, and see link:README.mutt for instruction on mutt integration. I get
161
+ a lot of meeting invitations from Lotus Notes/Domino users at work, and
162
+ this is pretty useful in figuring out where and when I am supposed to be.
163
+ - link:reminder.txt: prints upcoming events and todos, by default from
164
+ Apple's iCal calendars
165
+ - link:rrule.txt: utility for printing recurrence rules
166
+ - link:ics-dump.txt: utility for dumping contents of .ics files
167
+
168
+ = Project Information
169
+
170
+ vPim can be downloaded from the Ruby Forge project page:
171
+
172
+ - http://rubyforge.org/projects/vpim
173
+
174
+ or installed as a gem:
175
+
176
+ - sudo gem install vpim
177
+
178
+ For notifications about new releases, or to ask questions about vPim, please
179
+ subscribe to "vpim-talk":
180
+
181
+ - http://rubyforge.org/mailman/listinfo/vpim-talk
182
+