icalendar 0.95
Sign up to get free protection for your applications and to get access to all the features.
- data/COPYING +56 -0
- data/GPL +340 -0
- data/README +121 -0
- data/Rakefile +101 -0
- data/docs/api/classes/Array.html +146 -0
- data/docs/api/classes/Date.html +157 -0
- data/docs/api/classes/DateTime.html +178 -0
- data/docs/api/classes/Fixnum.html +146 -0
- data/docs/api/classes/Float.html +146 -0
- data/docs/api/classes/Icalendar/Alarm.html +184 -0
- data/docs/api/classes/Icalendar/Base.html +118 -0
- data/docs/api/classes/Icalendar/Calendar.html +411 -0
- data/docs/api/classes/Icalendar/Component.html +306 -0
- data/docs/api/classes/Icalendar/DateProp.html +187 -0
- data/docs/api/classes/Icalendar/DateProp/ClassMethods.html +195 -0
- data/docs/api/classes/Icalendar/Event.html +202 -0
- data/docs/api/classes/Icalendar/Freebusy.html +157 -0
- data/docs/api/classes/Icalendar/InvalidComponentClass.html +117 -0
- data/docs/api/classes/Icalendar/InvalidPropertyValue.html +117 -0
- data/docs/api/classes/Icalendar/Journal.html +190 -0
- data/docs/api/classes/Icalendar/Parameter.html +166 -0
- data/docs/api/classes/Icalendar/Parser.html +447 -0
- data/docs/api/classes/Icalendar/Timezone.html +197 -0
- data/docs/api/classes/Icalendar/Todo.html +199 -0
- data/docs/api/classes/String.html +160 -0
- data/docs/api/classes/Time.html +161 -0
- data/docs/api/created.rid +1 -0
- data/docs/api/files/COPYING.html +163 -0
- data/docs/api/files/GPL.html +531 -0
- data/docs/api/files/README.html +241 -0
- data/docs/api/files/lib/icalendar/base_rb.html +108 -0
- data/docs/api/files/lib/icalendar/calendar_rb.html +101 -0
- data/docs/api/files/lib/icalendar/component/alarm_rb.html +101 -0
- data/docs/api/files/lib/icalendar/component/event_rb.html +101 -0
- data/docs/api/files/lib/icalendar/component/freebusy_rb.html +101 -0
- data/docs/api/files/lib/icalendar/component/journal_rb.html +101 -0
- data/docs/api/files/lib/icalendar/component/timezone_rb.html +101 -0
- data/docs/api/files/lib/icalendar/component/todo_rb.html +101 -0
- data/docs/api/files/lib/icalendar/component_rb.html +101 -0
- data/docs/api/files/lib/icalendar/conversions_rb.html +108 -0
- data/docs/api/files/lib/icalendar/helpers_rb.html +101 -0
- data/docs/api/files/lib/icalendar/parameter_rb.html +101 -0
- data/docs/api/files/lib/icalendar/parser_rb.html +109 -0
- data/docs/api/files/lib/icalendar_rb.html +118 -0
- data/docs/api/fr_class_index.html +48 -0
- data/docs/api/fr_file_index.html +43 -0
- data/docs/api/fr_method_index.html +63 -0
- data/docs/api/index.html +24 -0
- data/docs/api/rdoc-style.css +208 -0
- data/docs/examples/create_cal.rb +40 -0
- data/docs/examples/parse_cal.rb +19 -0
- data/docs/examples/single_event.ics +18 -0
- data/docs/rfcs/rfc2425.pdf +0 -0
- data/docs/rfcs/rfc2426.pdf +0 -0
- data/docs/rfcs/rfc2445.pdf +0 -0
- data/docs/rfcs/rfc2446.pdf +0 -0
- data/docs/rfcs/rfc2447.pdf +0 -0
- data/docs/rfcs/rfc3283.txt +738 -0
- data/lib/icalendar.rb +27 -0
- data/lib/icalendar/#helpers.rb# +92 -0
- data/lib/icalendar/base.rb +31 -0
- data/lib/icalendar/calendar.rb +112 -0
- data/lib/icalendar/component.rb +253 -0
- data/lib/icalendar/component/alarm.rb +35 -0
- data/lib/icalendar/component/event.rb +68 -0
- data/lib/icalendar/component/freebusy.rb +35 -0
- data/lib/icalendar/component/journal.rb +61 -0
- data/lib/icalendar/component/timezone.rb +43 -0
- data/lib/icalendar/component/todo.rb +65 -0
- data/lib/icalendar/conversions.rb +115 -0
- data/lib/icalendar/helpers.rb +109 -0
- data/lib/icalendar/parameter.rb +33 -0
- data/lib/icalendar/parser.rb +395 -0
- data/test/calendar_test.rb +46 -0
- data/test/component/event_test.rb +47 -0
- data/test/component_test.rb +74 -0
- data/test/parser_test.rb +83 -0
- data/test/property_helpers.rb +35 -0
- data/test/simplecal.ics +119 -0
- data/test/single_event.ics +23 -0
- metadata +135 -0
@@ -0,0 +1,241 @@
|
|
1
|
+
<?xml version="1.0" encoding="iso-8859-1"?>
|
2
|
+
<!DOCTYPE html
|
3
|
+
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
4
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
5
|
+
|
6
|
+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
7
|
+
<head>
|
8
|
+
<title>File: README</title>
|
9
|
+
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
10
|
+
<meta http-equiv="Content-Script-Type" content="text/javascript" />
|
11
|
+
<link rel="stylesheet" href=".././rdoc-style.css" type="text/css" media="screen" />
|
12
|
+
<script type="text/javascript">
|
13
|
+
// <![CDATA[
|
14
|
+
|
15
|
+
function popupCode( url ) {
|
16
|
+
window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
|
17
|
+
}
|
18
|
+
|
19
|
+
function toggleCode( id ) {
|
20
|
+
if ( document.getElementById )
|
21
|
+
elem = document.getElementById( id );
|
22
|
+
else if ( document.all )
|
23
|
+
elem = eval( "document.all." + id );
|
24
|
+
else
|
25
|
+
return false;
|
26
|
+
|
27
|
+
elemStyle = elem.style;
|
28
|
+
|
29
|
+
if ( elemStyle.display != "block" ) {
|
30
|
+
elemStyle.display = "block"
|
31
|
+
} else {
|
32
|
+
elemStyle.display = "none"
|
33
|
+
}
|
34
|
+
|
35
|
+
return true;
|
36
|
+
}
|
37
|
+
|
38
|
+
// Make codeblocks hidden by default
|
39
|
+
document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
|
40
|
+
|
41
|
+
// ]]>
|
42
|
+
</script>
|
43
|
+
|
44
|
+
</head>
|
45
|
+
<body>
|
46
|
+
|
47
|
+
|
48
|
+
|
49
|
+
<div id="fileHeader">
|
50
|
+
<h1>README</h1>
|
51
|
+
<table class="header-table">
|
52
|
+
<tr class="top-aligned-row">
|
53
|
+
<td><strong>Path:</strong></td>
|
54
|
+
<td>README
|
55
|
+
</td>
|
56
|
+
</tr>
|
57
|
+
<tr class="top-aligned-row">
|
58
|
+
<td><strong>Last Update:</strong></td>
|
59
|
+
<td>Sun Jun 12 16:05:18 MDT 2005</td>
|
60
|
+
</tr>
|
61
|
+
</table>
|
62
|
+
</div>
|
63
|
+
<!-- banner header -->
|
64
|
+
|
65
|
+
<div id="bodyContent">
|
66
|
+
|
67
|
+
|
68
|
+
|
69
|
+
<div id="contextContent">
|
70
|
+
|
71
|
+
<div id="description">
|
72
|
+
<h1>iCalendar — Internet calendaring, Ruby style</h1>
|
73
|
+
<p>
|
74
|
+
This is a Ruby library for dealing with iCalendar files. Rather than
|
75
|
+
explaining myself, here is the introduction from RFC-2445, which defines
|
76
|
+
the format:
|
77
|
+
</p>
|
78
|
+
<p>
|
79
|
+
The use of calendaring and scheduling has grown considerably in the last
|
80
|
+
decade. Enterprise and inter-enterprise business has become dependent on
|
81
|
+
rapid scheduling of events and actions using this information technology.
|
82
|
+
However, the longer term growth of calendaring and scheduling, is currently
|
83
|
+
limited by the lack of Internet standards for the message content types
|
84
|
+
that are central to these knowledgeware applications. This memo is intended
|
85
|
+
to progress the level of interoperability possible between dissimilar
|
86
|
+
calendaring and scheduling applications. This memo defines a MIME content
|
87
|
+
type for exchanging electronic calendaring and scheduling information. The
|
88
|
+
Internet Calendaring and Scheduling Core Object Specification, or
|
89
|
+
iCalendar, allows for the capture and exchange of information normally
|
90
|
+
stored within a calendaring and scheduling application; such as a Personal
|
91
|
+
Information Manager (PIM) or a Group Scheduling product.
|
92
|
+
</p>
|
93
|
+
<p>
|
94
|
+
The iCalendar format is suitable as an exchange format between applications
|
95
|
+
or systems. The format is defined in terms of a MIME content type. This
|
96
|
+
will enable the object to be exchanged using several transports, including
|
97
|
+
but not limited to SMTP, HTTP, a file system, desktop interactive protocols
|
98
|
+
such as the use of a memory- based clipboard or drag/drop interactions,
|
99
|
+
point-to-point asynchronous communication, wired-network transport, or some
|
100
|
+
form of unwired transport such as infrared might also be used.
|
101
|
+
</p>
|
102
|
+
<p>
|
103
|
+
Now for some examples:
|
104
|
+
</p>
|
105
|
+
<ul>
|
106
|
+
<li>Creating iCalendars.
|
107
|
+
|
108
|
+
<pre>
|
109
|
+
# Create a calendar with a single event (Method 1)
|
110
|
+
cal = Icalendar::Calendar.new
|
111
|
+
event = Icalendar::Event.new
|
112
|
+
|
113
|
+
# Set some properties for this event
|
114
|
+
event.user_id = "joe-bob@somewhere.net"
|
115
|
+
event.timestamp = DateTime.now
|
116
|
+
event.start = Date.new(2005, 04, 29)
|
117
|
+
event.end = Date.new(2005, 04, 28)
|
118
|
+
event.summary = "Meeting with the man."
|
119
|
+
event.klass = "PRIVATE"
|
120
|
+
|
121
|
+
# Now add it to the calendar
|
122
|
+
cal.add event
|
123
|
+
|
124
|
+
# Create a calendar with a single event (Method 2)
|
125
|
+
cal2 = Icalendar::Calendar.new
|
126
|
+
event = cal.event # This automatically adds the event to the calendar
|
127
|
+
event.user_id = "joe-bob@somewhere.net"
|
128
|
+
event.timestamp = DateTime.now
|
129
|
+
|
130
|
+
# Create a calendar with a single event (Method 3)
|
131
|
+
cal3 = Icalendar::Calendar.new
|
132
|
+
cal3.event do
|
133
|
+
user_id "joe-bob@somewhere.net"
|
134
|
+
event.timestamp DateTime.now
|
135
|
+
end
|
136
|
+
|
137
|
+
# We can output the calendars as strings to write to a file,
|
138
|
+
# network port, database etc.
|
139
|
+
cal_string = cal.to_ical
|
140
|
+
puts cal_string
|
141
|
+
</pre>
|
142
|
+
</li>
|
143
|
+
</ul>
|
144
|
+
<h2>Parsing iCalendars:</h2>
|
145
|
+
<pre>
|
146
|
+
require 'icalendar'
|
147
|
+
require 'date'
|
148
|
+
|
149
|
+
# Open a file or string to parse
|
150
|
+
cal_file = File.open("single_event.ics")
|
151
|
+
|
152
|
+
# Parser returns an array of calendars because a single file
|
153
|
+
# can have multiple calendar objects.
|
154
|
+
cals = Icalendar::Parser.new(cal_file).parse
|
155
|
+
cal = cals.first
|
156
|
+
|
157
|
+
# Now you can access the cal object in just the same way I created it
|
158
|
+
event = cal.events.first
|
159
|
+
|
160
|
+
puts "user_id: " + event.user_id
|
161
|
+
puts "summary: " + event.summary
|
162
|
+
</pre>
|
163
|
+
<h2>Including the iCalendar library when using RubyGem:</h2>
|
164
|
+
<pre>
|
165
|
+
begin
|
166
|
+
require 'rubygems'
|
167
|
+
require_gem 'icalendar', ">= 0.95"
|
168
|
+
rescue LoadError
|
169
|
+
require 'icalendar'
|
170
|
+
end
|
171
|
+
</pre>
|
172
|
+
<h2>Download</h2>
|
173
|
+
<p>
|
174
|
+
The latest version of this library can be found at
|
175
|
+
</p>
|
176
|
+
<ul>
|
177
|
+
<li><a
|
178
|
+
href="http://rubyforge.org/projects/icalendar">rubyforge.org/projects/icalendar</a>/
|
179
|
+
|
180
|
+
</li>
|
181
|
+
</ul>
|
182
|
+
<p>
|
183
|
+
Documentation can be found at
|
184
|
+
</p>
|
185
|
+
<ul>
|
186
|
+
<li><a href="http://icalendar.rubyforge.org">icalendar.rubyforge.org</a>/
|
187
|
+
|
188
|
+
</li>
|
189
|
+
</ul>
|
190
|
+
<h2>Installation</h2>
|
191
|
+
<p>
|
192
|
+
A fancy rakefile with install stuff as well as gem support is in the works.
|
193
|
+
In the meantime please do grab the tarball from the project website and
|
194
|
+
starting hacking!
|
195
|
+
</p>
|
196
|
+
<h2>License</h2>
|
197
|
+
<p>
|
198
|
+
This library is released under the same license as Ruby itself.
|
199
|
+
</p>
|
200
|
+
<h2>Support & Contributions</h2>
|
201
|
+
<p>
|
202
|
+
The iCalendar library homepage is <a
|
203
|
+
href="http://icalendar.rubyforge.org">icalendar.rubyforge.org</a>/
|
204
|
+
</p>
|
205
|
+
<p>
|
206
|
+
There is an icalendar-devel@rubyforge.org mailing list that can be used for
|
207
|
+
asking questions, making comments or submitting patches.
|
208
|
+
</p>
|
209
|
+
|
210
|
+
</div>
|
211
|
+
|
212
|
+
|
213
|
+
</div>
|
214
|
+
|
215
|
+
|
216
|
+
</div>
|
217
|
+
|
218
|
+
|
219
|
+
<!-- if includes -->
|
220
|
+
|
221
|
+
<div id="section">
|
222
|
+
|
223
|
+
|
224
|
+
|
225
|
+
|
226
|
+
|
227
|
+
|
228
|
+
|
229
|
+
|
230
|
+
<!-- if method_list -->
|
231
|
+
|
232
|
+
|
233
|
+
</div>
|
234
|
+
|
235
|
+
|
236
|
+
<div id="validator-badges">
|
237
|
+
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
238
|
+
</div>
|
239
|
+
|
240
|
+
</body>
|
241
|
+
</html>
|
@@ -0,0 +1,108 @@
|
|
1
|
+
<?xml version="1.0" encoding="iso-8859-1"?>
|
2
|
+
<!DOCTYPE html
|
3
|
+
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
4
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
5
|
+
|
6
|
+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
7
|
+
<head>
|
8
|
+
<title>File: base.rb</title>
|
9
|
+
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
10
|
+
<meta http-equiv="Content-Script-Type" content="text/javascript" />
|
11
|
+
<link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
|
12
|
+
<script type="text/javascript">
|
13
|
+
// <![CDATA[
|
14
|
+
|
15
|
+
function popupCode( url ) {
|
16
|
+
window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
|
17
|
+
}
|
18
|
+
|
19
|
+
function toggleCode( id ) {
|
20
|
+
if ( document.getElementById )
|
21
|
+
elem = document.getElementById( id );
|
22
|
+
else if ( document.all )
|
23
|
+
elem = eval( "document.all." + id );
|
24
|
+
else
|
25
|
+
return false;
|
26
|
+
|
27
|
+
elemStyle = elem.style;
|
28
|
+
|
29
|
+
if ( elemStyle.display != "block" ) {
|
30
|
+
elemStyle.display = "block"
|
31
|
+
} else {
|
32
|
+
elemStyle.display = "none"
|
33
|
+
}
|
34
|
+
|
35
|
+
return true;
|
36
|
+
}
|
37
|
+
|
38
|
+
// Make codeblocks hidden by default
|
39
|
+
document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
|
40
|
+
|
41
|
+
// ]]>
|
42
|
+
</script>
|
43
|
+
|
44
|
+
</head>
|
45
|
+
<body>
|
46
|
+
|
47
|
+
|
48
|
+
|
49
|
+
<div id="fileHeader">
|
50
|
+
<h1>base.rb</h1>
|
51
|
+
<table class="header-table">
|
52
|
+
<tr class="top-aligned-row">
|
53
|
+
<td><strong>Path:</strong></td>
|
54
|
+
<td>lib/icalendar/base.rb
|
55
|
+
</td>
|
56
|
+
</tr>
|
57
|
+
<tr class="top-aligned-row">
|
58
|
+
<td><strong>Last Update:</strong></td>
|
59
|
+
<td>Sun Jun 12 11:44:26 MDT 2005</td>
|
60
|
+
</tr>
|
61
|
+
</table>
|
62
|
+
</div>
|
63
|
+
<!-- banner header -->
|
64
|
+
|
65
|
+
<div id="bodyContent">
|
66
|
+
|
67
|
+
|
68
|
+
|
69
|
+
<div id="contextContent">
|
70
|
+
|
71
|
+
|
72
|
+
<div id="requires-list">
|
73
|
+
<h3 class="section-bar">Required files</h3>
|
74
|
+
|
75
|
+
<div class="name-list">
|
76
|
+
logger
|
77
|
+
</div>
|
78
|
+
</div>
|
79
|
+
|
80
|
+
</div>
|
81
|
+
|
82
|
+
|
83
|
+
</div>
|
84
|
+
|
85
|
+
|
86
|
+
<!-- if includes -->
|
87
|
+
|
88
|
+
<div id="section">
|
89
|
+
|
90
|
+
|
91
|
+
|
92
|
+
|
93
|
+
|
94
|
+
|
95
|
+
|
96
|
+
|
97
|
+
<!-- if method_list -->
|
98
|
+
|
99
|
+
|
100
|
+
</div>
|
101
|
+
|
102
|
+
|
103
|
+
<div id="validator-badges">
|
104
|
+
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
105
|
+
</div>
|
106
|
+
|
107
|
+
</body>
|
108
|
+
</html>
|
@@ -0,0 +1,101 @@
|
|
1
|
+
<?xml version="1.0" encoding="iso-8859-1"?>
|
2
|
+
<!DOCTYPE html
|
3
|
+
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
4
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
5
|
+
|
6
|
+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
7
|
+
<head>
|
8
|
+
<title>File: calendar.rb</title>
|
9
|
+
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
10
|
+
<meta http-equiv="Content-Script-Type" content="text/javascript" />
|
11
|
+
<link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
|
12
|
+
<script type="text/javascript">
|
13
|
+
// <![CDATA[
|
14
|
+
|
15
|
+
function popupCode( url ) {
|
16
|
+
window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
|
17
|
+
}
|
18
|
+
|
19
|
+
function toggleCode( id ) {
|
20
|
+
if ( document.getElementById )
|
21
|
+
elem = document.getElementById( id );
|
22
|
+
else if ( document.all )
|
23
|
+
elem = eval( "document.all." + id );
|
24
|
+
else
|
25
|
+
return false;
|
26
|
+
|
27
|
+
elemStyle = elem.style;
|
28
|
+
|
29
|
+
if ( elemStyle.display != "block" ) {
|
30
|
+
elemStyle.display = "block"
|
31
|
+
} else {
|
32
|
+
elemStyle.display = "none"
|
33
|
+
}
|
34
|
+
|
35
|
+
return true;
|
36
|
+
}
|
37
|
+
|
38
|
+
// Make codeblocks hidden by default
|
39
|
+
document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
|
40
|
+
|
41
|
+
// ]]>
|
42
|
+
</script>
|
43
|
+
|
44
|
+
</head>
|
45
|
+
<body>
|
46
|
+
|
47
|
+
|
48
|
+
|
49
|
+
<div id="fileHeader">
|
50
|
+
<h1>calendar.rb</h1>
|
51
|
+
<table class="header-table">
|
52
|
+
<tr class="top-aligned-row">
|
53
|
+
<td><strong>Path:</strong></td>
|
54
|
+
<td>lib/icalendar/calendar.rb
|
55
|
+
</td>
|
56
|
+
</tr>
|
57
|
+
<tr class="top-aligned-row">
|
58
|
+
<td><strong>Last Update:</strong></td>
|
59
|
+
<td>Fri May 20 13:38:36 MDT 2005</td>
|
60
|
+
</tr>
|
61
|
+
</table>
|
62
|
+
</div>
|
63
|
+
<!-- banner header -->
|
64
|
+
|
65
|
+
<div id="bodyContent">
|
66
|
+
|
67
|
+
|
68
|
+
|
69
|
+
<div id="contextContent">
|
70
|
+
|
71
|
+
|
72
|
+
|
73
|
+
</div>
|
74
|
+
|
75
|
+
|
76
|
+
</div>
|
77
|
+
|
78
|
+
|
79
|
+
<!-- if includes -->
|
80
|
+
|
81
|
+
<div id="section">
|
82
|
+
|
83
|
+
|
84
|
+
|
85
|
+
|
86
|
+
|
87
|
+
|
88
|
+
|
89
|
+
|
90
|
+
<!-- if method_list -->
|
91
|
+
|
92
|
+
|
93
|
+
</div>
|
94
|
+
|
95
|
+
|
96
|
+
<div id="validator-badges">
|
97
|
+
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
98
|
+
</div>
|
99
|
+
|
100
|
+
</body>
|
101
|
+
</html>
|