vpim 0.360 → 0.597

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.
data/lib/vpim.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  =begin
2
- Copyright (C) 2006 Sam Roberts
2
+ Copyright (C) 2008 Sam Roberts
3
3
 
4
4
  This library is free software; you can redistribute it and/or modify it
5
5
  under the same terms as the ruby language itself, see the file COPYING for
data/lib/vpim/address.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  =begin
2
- Copyright (C) 2006 Sam Roberts
2
+ Copyright (C) 2008 Sam Roberts
3
3
 
4
4
  This library is free software; you can redistribute it and/or modify it
5
5
  under the same terms as the ruby language itself, see the file COPYING for
@@ -1,5 +1,5 @@
1
1
  =begin
2
- Copyright (C) 2006 Sam Roberts
2
+ Copyright (C) 2008 Sam Roberts
3
3
 
4
4
  This library is free software; you can redistribute it and/or modify it
5
5
  under the same terms as the ruby language itself, see the file COPYING for
data/lib/vpim/date.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  =begin
2
- Copyright (C) 2006 Sam Roberts
2
+ Copyright (C) 2008 Sam Roberts
3
3
 
4
4
  This library is free software; you can redistribute it and/or modify it
5
5
  under the same terms as the ruby language itself, see the file COPYING for
@@ -77,8 +77,8 @@ class Date
77
77
  # - Date.bywday(2004, -2, 3, -2) => second last Wednesday in the second last month of 2004
78
78
  #
79
79
  # Compare this to Date.new, which allows a Date to be created by
80
- # day-of-the-month, mday, to Date.new2, which allows a Date to be created by
81
- # day-of-the-year, yday, and to Date.neww, which allows a Date to be created
80
+ # day-of-the-month, mday, to Date.ordinal, which allows a Date to be created by
81
+ # day-of-the-year, yday, and to Date.commercial, which allows a Date to be created
82
82
  # by day-of-the-week, but within a specific week.
83
83
  def Date.bywday(year, mon, wday, n = 1, sg=Date::ITALY)
84
84
  # Normalize mon to 1-12.
@@ -120,10 +120,36 @@ class Date
120
120
  end
121
121
  d
122
122
  end
123
+
124
+ # Return the first day of the week for the specified date. Commercial weeks
125
+ # start on Monday, but the weekstart can be specified (as 0-6, where 0 is
126
+ # sunday, or in formate of Date.str2day).
127
+ def Date.weekstart(year, mon, day, weekstart="MO")
128
+ wkst = Date.str2wday(weekstart)
129
+ d = Date.new(year, mon, day)
130
+ until d.wday == wkst
131
+ d = d - 1
132
+ end
133
+ d
134
+ end
123
135
  end
124
136
 
125
137
  # DateGen generates arrays of dates matching simple criteria.
126
138
  class DateGen
139
+
140
+ # Generate an array of a week's dates, where week is specified by year, mon,
141
+ # day, and the weekstart (the day-of-week that is considered the "first" day
142
+ # of that week, 0-6, where 0 is sunday).
143
+ def DateGen.weekofdate(year, mon, day, weekstart)
144
+ d = Date.weekstart(year, mon, day, weekstart)
145
+ week = []
146
+ 7.times do
147
+ week << d
148
+ d = d + 1
149
+ end
150
+ week
151
+ end
152
+
127
153
  # Generate an array of dates on +wday+ (the day-of-week,
128
154
  # 0-6, where 0 is Sunday).
129
155
  #
data/lib/vpim/dirinfo.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  =begin
2
- Copyright (C) 2006 Sam Roberts
2
+ Copyright (C) 2008 Sam Roberts
3
3
 
4
4
  This library is free software; you can redistribute it and/or modify it
5
5
  under the same terms as the ruby language itself, see the file COPYING for
data/lib/vpim/duration.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  =begin
2
- Copyright (C) 2006 Sam Roberts
2
+ Copyright (C) 2008 Sam Roberts
3
3
 
4
4
  This library is free software; you can redistribute it and/or modify it
