vpim-rails 0.661 → 0.662
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/rrule.rb +7 -7
- metadata +15 -5
- data/lib/vpim/time.rb +0 -40
data/lib/vpim/rrule.rb
CHANGED
@@ -331,25 +331,25 @@ module Vpim
|
|
331
331
|
begin
|
332
332
|
case @freq
|
333
333
|
when 'YEARLY' then
|
334
|
-
t
|
334
|
+
t += @interval.years
|
335
335
|
|
336
336
|
when 'MONTHLY' then
|
337
|
-
t
|
337
|
+
t += @interval.months
|
338
338
|
|
339
339
|
when 'WEEKLY' then
|
340
|
-
t
|
340
|
+
t += (@interval * 7).days
|
341
341
|
|
342
342
|
when 'DAILY' then
|
343
|
-
t
|
343
|
+
t += @interval.days
|
344
344
|
|
345
345
|
when 'HOURLY' then
|
346
|
-
t += @interval
|
346
|
+
t += @interval.hours
|
347
347
|
|
348
348
|
when 'MINUTELY' then
|
349
|
-
t += @interval
|
349
|
+
t += @interval.minutes
|
350
350
|
|
351
351
|
when 'SECONDLY' then
|
352
|
-
t += @interval
|
352
|
+
t += @interval.seconds
|
353
353
|
|
354
354
|
when nil
|
355
355
|
return self
|
metadata
CHANGED
@@ -1,7 +1,12 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: vpim-rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
|
4
|
+
hash: 1319
|
5
|
+
prerelease: false
|
6
|
+
segments:
|
7
|
+
- 0
|
8
|
+
- 662
|
9
|
+
version: "0.662"
|
5
10
|
platform: ruby
|
6
11
|
authors:
|
7
12
|
- Sam Roberts
|
@@ -46,7 +51,6 @@ files:
|
|
46
51
|
- lib/vpim/repo.rb
|
47
52
|
- lib/vpim/rfc2425.rb
|
48
53
|
- lib/vpim/rrule.rb
|
49
|
-
- lib/vpim/time.rb
|
50
54
|
- lib/vpim/vcard.rb
|
51
55
|
- lib/vpim/version.rb
|
52
56
|
- lib/vpim/vevent.rb
|
@@ -96,21 +100,27 @@ rdoc_options: []
|
|
96
100
|
require_paths:
|
97
101
|
- lib
|
98
102
|
required_ruby_version: !ruby/object:Gem::Requirement
|
103
|
+
none: false
|
99
104
|
requirements:
|
100
105
|
- - ">="
|
101
106
|
- !ruby/object:Gem::Version
|
107
|
+
hash: 3
|
108
|
+
segments:
|
109
|
+
- 0
|
102
110
|
version: "0"
|
103
|
-
version:
|
104
111
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
112
|
+
none: false
|
105
113
|
requirements:
|
106
114
|
- - ">="
|
107
115
|
- !ruby/object:Gem::Version
|
116
|
+
hash: 3
|
117
|
+
segments:
|
118
|
+
- 0
|
108
119
|
version: "0"
|
109
|
-
version:
|
110
120
|
requirements: []
|
111
121
|
|
112
122
|
rubyforge_project:
|
113
|
-
rubygems_version: 1.3.
|
123
|
+
rubygems_version: 1.3.7
|
114
124
|
signing_key:
|
115
125
|
specification_version: 2
|
116
126
|
summary: iCalendar and vCard support for rails
|
data/lib/vpim/time.rb
DELETED
@@ -1,40 +0,0 @@
|
|
1
|
-
=begin
|
2
|
-
Copyright (C) 2008 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
|
-
require 'date'
|
10
|
-
|
11
|
-
# Extensions to builtin Time allowing addition to Time by multiples of other
|
12
|
-
# intervals than a second.
|
13
|
-
|
14
|
-
class Time
|
15
|
-
# Returns a new Time, +years+ later than this time. Feb 29 of a
|
16
|
-
# leap year will be rounded up to Mar 1 if the target date is not a leap
|
17
|
-
# year.
|
18
|
-
def plus_year(years)
|
19
|
-
Time.zone.local(year + years, month, day, hour, min, sec, usec)
|
20
|
-
end
|
21
|
-
|
22
|
-
# Returns a new Time, +months+ later than this time. The day will be
|
23
|
-
# rounded down if it is not valid for that month.
|
24
|
-
# Jan 31 plus 1 month will be on Feb 28!
|
25
|
-
def plus_month(months)
|
26
|
-
d = Date.new(year, month, day)
|
27
|
-
d >>= months
|
28
|
-
Time.zone.local(d.year, d.month, d.day, hour, min, sec, usec)
|
29
|
-
end
|
30
|
-
|
31
|
-
# Returns a new Time, +days+ later than this time.
|
32
|
-
# Does this do as I expect over DST? What if the hour doesn't exist
|
33
|
-
# in the next day, due to DST changes?
|
34
|
-
def plus_day(days)
|
35
|
-
d = Date.new(year, month, day)
|
36
|
-
d += days
|
37
|
-
Time.zone.local(d.year, d.month, d.day, hour, min, sec, usec)
|
38
|
-
end
|
39
|
-
end
|
40
|
-
|