recurs 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/recurs.rb +0 -3
- data/lib/recurs/version.rb +1 -1
- data/spec/models/instance_spec.rb +1 -27
- data/spec/models/parser_spec.rb +0 -20
- metadata +2 -2
data/lib/recurs.rb
CHANGED
@@ -4,7 +4,6 @@ require 'recurs/rules'
|
|
4
4
|
require 'ri_cal'
|
5
5
|
module Recurs
|
6
6
|
include RiCal
|
7
|
-
# Your code goes here...
|
8
7
|
|
9
8
|
module Parser
|
10
9
|
|
@@ -12,8 +11,6 @@ module Recurs
|
|
12
11
|
base.send :extend, ClassMethods
|
13
12
|
end
|
14
13
|
|
15
|
-
# class << self is NOT the same as including ( seen above ) which makes methods available to CLASSES that include the module
|
16
|
-
#, it ONLY makes the methods available to the MODULE itself
|
17
14
|
class << self
|
18
15
|
def rrule(repeats=nil, args={})
|
19
16
|
args[:rule] = 'r'
|
data/lib/recurs/version.rb
CHANGED
@@ -12,10 +12,6 @@ describe Event do
|
|
12
12
|
end
|
13
13
|
|
14
14
|
it "should act as recurring" do
|
15
|
-
#@event.rrules
|
16
|
-
#@event.exrules
|
17
|
-
#@event.rdates
|
18
|
-
#@event.exdates
|
19
15
|
@event.recurs
|
20
16
|
end
|
21
17
|
|
@@ -60,26 +56,4 @@ describe Event do
|
|
60
56
|
it "should add a list of exdates" do
|
61
57
|
@event.add_exdate(:dates => [Date.today, (Date.today+2)]).should == "EXDATE:#{RiCal::FastDateTime.from_date_time(Date.today.to_datetime).ical_str},#{RiCal::FastDateTime.from_date_time((Date.today+2).to_datetime).ical_str}"
|
62
58
|
end
|
63
|
-
|
64
|
-
|
65
|
-
end
|
66
|
-
|
67
|
-
=begin
|
68
|
-
An event has recurrence
|
69
|
-
|
70
|
-
@event.recurs #"DTSTART;TZID=US-Eastern:19970902T0900
|
71
|
-
RRULE:FREQ=DAILY;COUNT=10
|
72
|
-
EXRULE:"
|
73
|
-
|
74
|
-
TODO: Ascertain how ri_cal parses complex rules
|
75
|
-
|
76
|
-
While building the recurrence the event must use private instance attributes from the recurrrence module:
|
77
|
-
|
78
|
-
The recurrence module must be mixed into the model transparently, either by using an acts_as
|
79
|
-
or by inheriting from the module
|
80
|
-
|
81
|
-
class Event < AR
|
82
|
-
acts_as_recurring_event
|
83
|
-
end
|
84
|
-
|
85
|
-
=end
|
59
|
+
end
|
data/spec/models/parser_spec.rb
CHANGED
@@ -110,23 +110,3 @@ describe Recurs::Parser do
|
|
110
110
|
end
|
111
111
|
|
112
112
|
end
|
113
|
-
|
114
|
-
|
115
|
-
=begin
|
116
|
-
# A recurrence instance should implement a couple of attributes ( recurs, rrules, rdates, exrules )
|
117
|
-
|
118
|
-
Recurs::Parser.recurs is a composite method combining all rrules and exrules
|
119
|
-
Recurs::Parser.rrules is an array of rrules similarly exrules is the same
|
120
|
-
|
121
|
-
it "instance should respond to instance methods:" do
|
122
|
-
Recurs::Parser = Parser.new
|
123
|
-
Recurs::Parser.recurs
|
124
|
-
Recurs::Parser.rrules
|
125
|
-
end
|
126
|
-
|
127
|
-
# The Parser Class should implement singular versions ( rrule, exrule ), these methods generate atomic rules
|
128
|
-
|
129
|
-
The Parser class implements the rrule and exrule methods => alias_method_chain perhaps
|
130
|
-
( these are actually just aliases of the same method but with predefined flags )
|
131
|
-
|
132
|
-
=end
|