5
5
  under the same terms as the ruby language itself, see the file COPYING for
@@ -1,5 +1,5 @@
1
1
  =begin
2
- Copyright (C) 2006 Sam Roberts
2
+ Copyright (C) 2008 Sam Roberts
3
3
 
4
4
  This library is free software; you can redistribute it and/or modify it
5
5
  under the same terms as the ruby language itself, see the file COPYING for
data/lib/vpim/field.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  =begin
2
- Copyright (C) 2006 Sam Roberts
2
+ Copyright (C) 2008 Sam Roberts
3
3
 
4
4
  This library is free software; you can redistribute it and/or modify it
5
5
  under the same terms as the ruby language itself, see the file COPYING for
@@ -1,5 +1,5 @@
1
1
  =begin
2
- Copyright (C) 2006 Sam Roberts
2
+ Copyright (C) 2008 Sam Roberts
3
3
 
4
4
  This library is free software; you can redistribute it and/or modify it
5
5
  under the same terms as the ruby language itself, see the file COPYING for
@@ -1,5 +1,5 @@
1
1
  =begin
2
- Copyright (C) 2006 Sam Roberts
2
+ Copyright (C) 2008 Sam Roberts
3
3
 
4
4
  This library is free software; you can redistribute it and/or modify it
5
5
  under the same terms as the ruby language itself, see the file COPYING for
@@ -1,5 +1,5 @@
1
1
  =begin
2
- Copyright (C) 2006 Sam Roberts
2
+ Copyright (C) 2008 Sam Roberts
3
3
 
4
4
  This library is free software; you can redistribute it and/or modify it
5
5
  under the same terms as the ruby language itself, see the file COPYING for
@@ -1,5 +1,5 @@
1
1
  =begin
2
- Copyright (C) 2006 Sam Roberts
2
+ Copyright (C) 2008 Sam Roberts
3
3
 
4
4
  This library is free software; you can redistribute it and/or modify it
5
5
  under the same terms as the ruby language itself, see the file COPYING for
@@ -1,5 +1,5 @@
1
1
  =begin
2
- Copyright (C) 2006 Sam Roberts
2
+ Copyright (C) 2008 Sam Roberts
3
3
 
4
4
  This library is free software; you can redistribute it and/or modify it
5
5
  under the same terms as the ruby language itself, see the file COPYING for
@@ -1,5 +1,5 @@
1
1
  =begin
2
- Copyright (C) 2006 Sam Roberts
2
+ Copyright (C) 2008 Sam Roberts
3
3
 
4
4
  This library is free software; you can redistribute it and/or modify it
5
5
  under the same terms as the ruby language itself, see the file COPYING for
@@ -1,5 +1,5 @@
1
1
  =begin
2
- Copyright (C) 2006 Sam Roberts
2
+ Copyright (C) 2008 Sam Roberts
3
3
 
4
4
  This library is free software; you can redistribute it and/or modify it
5
5
  under the same terms as the ruby language itself, see the file COPYING for
@@ -39,6 +39,10 @@ module Vpim
39
39
  occurences.each_until(t1).detect { |t| tend = t + (duration || 0); tend > t0 }
40
40
  end
41
41
 
42
+ def rdates
43
+ Vpim.decode_date_time_list(propvalue('RDATE'))
44
+ end
45
+
42
46
  end
43
47
  end
44
48
  end
@@ -1,5 +1,5 @@
1
1
  =begin
2
- Copyright (C) 2006 Sam Roberts
2
+ Copyright (C) 2008 Sam Roberts
3
3
 
4
4
  This library is free software; you can redistribute it and/or modify it
5
5
  under the same terms as the ruby language itself, see the file COPYING for
data/lib/vpim/rfc2425.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  =begin
2
- Copyright (C) 2006 Sam Roberts
2
+ Copyright (C) 2008 Sam Roberts
3
3
 
4
4
  This library is free software; you can redistribute it and/or modify it
5
5
  under the same terms as the ruby language itself, see the file COPYING for
