icalendar 1.1.0 → 1.1.1
Sign up to get free protection for your applications and to get access to all the features.
- data/Rakefile +26 -3
- data/docs/api/classes/Array.html +155 -0
- data/docs/api/classes/Bignum.html +148 -0
- data/docs/api/classes/Date.html +172 -0
- data/docs/api/classes/DateTime.html +200 -0
- data/docs/api/classes/Fixnum.html +148 -0
- data/docs/api/classes/Float.html +148 -0
- data/docs/api/classes/HashAttrs.html +212 -0
- data/docs/api/classes/Icalendar/Alarm.html +228 -0
- data/docs/api/classes/Icalendar/Base.html +179 -0
- data/docs/api/classes/Icalendar/Calendar.html +504 -0
- data/docs/api/classes/Icalendar/Component.html +853 -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/Daylight.html +156 -0
- data/docs/api/classes/Icalendar/Event.html +671 -0
- data/docs/api/classes/Icalendar/Freebusy.html +266 -0
- data/docs/api/classes/Icalendar/Geo.html +211 -0
- data/docs/api/classes/Icalendar/InvalidPropertyValue.html +117 -0
- data/docs/api/classes/Icalendar/Journal.html +443 -0
- data/docs/api/classes/Icalendar/Parameter.html +166 -0
- data/docs/api/classes/Icalendar/Parser.html +352 -0
- data/docs/api/classes/Icalendar/RRule.html +428 -0
- data/docs/api/classes/Icalendar/RRule/Weekday.html +199 -0
- data/docs/api/classes/Icalendar/Standard.html +156 -0
- data/docs/api/classes/Icalendar/Timezone.html +450 -0
- data/docs/api/classes/Icalendar/Todo.html +480 -0
- data/docs/api/classes/Icalendar/TzidSupport.html +118 -0
- data/docs/api/classes/Icalendar/UnknownComponentClass.html +117 -0
- data/docs/api/classes/Icalendar/UnknownPropertyMethod.html +117 -0
- data/docs/api/classes/Object.html +272 -0
- data/docs/api/classes/String.html +148 -0
- data/docs/api/classes/TZInfo.html +119 -0
- data/docs/api/classes/TZInfo/Timezone.html +153 -0
- data/docs/api/classes/TZInfo/TimezonePeriod.html +200 -0
- data/docs/api/classes/TZInfo/TimezoneTransitionInfo.html +229 -0
- data/docs/api/classes/Time.html +180 -0
- data/docs/api/classes/URI.html +111 -0
- data/docs/api/classes/URI/Generic.html +148 -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 +401 -0
- data/docs/api/files/lib/hash_attrs_rb.html +107 -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 +108 -0
- data/docs/api/files/lib/icalendar/conversions_rb.html +109 -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 +110 -0
- data/docs/api/files/lib/icalendar/rrule_rb.html +110 -0
- data/docs/api/files/lib/icalendar/tzinfo_rb.html +101 -0
- data/docs/api/files/lib/icalendar_rb.html +121 -0
- data/docs/api/files/lib/meta_rb.html +107 -0
- data/docs/api/fr_class_index.html +64 -0
- data/docs/api/fr_file_index.html +47 -0
- data/docs/api/fr_method_index.html +123 -0
- data/docs/api/index.html +24 -0
- data/docs/api/rdoc-style.css +208 -0
- data/lib/icalendar.rb +1 -0
- data/lib/icalendar/component.rb +3 -3
- data/lib/icalendar/component/event.rb +1 -1
- data/lib/icalendar/component/freebusy.rb +1 -0
- data/lib/icalendar/conversions.rb +6 -0
- data/lib/icalendar/conversions.rb.orig +144 -0
- data/lib/icalendar/parser.rb +0 -94
- data/lib/icalendar/rrule.rb +133 -0
- data/test/component/timezone_test.rb +1 -1
- data/test/component_test.rb +10 -0
- data/test/conversions_test.rb +4 -4
- data/test/coverage/index.html +272 -0
- data/test/coverage/lib-hash_attrs_rb.html +235 -0
- data/test/coverage/lib-icalendar-base_rb.html +249 -0
- data/test/coverage/lib-icalendar-calendar_rb.html +324 -0
- data/test/coverage/lib-icalendar-component-alarm_rb.html +250 -0
- data/test/coverage/lib-icalendar-component-event_rb.html +353 -0
- data/test/coverage/lib-icalendar-component-freebusy_rb.html +245 -0
- data/test/coverage/lib-icalendar-component-journal_rb.html +278 -0
- data/test/coverage/lib-icalendar-component-timezone_rb.html +326 -0
- data/test/coverage/lib-icalendar-component-todo_rb.html +277 -0
- data/test/coverage/lib-icalendar-component_rb.html +733 -0
- data/test/coverage/lib-icalendar-conversions_rb.html +358 -0
- data/test/coverage/lib-icalendar-parser_rb.html +671 -0
- data/test/coverage/lib-icalendar-rrule_rb.html +357 -0
- data/test/coverage/lib-icalendar_rb.html +243 -0
- data/test/coverage/lib-meta_rb.html +234 -0
- data/test/fixtures/folding.ics +2 -2
- metadata +113 -36
- data/docs/api/STUB +0 -0
@@ -0,0 +1,166 @@
|
|
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>Class: Icalendar::Parameter</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="classHeader">
|
50
|
+
<table class="header-table">
|
51
|
+
<tr class="top-aligned-row">
|
52
|
+
<td><strong>Class</strong></td>
|
53
|
+
<td class="class-name-in-header">Icalendar::Parameter</td>
|
54
|
+
</tr>
|
55
|
+
<tr class="top-aligned-row">
|
56
|
+
<td><strong>In:</strong></td>
|
57
|
+
<td>
|
58
|
+
<a href="../../files/lib/icalendar/parameter_rb.html">
|
59
|
+
lib/icalendar/parameter.rb
|
60
|
+
</a>
|
61
|
+
<br />
|
62
|
+
</td>
|
63
|
+
</tr>
|
64
|
+
|
65
|
+
<tr class="top-aligned-row">
|
66
|
+
<td><strong>Parent:</strong></td>
|
67
|
+
<td>
|
68
|
+
Icalendar::Content
|
69
|
+
</td>
|
70
|
+
</tr>
|
71
|
+
</table>
|
72
|
+
</div>
|
73
|
+
<!-- banner header -->
|
74
|
+
|
75
|
+
<div id="bodyContent">
|
76
|
+
|
77
|
+
|
78
|
+
|
79
|
+
<div id="contextContent">
|
80
|
+
|
81
|
+
<div id="description">
|
82
|
+
<p>
|
83
|
+
A property can have attributes associated with it. These "property
|
84
|
+
parameters" contain meta-information about the property or the
|
85
|
+
property value. Property parameters are provided to specify such
|
86
|
+
information as the location of an alternate text representation for a
|
87
|
+
property value, the language of a text property value, the data type of the
|
88
|
+
property value and other attributes.
|
89
|
+
</p>
|
90
|
+
|
91
|
+
</div>
|
92
|
+
|
93
|
+
|
94
|
+
</div>
|
95
|
+
|
96
|
+
<div id="method-list">
|
97
|
+
<h3 class="section-bar">Methods</h3>
|
98
|
+
|
99
|
+
<div class="name-list">
|
100
|
+
<a href="#M000070">to_s</a>
|
101
|
+
</div>
|
102
|
+
</div>
|
103
|
+
|
104
|
+
</div>
|
105
|
+
|
106
|
+
|
107
|
+
<!-- if includes -->
|
108
|
+
|
109
|
+
<div id="section">
|
110
|
+
|
111
|
+
|
112
|
+
|
113
|
+
|
114
|
+
|
115
|
+
|
116
|
+
|
117
|
+
|
118
|
+
<!-- if method_list -->
|
119
|
+
<div id="methods">
|
120
|
+
<h3 class="section-bar">Public Instance methods</h3>
|
121
|
+
|
122
|
+
<div id="method-M000070" class="method-detail">
|
123
|
+
<a name="M000070"></a>
|
124
|
+
|
125
|
+
<div class="method-heading">
|
126
|
+
<a href="#M000070" class="method-signature">
|
127
|
+
<span class="method-name">to_s</span><span class="method-args">()</span>
|
128
|
+
</a>
|
129
|
+
</div>
|
130
|
+
|
131
|
+
<div class="method-description">
|
132
|
+
<p><a class="source-toggle" href="#"
|
133
|
+
onclick="toggleCode('M000070-source');return false;">[Source]</a></p>
|
134
|
+
<div class="method-source-code" id="M000070-source">
|
135
|
+
<pre>
|
136
|
+
<span class="ruby-comment cmt"># File lib/icalendar/parameter.rb, line 19</span>
|
137
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">to_s</span>
|
138
|
+
<span class="ruby-identifier">s</span> = <span class="ruby-value str">""</span>
|
139
|
+
|
140
|
+
<span class="ruby-identifier">s</span> <span class="ruby-operator"><<</span> <span class="ruby-node">"#{@name}="</span>
|
141
|
+
<span class="ruby-keyword kw">if</span> <span class="ruby-identifier">is_escapable?</span>
|
142
|
+
<span class="ruby-identifier">s</span> <span class="ruby-operator"><<</span> <span class="ruby-identifier">escape</span>(<span class="ruby-identifier">print_value</span>())
|
143
|
+
<span class="ruby-keyword kw">else</span>
|
144
|
+
<span class="ruby-identifier">s</span> <span class="ruby-operator"><<</span> <span class="ruby-identifier">print_value</span>
|
145
|
+
<span class="ruby-keyword kw">end</span>
|
146
|
+
|
147
|
+
<span class="ruby-identifier">s</span>
|
148
|
+
<span class="ruby-keyword kw">end</span>
|
149
|
+
</pre>
|
150
|
+
</div>
|
151
|
+
</div>
|
152
|
+
</div>
|
153
|
+
|
154
|
+
|
155
|
+
</div>
|
156
|
+
|
157
|
+
|
158
|
+
</div>
|
159
|
+
|
160
|
+
|
161
|
+
<div id="validator-badges">
|
162
|
+
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
163
|
+
</div>
|
164
|
+
|
165
|
+
</body>
|
166
|
+
</html>
|
@@ -0,0 +1,352 @@
|
|
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>Class: Icalendar::Parser</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="classHeader">
|
50
|
+
<table class="header-table">
|
51
|
+
<tr class="top-aligned-row">
|
52
|
+
<td><strong>Class</strong></td>
|
53
|
+
<td class="class-name-in-header">Icalendar::Parser</td>
|
54
|
+
</tr>
|
55
|
+
<tr class="top-aligned-row">
|
56
|
+
<td><strong>In:</strong></td>
|
57
|
+
<td>
|
58
|
+
<a href="../../files/lib/icalendar/parser_rb.html">
|
59
|
+
lib/icalendar/parser.rb
|
60
|
+
</a>
|
61
|
+
<br />
|
62
|
+
</td>
|
63
|
+
</tr>
|
64
|
+
|
65
|
+
<tr class="top-aligned-row">
|
66
|
+
<td><strong>Parent:</strong></td>
|
67
|
+
<td>
|
68
|
+
<a href="Base.html">
|
69
|
+
Icalendar::Base
|
70
|
+
</a>
|
71
|
+
</td>
|
72
|
+
</tr>
|
73
|
+
</table>
|
74
|
+
</div>
|
75
|
+
<!-- banner header -->
|
76
|
+
|
77
|
+
<div id="bodyContent">
|
78
|
+
|
79
|
+
|
80
|
+
|
81
|
+
<div id="contextContent">
|
82
|
+
|
83
|
+
|
84
|
+
|
85
|
+
</div>
|
86
|
+
|
87
|
+
<div id="method-list">
|
88
|
+
<h3 class="section-bar">Methods</h3>
|
89
|
+
|
90
|
+
<div class="name-list">
|
91
|
+
<a href="#M000027">new</a>
|
92
|
+
<a href="#M000028">next_line</a>
|
93
|
+
<a href="#M000029">parse</a>
|
94
|
+
</div>
|
95
|
+
</div>
|
96
|
+
|
97
|
+
</div>
|
98
|
+
|
99
|
+
|
100
|
+
<!-- if includes -->
|
101
|
+
|
102
|
+
<div id="section">
|
103
|
+
|
104
|
+
|
105
|
+
<div id="constants-list">
|
106
|
+
<h3 class="section-bar">Constants</h3>
|
107
|
+
|
108
|
+
<div class="name-list">
|
109
|
+
<table summary="Constants">
|
110
|
+
<tr class="top-aligned-row context-row">
|
111
|
+
<td class="context-item-name">DATE</td>
|
112
|
+
<td>=</td>
|
113
|
+
<td class="context-item-value">'(\d\d\d\d)-?(\d\d)-?(\d\d)'</td>
|
114
|
+
<td width="3em"> </td>
|
115
|
+
<td class="context-item-desc">
|
116
|
+
date = date-fullyear ["-"] date-month ["-"] date-mday
|
117
|
+
date-fullyear = 4 DIGIT date-month = 2 DIGIT date-mday = 2 DIGIT
|
118
|
+
|
119
|
+
</td>
|
120
|
+
</tr>
|
121
|
+
<tr class="top-aligned-row context-row">
|
122
|
+
<td class="context-item-name">TIME</td>
|
123
|
+
<td>=</td>
|
124
|
+
<td class="context-item-value">'(\d\d):?(\d\d):?(\d\d)(\.\d+)?(Z|[-+]\d\d:?\d\d)?'</td>
|
125
|
+
<td width="3em"> </td>
|
126
|
+
<td class="context-item-desc">
|
127
|
+
time = time-hour [":"] time-minute [":"] time-second
|
128
|
+
[time-secfrac] [time-zone] time-hour = 2 DIGIT time-minute = 2 DIGIT
|
129
|
+
time-second = 2 DIGIT time-secfrac = "," 1*DIGIT time-zone =
|
130
|
+
"Z" / time-numzone time-numzome = sign time-hour [":"]
|
131
|
+
time-minute
|
132
|
+
|
133
|
+
</td>
|
134
|
+
</tr>
|
135
|
+
<tr class="top-aligned-row context-row">
|
136
|
+
<td class="context-item-name">NAME</td>
|
137
|
+
<td>=</td>
|
138
|
+
<td class="context-item-value">'[-a-z0-9]+'</td>
|
139
|
+
<td width="3em"> </td>
|
140
|
+
<td class="context-item-desc">
|
141
|
+
1*(ALPHA / DIGIT / "=")
|
142
|
+
|
143
|
+
</td>
|
144
|
+
</tr>
|
145
|
+
<tr class="top-aligned-row context-row">
|
146
|
+
<td class="context-item-name">QSTR</td>
|
147
|
+
<td>=</td>
|
148
|
+
<td class="context-item-value">'"[^"]*"'</td>
|
149
|
+
<td width="3em"> </td>
|
150
|
+
<td class="context-item-desc">
|
151
|
+
<"> <Any character except CTLs, DQUOTE> <">
|
152
|
+
|
153
|
+
</td>
|
154
|
+
</tr>
|
155
|
+
<tr class="top-aligned-row context-row">
|
156
|
+
<td class="context-item-name">LINE</td>
|
157
|
+
<td>=</td>
|
158
|
+
<td class="context-item-value">"(#{NAME})(.*(?:#{QSTR})|(?:[^:]*))\:(.*)"</td>
|
159
|
+
<td width="3em"> </td>
|
160
|
+
<td class="context-item-desc">
|
161
|
+
Contentline
|
162
|
+
|
163
|
+
</td>
|
164
|
+
</tr>
|
165
|
+
<tr class="top-aligned-row context-row">
|
166
|
+
<td class="context-item-name">PTEXT</td>
|
167
|
+
<td>=</td>
|
168
|
+
<td class="context-item-value">'[^";:,]*'</td>
|
169
|
+
<td width="3em"> </td>
|
170
|
+
<td class="context-item-desc">
|
171
|
+
*<Any character except CTLs, DQUOTE, ";", ":",
|
172
|
+
",">
|
173
|
+
|
174
|
+
</td>
|
175
|
+
</tr>
|
176
|
+
<tr class="top-aligned-row context-row">
|
177
|
+
<td class="context-item-name">PVALUE</td>
|
178
|
+
<td>=</td>
|
179
|
+
<td class="context-item-value">"#{QSTR}|#{PTEXT}"</td>
|
180
|
+
<td width="3em"> </td>
|
181
|
+
<td class="context-item-desc">
|
182
|
+
param-value = ptext / quoted-string
|
183
|
+
|
184
|
+
</td>
|
185
|
+
</tr>
|
186
|
+
<tr class="top-aligned-row context-row">
|
187
|
+
<td class="context-item-name">PARAM</td>
|
188
|
+
<td>=</td>
|
189
|
+
<td class="context-item-value">";(#{NAME})(=?)((?:#{PVALUE})(?:,#{PVALUE})*)"</td>
|
190
|
+
<td width="3em"> </td>
|
191
|
+
<td class="context-item-desc">
|
192
|
+
param = name "=" param-value *("," param-value)
|
193
|
+
|
194
|
+
</td>
|
195
|
+
</tr>
|
196
|
+
</table>
|
197
|
+
</div>
|
198
|
+
</div>
|
199
|
+
|
200
|
+
|
201
|
+
|
202
|
+
|
203
|
+
|
204
|
+
|
205
|
+
<!-- if method_list -->
|
206
|
+
<div id="methods">
|
207
|
+
<h3 class="section-bar">Public Class methods</h3>
|
208
|
+
|
209
|
+
<div id="method-M000027" class="method-detail">
|
210
|
+
<a name="M000027"></a>
|
211
|
+
|
212
|
+
<div class="method-heading">
|
213
|
+
<a href="#M000027" class="method-signature">
|
214
|
+
<span class="method-name">new</span><span class="method-args">(src)</span>
|
215
|
+
</a>
|
216
|
+
</div>
|
217
|
+
|
218
|
+
<div class="method-description">
|
219
|
+
<p><a class="source-toggle" href="#"
|
220
|
+
onclick="toggleCode('M000027-source');return false;">[Source]</a></p>
|
221
|
+
<div class="method-source-code" id="M000027-source">
|
222
|
+
<pre>
|
223
|
+
<span class="ruby-comment cmt"># File lib/icalendar/parser.rb, line 42</span>
|
224
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">src</span>)
|
225
|
+
<span class="ruby-comment cmt"># Setup the parser method hash table</span>
|
226
|
+
<span class="ruby-identifier">setup_parsers</span>()
|
227
|
+
|
228
|
+
<span class="ruby-keyword kw">if</span> <span class="ruby-identifier">src</span>.<span class="ruby-identifier">respond_to?</span>(<span class="ruby-identifier">:gets</span>)
|
229
|
+
<span class="ruby-ivar">@file</span> = <span class="ruby-identifier">src</span>
|
230
|
+
<span class="ruby-keyword kw">elsif</span> (<span class="ruby-keyword kw">not</span> <span class="ruby-identifier">src</span>.<span class="ruby-identifier">nil?</span>) <span class="ruby-keyword kw">and</span> <span class="ruby-identifier">src</span>.<span class="ruby-identifier">respond_to?</span>(<span class="ruby-identifier">:to_s</span>)
|
231
|
+
<span class="ruby-ivar">@file</span> = <span class="ruby-constant">StringIO</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">src</span>.<span class="ruby-identifier">to_s</span>, <span class="ruby-value str">'r'</span>)
|
232
|
+
<span class="ruby-keyword kw">else</span>
|
233
|
+
<span class="ruby-identifier">raise</span> <span class="ruby-constant">ArgumentError</span>, <span class="ruby-node">"CalendarParser.new cannot be called with a #{src.class} type!"</span>
|
234
|
+
<span class="ruby-keyword kw">end</span>
|
235
|
+
|
236
|
+
<span class="ruby-ivar">@prev_line</span> = <span class="ruby-ivar">@file</span>.<span class="ruby-identifier">gets</span>
|
237
|
+
<span class="ruby-ivar">@prev_line</span>.<span class="ruby-identifier">chomp!</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-ivar">@prev_line</span>.<span class="ruby-identifier">nil?</span>
|
238
|
+
|
239
|
+
<span class="ruby-ivar">@@logger</span>.<span class="ruby-identifier">debug</span>(<span class="ruby-node">"New Calendar Parser: #{@file.inspect}"</span>)
|
240
|
+
<span class="ruby-keyword kw">end</span>
|
241
|
+
</pre>
|
242
|
+
</div>
|
243
|
+
</div>
|
244
|
+
</div>
|
245
|
+
|
246
|
+
<h3 class="section-bar">Public Instance methods</h3>
|
247
|
+
|
248
|
+
<div id="method-M000028" class="method-detail">
|
249
|
+
<a name="M000028"></a>
|
250
|
+
|
251
|
+
<div class="method-heading">
|
252
|
+
<a href="#M000028" class="method-signature">
|
253
|
+
<span class="method-name">next_line</span><span class="method-args">()</span>
|
254
|
+
</a>
|
255
|
+
</div>
|
256
|
+
|
257
|
+
<div class="method-description">
|
258
|
+
<p>
|
259
|
+
Define next line for an IO object. Works for strings now with StringIO
|
260
|
+
</p>
|
261
|
+
<p><a class="source-toggle" href="#"
|
262
|
+
onclick="toggleCode('M000028-source');return false;">[Source]</a></p>
|
263
|
+
<div class="method-source-code" id="M000028-source">
|
264
|
+
<pre>
|
265
|
+
<span class="ruby-comment cmt"># File lib/icalendar/parser.rb, line 62</span>
|
266
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">next_line</span>
|
267
|
+
<span class="ruby-identifier">line</span> = <span class="ruby-ivar">@prev_line</span>
|
268
|
+
|
269
|
+
<span class="ruby-keyword kw">if</span> <span class="ruby-identifier">line</span>.<span class="ruby-identifier">nil?</span>
|
270
|
+
<span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">nil</span>
|
271
|
+
<span class="ruby-keyword kw">end</span>
|
272
|
+
|
273
|
+
<span class="ruby-comment cmt"># Loop through until we get to a non-continuation line...</span>
|
274
|
+
<span class="ruby-identifier">loop</span> <span class="ruby-keyword kw">do</span>
|
275
|
+
<span class="ruby-identifier">nextLine</span> = <span class="ruby-ivar">@file</span>.<span class="ruby-identifier">gets</span>
|
276
|
+
<span class="ruby-ivar">@@logger</span>.<span class="ruby-identifier">debug</span> <span class="ruby-node">"new_line: #{nextLine}"</span>
|
277
|
+
|
278
|
+
<span class="ruby-keyword kw">if</span> <span class="ruby-operator">!</span><span class="ruby-identifier">nextLine</span>.<span class="ruby-identifier">nil?</span>
|
279
|
+
<span class="ruby-identifier">nextLine</span>.<span class="ruby-identifier">chomp!</span>
|
280
|
+
<span class="ruby-keyword kw">end</span>
|
281
|
+
|
282
|
+
<span class="ruby-comment cmt"># If it's a continuation line, add it to the last.</span>
|
283
|
+
<span class="ruby-comment cmt"># If it's an empty line, drop it from the input.</span>
|
284
|
+
<span class="ruby-keyword kw">if</span>( <span class="ruby-identifier">nextLine</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp re">/^[ \t]/</span> )
|
285
|
+
<span class="ruby-identifier">line</span> <span class="ruby-operator"><<</span> <span class="ruby-identifier">nextLine</span>[<span class="ruby-value">1</span>, <span class="ruby-identifier">nextLine</span>.<span class="ruby-identifier">size</span>]
|
286
|
+
<span class="ruby-keyword kw">elsif</span>( <span class="ruby-identifier">nextLine</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp re">/^$/</span> )
|
287
|
+
<span class="ruby-keyword kw">else</span>
|
288
|
+
<span class="ruby-ivar">@prev_line</span> = <span class="ruby-identifier">nextLine</span>
|
289
|
+
<span class="ruby-keyword kw">break</span>
|
290
|
+
<span class="ruby-keyword kw">end</span>
|
291
|
+
<span class="ruby-keyword kw">end</span>
|
292
|
+
<span class="ruby-identifier">line</span>
|
293
|
+
<span class="ruby-keyword kw">end</span>
|
294
|
+
</pre>
|
295
|
+
</div>
|
296
|
+
</div>
|
297
|
+
</div>
|
298
|
+
|
299
|
+
<div id="method-M000029" class="method-detail">
|
300
|
+
<a name="M000029"></a>
|
301
|
+
|
302
|
+
<div class="method-heading">
|
303
|
+
<a href="#M000029" class="method-signature">
|
304
|
+
<span class="method-name">parse</span><span class="method-args">()</span>
|
305
|
+
</a>
|
306
|
+
</div>
|
307
|
+
|
308
|
+
<div class="method-description">
|
309
|
+
<p>
|
310
|
+
Parse the calendar into an object representation
|
311
|
+
</p>
|
312
|
+
<p><a class="source-toggle" href="#"
|
313
|
+
onclick="toggleCode('M000029-source');return false;">[Source]</a></p>
|
314
|
+
<div class="method-source-code" id="M000029-source">
|
315
|
+
<pre>
|
316
|
+
<span class="ruby-comment cmt"># File lib/icalendar/parser.rb, line 92</span>
|
317
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">parse</span>
|
318
|
+
<span class="ruby-identifier">calendars</span> = []
|
319
|
+
|
320
|
+
<span class="ruby-ivar">@@logger</span>.<span class="ruby-identifier">debug</span> <span class="ruby-value str">"parsing..."</span>
|
321
|
+
<span class="ruby-comment cmt"># Outer loop for Calendar objects</span>
|
322
|
+
<span class="ruby-keyword kw">while</span> (<span class="ruby-identifier">line</span> = <span class="ruby-identifier">next_line</span>)
|
323
|
+
<span class="ruby-identifier">fields</span> = <span class="ruby-identifier">parse_line</span>(<span class="ruby-identifier">line</span>)
|
324
|
+
|
325
|
+
<span class="ruby-comment cmt"># Just iterate through until we find the beginning of a calendar object</span>
|
326
|
+
<span class="ruby-keyword kw">if</span> <span class="ruby-identifier">fields</span>[<span class="ruby-identifier">:name</span>] <span class="ruby-operator">==</span> <span class="ruby-value str">"BEGIN"</span> <span class="ruby-keyword kw">and</span> <span class="ruby-identifier">fields</span>[<span class="ruby-identifier">:value</span>] <span class="ruby-operator">==</span> <span class="ruby-value str">"VCALENDAR"</span>
|
327
|
+
<span class="ruby-identifier">cal</span> = <span class="ruby-identifier">parse_component</span>
|
328
|
+
<span class="ruby-ivar">@@logger</span>.<span class="ruby-identifier">debug</span> <span class="ruby-value str">"Added parsed calendar..."</span>
|
329
|
+
<span class="ruby-identifier">calendars</span> <span class="ruby-operator"><<</span> <span class="ruby-identifier">cal</span>
|
330
|
+
<span class="ruby-keyword kw">end</span>
|
331
|
+
<span class="ruby-keyword kw">end</span>
|
332
|
+
|
333
|
+
<span class="ruby-identifier">calendars</span>
|
334
|
+
<span class="ruby-keyword kw">end</span>
|
335
|
+
</pre>
|
336
|
+
</div>
|
337
|
+
</div>
|
338
|
+
</div>
|
339
|
+
|
340
|
+
|
341
|
+
</div>
|
342
|
+
|
343
|
+
|
344
|
+
</div>
|
345
|
+
|
346
|
+
|
347
|
+
<div id="validator-badges">
|
348
|
+
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
349
|
+
</div>
|
350
|
+
|
351
|
+
</body>
|
352
|
+
</html>
|