@@ -105,12 +105,17 @@ module Vpim
105
105
 
106
106
  # Convert a RFC 2425 date into an array of [year, month, day].
107
107
  def Vpim.decode_date(v) # :nodoc:
108
- unless v =~ %r{\s*#{Bnf::DATE}\s*}
108
+ unless v =~ %r{^\s*#{Bnf::DATE}\s*$}
109
109
  raise Vpim::InvalidEncodingError, "date not valid (#{v})"
110
110
  end
111
111
  [$1.to_i, $2.to_i, $3.to_i]
112
112
  end
113
113
 
114
+ # Convert a RFC 2425 date into an array of Date objects.
115
+ def self.decode_date_to_date(v)
116
+ Date.new(*decode_date(v))
117
+ end
118
+
114
119
  # Note in the following the RFC2425 allows yyyy-mm-ddThh:mm:ss, but RFC2445
115
120
  # does not. I choose to encode to the subset that is valid for both.
116
121
 
@@ -131,17 +136,32 @@ module Vpim
131
136
 
132
137
  # Convert a RFC 2425 time into an array of [hour,min,sec,secfrac,timezone]
133
138
  def Vpim.decode_time(v) # :nodoc:
134
- unless match = %r{\s*#{Bnf::TIME}\s*}.match(v)
135
- raise Vpim::InvalidEncodingError, "time not valid (#{v})"
139
+ unless match = %r{^\s*#{Bnf::TIME}\s*$}.match(v)
140
+ raise Vpim::InvalidEncodingError, "time '#{v}' not valid"
136
141
  end
137
142
  hour, min, sec, secfrac, tz = match.to_a[1..5]
138
143
 
139
144
  [hour.to_i, min.to_i, sec.to_i, secfrac ? secfrac.to_f : 0, tz]
140
145
  end
141
146
 
142
- # Convert a RFC 2425 date-time into an array of [hour,min,sec,secfrac,timezone]
147
+ def self.array_datetime_to_time(dtarray) #:nodoc:
148
+ # We get [ year, month, day, hour, min, sec, usec, tz ]
149
+ begin
150
+ tz = (dtarray.pop == "Z") ? :gm : :local
151
+ Time.send(tz, *dtarray)
152
+ rescue ArgumentError => e
153
+ raise Vpim::InvalidEncodingError, "#{tz} #{e} (#{dtarray.join(', ')})"
154
+ end
155
+ end
156
+
157
+ # Convert a RFC 2425 time into an array of Time objects.
158
+ def Vpim.decode_time_to_time(v) # :nodoc:
159
+ array_datetime_to_time(decode_date_time(v))
160
+ end
161
+
162
+ # Convert a RFC 2425 date-time into an array of [year,mon,day,hour,min,sec,secfrac,timezone]
143
163
  def Vpim.decode_date_time(v) # :nodoc:
144
- unless match = %r{\s*#{Bnf::DATE}T#{Bnf::TIME}\s*}.match(v)
164
+ unless match = %r{^\s*#{Bnf::DATE}T#{Bnf::TIME}\s*$}.match(v)
145
165
  raise Vpim::InvalidEncodingError, "date-time '#{v}' not valid"
146
166
  end
147
167
  year, month, day, hour, min, sec, secfrac, tz = match.to_a[1..8]
@@ -172,8 +192,6 @@ module Vpim
172
192
 
173
193
  #
174
194
  # integer_list
175
- #
176
- # text_list
177
195
 
178
196
  # Convert a RFC2425 date-list into an array of dates.
179
197
  def Vpim.decode_date_list(v) # :nodoc:
@@ -228,16 +246,7 @@ module Vpim
228
246
  end
229
247
 
230
248
  def Vpim.encode_text(v) #:nodoc:
231
- v.to_str.gsub(/([.\n])/) do
232
- case $1
233
- when "\n"
234
- "\\n"
235
- when "\\", ",", ";"
236
- "\\#{$1}"
237
- else
238
- $1
239
- end
240
- end
249
+ v.to_str.gsub(/([\\,;\n])/) { $1 == "\n" ? "\\n" : "\\"+$1 }
241
250
  end
242
251
 
243
252
  # v is an Array of String, or just a single String
data/lib/vpim/rrule.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  =begin
2
- Copyright (C) 2006 Sam Roberts
2
+ Copyright (C) 2008 Sam Roberts
3
3
 
4
4
  This library is free software; you can redistribute it and/or modify it
5
5
  under the same terms as the ruby language itself, see the file COPYING for
@@ -16,6 +16,12 @@ require 'pp'
16
16
 
17
17
  $debug = ENV['DEBUG']
18
18
 
19
+ class Date
20
+ def inspect
21
+ self.to_s
22
+ end
23
+ end
24
+
19
25
  def debug(*objs)
20
26
  if $debug
21
27
  pp(*objs)
@@ -30,17 +36,14 @@ module Vpim
30
36
  # syntax description and examples from RFC 2445. The description is pretty
31
37
  # hard to understand, but the examples are more helpful.
32
38
  #
33
- # The implementation is pretty complete, but still lacks support for:
39
+ # The implementation is reasonably complete, but still lacks support for:
34
40
  #
35
- # TODO - BYWEEKLY, BYWEEKNO, WKST: rules that recur by the week, or are
36
- # limited to particular weeks, not hard, but not trivial, I'll do it for the
37
- # next release
41
+ # Recurrence by date (RDATE) and exclusions (EXDATE, EXRULE).
38
42
  #
39
- # TODO - BYHOUR, BYMINUTE, BYSECOND: trivial to do, but I don't have an
40
- # immediate need for them, I'll do it for the next release
43
+ # TODO - BYWEEKNO: rules that are limited to particular weeks in a year.
41
44
  #
42
- # TODO - BYSETPOS: limiting to only certain recurrences in a set (what does
43
- # -1, last occurence, mean for an infinitely occuring rule?)
45
+ # TODO - BYHOUR, BYMINUTE, BYSECOND: trivial to do, but I don't have an
46
+ # immediate need for them.
44
47
  #
45
48
  # TODO - new API? -> Rrule#infinite?
46
49
  #
@@ -139,16 +142,18 @@ module Vpim
139
142
  # most systems.
140
143
  def each(dountil = nil) #:yield: ytime
141
144
  t = @dtstart.clone
142
- count = 1
143
145
 
144
146
  # Time.to_a => [ sec, min, hour, day, month, year, wday, yday, isdst, zone ]
145
147
 
146
- # Every event occurs at least once, at its start time, but only if the start
147
- # time is earlier than DOUNTIL...
148
+ # Every event occurs at its start time, but only if the start time is
149
+ # earlier than DOUNTIL...
150
+ if !dountil || t < dountil
151
+ yield t
152
+ end
153
+ count = 1
154
+
155
+ # With no recurrence, DTSTART is the only occurence.
148
156
  if !@rrule
149
- if !dountil || t < dountil
150
- yield t
151
- end
152
157
  return self
153
158
  end
154
159
 
@@ -168,22 +173,32 @@ module Vpim
168
173
  #when 'YEARLY' then
169
174
  # Don't need to keep track of year, all occurences are within t's
170
175
  # year.
171
- when 'MONTHLY' then days.month = t.month #month = { t.month => nil }
172
- # when 'WEEKLY' then days.mday = t.month, t.mday
176
+ when 'MONTHLY' then days.month = t.month
177
+ when 'WEEKLY' then #days.month = t.month
173
178
  # TODO - WEEKLY
174
- when 'DAILY' then days.mday = t.month, t.mday #month = { t.month => [ t.mday ] }
175
- when 'HOURLY' then hour = [t.hour]
176
- when 'MINUTELY' then min = [t.min]
177
- when 'SECONDLY' then sec = [t.sec]
179
+ when 'DAILY' then days.mday = t.month, t.mday
180
+ when 'HOURLY' then hour = [t.hour]
181
+ when 'MINUTELY' then min = [t.min]
182
+ when 'SECONDLY' then sec = [t.sec]
178
183
  end
179
184
 
185
+ # debug [t, days]
180
186
  # Process the BY* modifiers in RFC defined order:
181
- # BYMONTH, BYWEEKNO, BYYEARDAY, BYMONTHDAY, BYDAY,
182
- # BYHOUR, BYMINUTE, BYSECOND and BYSETPOS
183
-
187
+ # BYMONTH,
188
+ # BYWEEKNO,
189
+ # BYYEARDAY,
190
+ # BYMONTHDAY,
191
+ # BYDAY,
192
+ # BYHOUR,
193
+ # BYMINUTE,
194
+ # BYSECOND,
195
+ # BYSETPOS
196
+
197
+ bymon = [nil]
198
+
184
199
  if @by['BYMONTH']
185
200
  bymon = @by['BYMONTH'].split(',')
186
- bymon = bymon.collect { |m| m.to_i }
201
+ bymon = bymon.map { |m| m.to_i }
187
202
  # debug bymon
188
203
 
189
204
  # In yearly, at this point, month will always be nil. At other
@@ -218,18 +233,17 @@ module Vpim
218
233
 
219
234
  if @by['BYDAY']
220
235
  byday = @by['BYDAY'].scan(/,?([+-]?[1-9]?\d*)?(SU|MO|TU|WE|TH|FR|SA)/i)
221
- # debug byday
222
236
 
223
237
  # BYDAY means different things in different frequencies. The +n+
224
238
  # is only meaningful when freq is yearly or monthly.
225
239
 
226
240
  case @freq
227
241
  when 'YEARLY'
228
- dates = byday_in_yearly(t.year, byday)
242
+ dates = bymon.map { |m| byday_in_monthly(t.year, m, byday) }.flatten
229
243
  when 'MONTHLY'
230
244
  dates = byday_in_monthly(t.year, t.month, byday)
231
245
  when 'WEEKLY'
232
- # dates = byday_in_weekly(t.year, wkstart, t.month, t.day, byday)
246
+ dates = byday_in_weekly(t.year, t.month, t.mday, @wkst, byday)
233
247
  when 'DAILY', 'HOURLY', 'MINUTELY', 'SECONDLY'
234
248
  # Reuse the byday_in_monthly. Current day is already specified,
235
249
  # so this will just eliminate the current day if its not allowed
@@ -244,48 +258,73 @@ module Vpim
244
258
 
245
259
  # TODO - BYHOUR, BYMINUTE, BYSECOND
246
260
 
247
- # TODO - BYSETPOS
248
-
249
- # Yield the time, if we haven't gone over COUNT, or past UNTIL, or past
250
- # the end of representable time.
251
-
252
261
  hour = [@dtstart.hour] if !hour
253
262
  min = [@dtstart.min] if !min
254
263
  sec = [@dtstart.sec] if !sec
255
264
 
256
265
  # debug days
257
266
 
267
+ # Generate the yield set so BYSETPOS can be evaluated.
268
+ yset = []
269
+
258
270
  days.each do |m,d|
259
- hour.each do |h|
260
- min.each do |n|
261
- sec.each do |s|
262
- if(@count && (count > @count))
263
- return self
264
- end
265
- y = Time.local(t.year, m, d, h, n, s, 0)
266
-
267
- next if y.hour != h
268
-
269
- # The generated set can sometimes generate results earlier
270
- # than the DTSTART, skip them.
271
- next if y < @dtstart
272
-
273
- # We are done if current time is past @until.
274
- if @until && (y > @until)
275
- return self
276
- end
277
- # We are also done if current time is past the
278
- # caller-requested until.
279
- if dountil && (y >= dountil)
280
- return self
281
- end
282
- yield y
283
- count += 1
284
- end
271
+ hour.each do |h|
272
+ min.each do |n|
273
+ sec.each do |s|
274
+ y = Time.local(t.year, m, d, h, n, s, 0)
275
+
276
+ next if y.hour != h
277
+
278
+ yset << y
285
279
  end
286
280
  end
281
+ end
282
+ end
283
+
284
+ if @by['BYSETPOS']
285
+ bysetpos = @by['BYSETPOS'].split(',')
286
+ yset = bysetpos.map do |i|
287
+ i = i.to_i
288
+ case
289
+ when i < 0
290
+ # yset[-1] is last
291
+ yset[i]
292
+ when i > 0
293
+ # yset[1] is first
294
+ yset[i-1]
295
+ else
296
+ # ignore invalid syntax
297
+ end
298
+ end.compact # set positions out of scope will be nil, RFC says ignore them
287
299
  end
288
300
 
301
+ # Yield the occurence, if we haven't gone over COUNT, or past UNTIL, or
302
+ # past the end of representable time.
303
+
304
+ yset.each do |y|
305
+ # The generated set can sometimes generate results earlier
306
+ # than the DTSTART, skip them. Also, we already yielded
307
+ # DTSTART, skip it.
308
+ next if y <= @dtstart
309
+
310
+ count += 1
311
+
312
+ # We are done if current count is past @count.
313
+ if(@count && (count > @count))
314
+ return self
315
+ end
316
+
317
+ # We are done if current time is past @until.
318
+ if @until && (y > @until)
319
+ return self
320
+ end
321
+ # We are also done if current time is past the
322
+ # caller-requested until.
323
+ if dountil && (y >= dountil)
324
+ return self
325
+ end
326
+ yield y
327
+ end
289
328
 
290
329
  # Add @interval to @freq component
291
330
 
@@ -328,6 +367,8 @@ module Vpim
328
367
  end
329
368
  end
330
369
 
370
+
371
+
331
372
  class DaySet #:nodoc:
332
373
 
333
374
  def initialize(ref)
@@ -361,30 +402,30 @@ module Vpim
361
402
  end
362
403
 
363
404
  def intersect_dates(dates) #:nodoc:
364
- if dates
365
- # If no months are in the dayset, add all the ones in dates
366
- if !@month
367
- @month = {}
405
+ return unless dates
368
406
 
369
- dates.each do |d|
370
- @month[d.mon] = nil
371
- end
407
+ # If no months are in the dayset, add all the ones in dates
408
+ if !@month
409
+ @month = {}
410
+
411
+ dates.each do |d|
412
+ @month[d.mon] = nil
372
413
  end
414
+ end
373
415
 
374
- # In each month,
375
- # if there are days,
376
- # eliminate those not in dates
377
- # otherwise
378
- # add all those in dates
379
- @month.each do |mon, days|
380
- days_in_mon = dates.find_all { |d| d.mon == mon }
381
- days_in_mon = days_in_mon.collect { |d| d.day }
382
-
383
- if days
384
- days_in_mon = days_in_mon & days
385
- end
386
- @month[mon] = days_in_mon
416
+ # In each month,
417
+ # if there are days,
418
+ # eliminate those not in dates
419
+ # otherwise
420
+ # add all those in dates
421
+ @month.each do |mon, days|
422
+ days_in_mon = dates.find_all { |d| d.mon == mon }
423
+ days_in_mon = days_in_mon.map { |d| d.day }
424
+
425
+ if days
426
+ days_in_mon = days_in_mon & days
387
427
  end
428
+ @month[mon] = days_in_mon
388
429
  end
389
430
  end
390
431
 
@@ -449,16 +490,12 @@ module Vpim
449
490
  dates = []
450
491
 
451
492
  byyday.each do |yday|
452
- dates << Date.new2(year, yday[0].to_i)
493
+ dates << Date.ordinal(year, yday[0].to_i)
453
494
  end
454
495
  dates.sort!
455
496
  dates
456
497
  end
457
498
 
458
- def byday_in_yearly(year, byday) #:nodoc:
459
- byday_in_monthly(year, nil, byday)
460
- end
461
-
462
499
  def byday_in_monthly(year, mon, byday) #:nodoc:
463
500
  dates = []
464
501
 
@@ -474,6 +511,17 @@ module Vpim
474
511
  dates
475
512
  end
476
513
 
514
+ def byday_in_weekly(year, mon, day, wkst, byday)
515
+ # debug ["day", year,mon,day,wkst,byday]
516
+ days = byday.map{ |_, byday| Date.str2wday(byday) }
517
+ week = DateGen.weekofdate(year, mon, day, wkst)
518
+ # debug [ "week", dates ]
519
+ week.delete_if do |d|
520
+ !days.include?(d.wday)
521
+ end
522
+ week
523
+ end
524
+
477
525
  end
478
526
 
479
527
  end
data/lib/vpim/time.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  =begin
2
- Copyright (C) 2006 Sam Roberts
2
+ Copyright (C) 2008 Sam Roberts
3
3
 
4
4
  This library is free software; you can redistribute it and/or modify it
5
5
  under the same terms as the ruby language itself, see the file COPYING for
data/lib/vpim/vcard.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  =begin
2
- Copyright (C) 2006 Sam Roberts
2
+ Copyright (C) 2008 Sam Roberts
3
3
 
4
4
  This library is free software; you can redistribute it and/or modify it
5
5
  under the same terms as the ruby language itself, see the file COPYING for
data/lib/vpim/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  =begin
2
- Copyright (C) 2006 Sam Roberts
2
+ Copyright (C) 2008 Sam Roberts
3
3
 
4
4
  This library is free software; you can redistribute it and/or modify it
5
5
  under the same terms as the ruby language itself, see the file COPYING for
@@ -7,9 +7,9 @@
7
7
  =end
8
8
 
9
9
  module Vpim
10
- PRODID = '-//Ensemble Independent//vPim 0.360//EN'
10
+ PRODID = '-//Ensemble Independent//vPim 0.597//EN'
11
11
 
12
- VERSION = '0.360'
12
+ VERSION = '0.597'
13
13
 
14
14
  # Return the API version as a string.
15
15
  def Vpim.version
data/lib/vpim/vevent.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  =begin
2
- Copyright (C) 2006 Sam Roberts
2
+ Copyright (C) 2008 Sam Roberts
3
3
 
4
4
  This library is free software; you can redistribute it and/or modify it
5
5
  under the same terms as the ruby language itself, see the file COPYING for
data/lib/vpim/vjournal.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  =begin
2
- Copyright (C) 2006 Sam Roberts
2
+ Copyright (C) 2008 Sam Roberts
3
3
 
4
4
  This library is free software; you can redistribute it and/or modify it
5
5
  under the same terms as the ruby language itself, see the file COPYING for
data/lib/vpim/vpim.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  =begin
2
- Copyright (C) 2006 Sam Roberts
2
+ Copyright (C) 2008 Sam Roberts
3
3
 
4
4
  This library is free software; you can redistribute it and/or modify it
5
5
  under the same terms as the ruby language itself, see the file COPYING for
data/lib/vpim/vtodo.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  =begin
2
- Copyright (C) 2006 Sam Roberts
2
+ Copyright (C) 2008 Sam Roberts
3
3
 
4
4
  This library is free software; you can redistribute it and/or modify it
5
5
  under the same terms as the ruby language itself, see the file COPYING for
@@ -36,6 +36,18 @@ module Vpim
36
36
  @elements = inner
37
37
  end
38
38
 
39
+ # TODO - derive everything from Icalendar::Component to get this kind of stuff?
40
+ def fields #:nodoc:
41
+ f = @properties.to_a
42
+ last = f.pop
43
+ f.push @elements
44
+ f.push last
45
+ end
46
+
47
+ def properties #:nodoc:
48
+ @properties
49
+ end
50
+
39
51
  # Create a new Vtodo object.
40
52
  #
41
53
  # If specified, +fields+ must be either an array of Field objects to
metadata CHANGED
@@ -1,34 +1,27 @@
1
1
  --- !ruby/object:Gem::Specification
2
- rubygems_version: 0.8.11
3
- specification_version: 1
4
2
  name: vpim
5
3
  version: !ruby/object:Gem::Version
6
- version: "0.360"
7
- date: 2006-04-02 00:00:00 -08:00
8
- summary: iCalendar and vCard support for ruby
9
- require_paths:
10
- - lib
11
- email: sroberts@uniserve.com
12
- homepage: http://vpim.rubyforge.org
13
- rubyforge_project: vpim
14
- description: This is a pure-ruby library for decoding and encoding vCard and iCalendar data ("personal information") called vPim.
15
- autorequire: vpim
16
- default_executable:
17
- bindir: bin
18
- has_rdoc: true
19
- required_ruby_version: !ruby/object:Gem::Version::Requirement
20
- requirements:
21
- - - ">"
22
- - !ruby/object:Gem::Version
23
- version: 0.0.0
24
- version:
4
+ version: "0.597"
25
5
  platform: ruby
26
- signing_key:
27
- cert_chain:
28
6
  authors:
29
7
  - Sam Roberts
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+
12
+ date: 2008-03-01 00:00:00 -08:00
13
+ default_executable:
14
+ dependencies: []
15
+
16
+ description: This is a pure-ruby library for decoding and encoding vCard and iCalendar data ("personal information") called vPim.
17
+ email: sroberts@uniserve.com
18
+ executables: []
19
+
20
+ extensions: []
21
+
22
+ extra_rdoc_files: []
23
+
30
24
  files:
31
- - lib/vpim.rb
32
25
  - lib/vpim/address.rb
33
26
  - lib/vpim/attachment.rb
34
27
  - lib/vpim/date.rb
@@ -37,6 +30,13 @@ files:
37
30
  - lib/vpim/enumerator.rb
38
31
  - lib/vpim/field.rb
39
32
  - lib/vpim/icalendar.rb
33
+ - lib/vpim/maker/vcard.rb
34
+ - lib/vpim/property/base.rb
35
+ - lib/vpim/property/common.rb
36
+ - lib/vpim/property/location.rb
37
+ - lib/vpim/property/priority.rb
38
+ - lib/vpim/property/recurrence.rb
39
+ - lib/vpim/property/resources.rb
40
40
  - lib/vpim/rfc2425.rb
41
41
  - lib/vpim/rrule.rb
42
42
  - lib/vpim/time.rb
@@ -46,24 +46,32 @@ files:
46
46
  - lib/vpim/vjournal.rb
47
47
  - lib/vpim/vpim.rb
48
48
  - lib/vpim/vtodo.rb
49
- - lib/vpim/maker/vcard.rb
50
- - lib/vpim/property/base.rb
51
- - lib/vpim/property/common.rb
52
- - lib/vpim/property/location.rb
53
- - lib/vpim/property/priority.rb
54
- - lib/vpim/property/recurrence.rb
55
- - lib/vpim/property/resources.rb
56
- test_files: []
57
-
49
+ - lib/vpim.rb
50
+ has_rdoc: true
51
+ homepage: http://vpim.rubyforge.org
52
+ post_install_message:
58
53
  rdoc_options: []
59
54
 
60
- extra_rdoc_files: []
61
-
62
- executables: []
63
-
64
- extensions: []
65
-
55
+ require_paths:
56
+ - lib
57
+ required_ruby_version: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ">="
60
+ - !ruby/object:Gem::Version
61
+ version: "0"
62
+ version:
63
+ required_rubygems_version: !ruby/object:Gem::Requirement
64
+ requirements:
65
+ - - ">="
66
+ - !ruby/object:Gem::Version
67
+ version: "0"
68
+ version:
66
69
  requirements: []
67
70
 
68
- dependencies: []
71
+ rubyforge_project: vpim
72
+ rubygems_version: 1.0.1
73
+ signing_key:
74
+ specification_version: 2
75
+ summary: iCalendar and vCard support for ruby
76
+ test_files: []
69
77