icalendar 0.96.4 → 0.97

Sign up to get free protection for your applications and to get access to all the features.
Files changed (176) hide show
  1. data/README +66 -53
  2. data/Rakefile +33 -24
  3. data/docs/api/classes/Array.html +9 -11
  4. data/docs/api/classes/Array.src/M000002.html +18 -0
  5. data/docs/api/classes/Date.html +2 -22
  6. data/docs/api/classes/Date.src/M000004.html +29 -0
  7. data/docs/api/classes/DateTime.html +2 -43
  8. data/docs/api/classes/DateTime.src/M000005.html +50 -0
  9. data/docs/api/classes/Fixnum.html +2 -11
  10. data/docs/api/classes/Fixnum.src/M000011.html +18 -0
  11. data/docs/api/classes/Float.html +2 -11
  12. data/docs/api/classes/Float.src/M000003.html +18 -0
  13. data/docs/api/classes/HashAttrs.html +15 -60
  14. data/docs/api/classes/HashAttrs.src/M000068.html +26 -0
  15. data/docs/api/classes/HashAttrs.src/M000069.html +27 -0
  16. data/docs/api/classes/HashAttrs.src/M000070.html +19 -0
  17. data/docs/api/classes/Icalendar/Alarm.html +5 -15
  18. data/docs/api/classes/Icalendar/Alarm.src/M000020.html +22 -0
  19. data/docs/api/classes/Icalendar/Base.html +41 -0
  20. data/docs/api/classes/Icalendar/Base.src/M000022.html +18 -0
  21. data/docs/api/classes/Icalendar/Base.src/M000023.html +18 -0
  22. data/docs/api/classes/Icalendar/Calendar.html +116 -116
  23. data/docs/api/classes/Icalendar/Calendar.src/M000054.html +23 -0
  24. data/docs/api/classes/Icalendar/Calendar.src/M000055.html +23 -0
  25. data/docs/api/classes/Icalendar/Calendar.src/M000056.html +18 -0
  26. data/docs/api/classes/Icalendar/Calendar.src/M000057.html +23 -0
  27. data/docs/api/classes/Icalendar/Calendar.src/M000058.html +18 -0
  28. data/docs/api/classes/Icalendar/Calendar.src/M000059.html +23 -0
  29. data/docs/api/classes/Icalendar/Calendar.src/M000060.html +18 -0
  30. data/docs/api/classes/Icalendar/Calendar.src/M000061.html +23 -0
  31. data/docs/api/classes/Icalendar/Calendar.src/M000062.html +18 -0
  32. data/docs/api/classes/Icalendar/Calendar.src/M000063.html +23 -0
  33. data/docs/api/classes/Icalendar/Calendar.src/M000064.html +19 -0
  34. data/docs/api/classes/Icalendar/Component.html +200 -367
  35. data/docs/api/classes/Icalendar/Component.src/M000029.html +22 -0
  36. data/docs/api/classes/Icalendar/Component.src/M000030.html +24 -0
  37. data/docs/api/classes/Icalendar/Component.src/M000035.html +22 -0
  38. data/docs/api/classes/Icalendar/Component.src/M000040.html +18 -0
  39. data/docs/api/classes/Icalendar/Component.src/M000041.html +24 -0
  40. data/docs/api/classes/Icalendar/Component.src/M000042.html +28 -0
  41. data/docs/api/classes/Icalendar/Component.src/M000043.html +37 -0
  42. data/docs/api/classes/Icalendar/Component.src/M000044.html +37 -0
  43. data/docs/api/classes/Icalendar/Component.src/M000045.html +18 -0
  44. data/docs/api/classes/Icalendar/Component.src/M000046.html +18 -0
  45. data/docs/api/classes/Icalendar/Component.src/M000047.html +18 -0
  46. data/docs/api/classes/Icalendar/Component.src/M000048.html +26 -0
  47. data/docs/api/classes/Icalendar/Component.src/M000049.html +29 -0
  48. data/docs/api/classes/Icalendar/Component.src/M000050.html +22 -0
  49. data/docs/api/classes/Icalendar/DateProp.html +2 -12
  50. data/docs/api/classes/Icalendar/DateProp.src/M000013.html +19 -0
  51. data/docs/api/classes/Icalendar/DateProp/ClassMethods.html +2 -59
  52. data/docs/api/classes/Icalendar/DateProp/ClassMethods.src/M000014.html +66 -0
  53. data/docs/api/classes/Icalendar/Daylight.html +5 -14
  54. data/docs/api/classes/Icalendar/Daylight.src/M000051.html +18 -0
  55. data/docs/api/classes/Icalendar/Event.html +30 -37
  56. data/docs/api/classes/Icalendar/Event.src/M000052.html +23 -0
  57. data/docs/api/classes/Icalendar/Event.src/M000053.html +23 -0
  58. data/docs/api/classes/Icalendar/Freebusy.html +5 -14
  59. data/docs/api/classes/Icalendar/Freebusy.src/M000065.html +21 -0
  60. data/docs/api/classes/Icalendar/Geo.html +192 -0
  61. data/docs/api/classes/Icalendar/Geo.src/M000024.html +19 -0
  62. data/docs/api/classes/Icalendar/Geo.src/M000025.html +18 -0
  63. data/docs/api/classes/Icalendar/Journal.html +2 -11
  64. data/docs/api/classes/Icalendar/Journal.src/M000016.html +22 -0
  65. data/docs/api/classes/Icalendar/Parameter.html +5 -23
  66. data/docs/api/classes/Icalendar/Parameter.src/M000066.html +27 -0
  67. data/docs/api/classes/Icalendar/Parser.html +36 -212
  68. data/docs/api/classes/Icalendar/Parser.src/M000017.html +32 -0
  69. data/docs/api/classes/Icalendar/Parser.src/M000018.html +43 -0
  70. data/docs/api/classes/Icalendar/Parser.src/M000019.html +33 -0
  71. data/docs/api/classes/Icalendar/Standard.html +2 -11
  72. data/docs/api/classes/Icalendar/Standard.src/M000015.html +18 -0
  73. data/docs/api/classes/Icalendar/Timezone.html +16 -48
  74. data/docs/api/classes/Icalendar/Timezone.src/M000026.html +19 -0
  75. data/docs/api/classes/Icalendar/Timezone.src/M000027.html +22 -0
  76. data/docs/api/classes/Icalendar/Timezone.src/M000028.html +18 -0
  77. data/docs/api/classes/Icalendar/Todo.html +5 -14
  78. data/docs/api/classes/Icalendar/Todo.src/M000021.html +22 -0
  79. data/docs/api/classes/Object.html +10 -59
  80. data/docs/api/classes/Object.src/M000006.html +20 -0
  81. data/docs/api/classes/Object.src/M000007.html +18 -0
  82. data/docs/api/classes/Object.src/M000008.html +20 -0
  83. data/docs/api/classes/Object.src/M000009.html +18 -0
  84. data/docs/api/classes/Object.src/M000010.html +18 -0
  85. data/docs/api/classes/String.html +2 -11
  86. data/docs/api/classes/String.src/M000012.html +18 -0
  87. data/docs/api/classes/Time.html +2 -26
  88. data/docs/api/classes/Time.src/M000001.html +37 -0
  89. data/docs/api/classes/URI/Generic.html +5 -14
  90. data/docs/api/classes/URI/Generic.src/M000067.html +18 -0
  91. data/docs/api/created.rid +1 -1
  92. data/docs/api/files/COPYING.html +1 -1
  93. data/docs/api/files/GPL.html +1 -1
  94. data/docs/api/files/README.html +76 -64
  95. data/docs/api/files/lib/hash_attrs_rb.html +1 -1
  96. data/docs/api/files/lib/icalendar/base_rb.html +1 -1
  97. data/docs/api/files/lib/icalendar/calendar_rb.html +1 -1
  98. data/docs/api/files/lib/icalendar/component/alarm_rb.html +1 -1
  99. data/docs/api/files/lib/icalendar/component/event_rb.html +1 -1
  100. data/docs/api/files/lib/icalendar/component/freebusy_rb.html +1 -1
  101. data/docs/api/files/lib/icalendar/component/journal_rb.html +1 -1
  102. data/docs/api/files/lib/icalendar/component/timezone_rb.html +1 -1
  103. data/docs/api/files/lib/icalendar/component/todo_rb.html +1 -1
  104. data/docs/api/files/lib/icalendar/component_rb.html +8 -1
  105. data/docs/api/files/lib/icalendar/conversions_rb.html +1 -1
  106. data/docs/api/files/lib/icalendar/helpers_rb.html +1 -1
  107. data/docs/api/files/lib/icalendar/parameter_rb.html +1 -1
  108. data/docs/api/files/lib/icalendar/parser_rb.html +2 -1
  109. data/docs/api/files/lib/icalendar_rb.html +1 -1
  110. data/docs/api/files/lib/meta_rb.html +1 -1
  111. data/docs/api/fr_class_index.html +1 -0
  112. data/docs/api/fr_method_index.html +57 -41
  113. data/docs/rfcs/itip_notes.txt +69 -0
  114. data/examples/create_cal.rb +33 -32
  115. data/examples/parse_cal.rb +2 -2
  116. data/lib/icalendar/base.rb +8 -0
  117. data/lib/icalendar/calendar.rb +32 -3
  118. data/lib/icalendar/component.rb +187 -113
  119. data/lib/icalendar/component/alarm.rb +3 -0
  120. data/lib/icalendar/component/event.rb +9 -3
  121. data/lib/icalendar/component/freebusy.rb +3 -0
  122. data/lib/icalendar/component/journal.rb +4 -0
  123. data/lib/icalendar/component/todo.rb +4 -0
  124. data/lib/icalendar/conversions.rb +7 -1
  125. data/lib/icalendar/parser.rb +68 -90
  126. data/test/calendar_test.rb +32 -8
  127. data/test/component/event_test.rb +4 -7
  128. data/test/component/todo_test.rb +13 -0
  129. data/test/component_test.rb +21 -34
  130. data/test/conversions_test.rb +66 -0
  131. data/test/coverage/-home-rosejn-projects-icalendar-lib-hash_attrs_rb.html +574 -0
  132. data/test/coverage/-home-rosejn-projects-icalendar-lib-icalendar-base_rb.html +575 -0
  133. data/test/coverage/-home-rosejn-projects-icalendar-lib-icalendar-calendar_rb.html +629 -0
  134. data/test/coverage/-home-rosejn-projects-icalendar-lib-icalendar-component-alarm_rb.html +581 -0
  135. data/test/coverage/-home-rosejn-projects-icalendar-lib-icalendar-component-event_rb.html +658 -0
  136. data/test/coverage/-home-rosejn-projects-icalendar-lib-icalendar-component-freebusy_rb.html +574 -0
  137. data/test/coverage/-home-rosejn-projects-icalendar-lib-icalendar-component-journal_rb.html +597 -0
  138. data/test/coverage/-home-rosejn-projects-icalendar-lib-icalendar-component-timezone_rb.html +625 -0
  139. data/test/coverage/-home-rosejn-projects-icalendar-lib-icalendar-component-todo_rb.html +600 -0
  140. data/test/coverage/-home-rosejn-projects-icalendar-lib-icalendar-component_rb.html +924 -0
  141. data/test/coverage/-home-rosejn-projects-icalendar-lib-icalendar-conversions_rb.html +667 -0
  142. data/test/coverage/-home-rosejn-projects-icalendar-lib-icalendar-parser_rb.html +938 -0
  143. data/test/coverage/-home-rosejn-projects-icalendar-lib-icalendar_rb.html +576 -0
  144. data/test/coverage/-home-rosejn-projects-icalendar-lib-meta_rb.html +572 -0
  145. data/test/coverage/calendar_test_rb.html +590 -0
  146. data/test/coverage/component_test_rb.html +602 -0
  147. data/test/coverage/index.html +1009 -0
  148. data/test/coverage/lib-hash_attrs_rb.html +574 -0
  149. data/test/coverage/lib-icalendar-base_rb.html +583 -0
  150. data/test/coverage/lib-icalendar-calendar_rb.html +631 -0
  151. data/test/coverage/lib-icalendar-component-alarm_rb.html +581 -0
  152. data/test/coverage/lib-icalendar-component-event_rb.html +661 -0
  153. data/test/coverage/lib-icalendar-component-freebusy_rb.html +576 -0
  154. data/test/coverage/lib-icalendar-component-journal_rb.html +599 -0
  155. data/test/coverage/lib-icalendar-component-timezone_rb.html +625 -0
  156. data/test/coverage/lib-icalendar-component-todo_rb.html +602 -0
  157. data/test/coverage/lib-icalendar-component_rb.html +941 -0
  158. data/test/coverage/lib-icalendar-conversions_rb.html +673 -0
  159. data/test/coverage/lib-icalendar-parser_rb.html +916 -0
  160. data/test/coverage/lib-icalendar_rb.html +576 -0
  161. data/test/coverage/lib-meta_rb.html +572 -0
  162. data/test/coverage/parameter_test_rb.html +569 -0
  163. data/test/coverage/parser_test_rb.html +623 -0
  164. data/test/coverage/test-calendar_test_rb.html +590 -0
  165. data/test/coverage/test-component-event_test_rb.html +584 -0
  166. data/test/coverage/test-component_test_rb.html +606 -0
  167. data/test/coverage/test-conversions_test_rb.html +603 -0
  168. data/test/coverage/test-parameter_test_rb.html +569 -0
  169. data/test/coverage/test-parser_test_rb.html +624 -0
  170. data/test/interactive.rb +3 -1
  171. data/test/life.ics +46 -1092
  172. data/test/parameter_test.rb +11 -2
  173. data/test/parser_test.rb +12 -11
  174. metadata +259 -126
  175. data/test/old_life.ics +0 -46
  176. data/test/rw.ics +0 -947
@@ -0,0 +1,19 @@
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>
7
+ <head>
8
+ <title>new (Icalendar::Geo)</title>
9
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
10
+ <link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
11
+ </head>
12
+ <body class="standalone-code">
13
+ <pre><span class="ruby-comment cmt"># File lib/icalendar/component.rb, line 17</span>
14
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">lat</span>, <span class="ruby-identifier">long</span>)
15
+ <span class="ruby-ivar">@lat</span> = <span class="ruby-identifier">lat</span>
16
+ <span class="ruby-ivar">@long</span> = <span class="ruby-identifier">long</span>
17
+ <span class="ruby-keyword kw">end</span></pre>
18
+ </body>
19
+ </html>
@@ -0,0 +1,18 @@
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>
7
+ <head>
8
+ <title>to_ical (Icalendar::Geo)</title>
9
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
10
+ <link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
11
+ </head>
12
+ <body class="standalone-code">
13
+ <pre><span class="ruby-comment cmt"># File lib/icalendar/component.rb, line 22</span>
14
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">to_ical</span>
15
+ <span class="ruby-node">&quot;#{@lat.to_ical};#{@long.to_ical}&quot;</span>
16
+ <span class="ruby-keyword kw">end</span></pre>
17
+ </body>
18
+ </html>
@@ -420,22 +420,13 @@ Single properties
420
420
  <a name="M000016"></a>
421
421
 
422
422
  <div class="method-heading">
423
- <a href="#M000016" class="method-signature">
423
+ <a href="Journal.src/M000016.html" target="Code" class="method-signature"
424
+ onclick="popupCode('Journal.src/M000016.html');return false;">
424
425
  <span class="method-name">new</span><span class="method-args">()</span>
425
426
  </a>
426
427
  </div>
427
428
 
428
429
  <div class="method-description">
429
- <p><a class="source-toggle" href="#"
430
- onclick="toggleCode('M000016-source');return false;">[Source]</a></p>
431
- <div class="method-source-code" id="M000016-source">
432
- <pre>
433
- <span class="ruby-comment cmt"># File lib/icalendar/component/journal.rb, line 51</span>
434
- 51: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>()
435
- 52: <span class="ruby-keyword kw">super</span>(<span class="ruby-value str">&quot;VJOURNAL&quot;</span>)
436
- 53: <span class="ruby-keyword kw">end</span>
437
- </pre>
438
- </div>
439
430
  </div>
440
431
  </div>
441
432
 
@@ -0,0 +1,22 @@
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>
7
+ <head>
8
+ <title>new (Icalendar::Journal)</title>
9
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
10
+ <link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
11
+ </head>
12
+ <body class="standalone-code">
13
+ <pre><span class="ruby-comment cmt"># File lib/icalendar/component/journal.rb, line 51</span>
14
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>()
15
+ <span class="ruby-keyword kw">super</span>(<span class="ruby-value str">&quot;VJOURNAL&quot;</span>)
16
+
17
+ <span class="ruby-identifier">sequence</span> <span class="ruby-value">0</span>
18
+ <span class="ruby-identifier">timestamp</span> <span class="ruby-constant">DateTime</span>.<span class="ruby-identifier">now</span>
19
+ <span class="ruby-identifier">uid</span> <span class="ruby-identifier">new_uid</span>
20
+ <span class="ruby-keyword kw">end</span></pre>
21
+ </body>
22
+ </html>
@@ -97,7 +97,7 @@ property value and other attributes.
97
97
  <h3 class="section-bar">Methods</h3>
98
98
 
99
99
  <div class="name-list">
100
- <a href="#M000050">to_s</a>&nbsp;&nbsp;
100
+ <a href="#M000066">to_s</a>&nbsp;&nbsp;
101
101
  </div>
102
102
  </div>
103
103
 
@@ -119,35 +119,17 @@ property value and other attributes.
119
119
  <div id="methods">
120
120
  <h3 class="section-bar">Public Instance methods</h3>
121
121
 
122
- <div id="method-M000050" class="method-detail">
123
- <a name="M000050"></a>
122
+ <div id="method-M000066" class="method-detail">
123
+ <a name="M000066"></a>
124
124
 
125
125
  <div class="method-heading">
126
- <a href="#M000050" class="method-signature">
126
+ <a href="Parameter.src/M000066.html" target="Code" class="method-signature"
127
+ onclick="popupCode('Parameter.src/M000066.html');return false;">
127
128
  <span class="method-name">to_s</span><span class="method-args">()</span>
128
129
  </a>
129
130
  </div>
130
131
 
131
132
  <div class="method-description">
132
- <p><a class="source-toggle" href="#"
133
- onclick="toggleCode('M000050-source');return false;">[Source]</a></p>
134
- <div class="method-source-code" id="M000050-source">
135
- <pre>
136
- <span class="ruby-comment cmt"># File lib/icalendar/parameter.rb, line 19</span>
137
- 19: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">to_s</span>
138
- 20: <span class="ruby-identifier">s</span> = <span class="ruby-value str">&quot;&quot;</span>
139
- 21:
140
- 22: <span class="ruby-identifier">s</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-node">&quot;#{@name}=&quot;</span>
141
- 23: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">is_escapable?</span>
142
- 24: <span class="ruby-identifier">s</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">escape</span>(<span class="ruby-identifier">print_value</span>())
143
- 25: <span class="ruby-keyword kw">else</span>
144
- 26: <span class="ruby-identifier">s</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">print_value</span>
145
- 27: <span class="ruby-keyword kw">end</span>
146
- 28:
147
- 29: <span class="ruby-identifier">s</span>
148
- 30: <span class="ruby-keyword kw">end</span>
149
- </pre>
150
- </div>
151
133
  </div>
152
134
  </div>
153
135
 
@@ -0,0 +1,27 @@
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>
7
+ <head>
8
+ <title>to_s (Icalendar::Parameter)</title>
9
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
10
+ <link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
11
+ </head>
12
+ <body class="standalone-code">
13
+ <pre><span class="ruby-comment cmt"># File lib/icalendar/parameter.rb, line 19</span>
14
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">to_s</span>
15
+ <span class="ruby-identifier">s</span> = <span class="ruby-value str">&quot;&quot;</span>
16
+
17
+ <span class="ruby-identifier">s</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-node">&quot;#{@name}=&quot;</span>
18
+ <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">is_escapable?</span>
19
+ <span class="ruby-identifier">s</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">escape</span>(<span class="ruby-identifier">print_value</span>())
20
+ <span class="ruby-keyword kw">else</span>
21
+ <span class="ruby-identifier">s</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">print_value</span>
22
+ <span class="ruby-keyword kw">end</span>
23
+
24
+ <span class="ruby-identifier">s</span>
25
+ <span class="ruby-keyword kw">end</span></pre>
26
+ </body>
27
+ </html>
@@ -90,8 +90,7 @@
90
90
  <div class="name-list">
91
91
  <a href="#M000017">new</a>&nbsp;&nbsp;
92
92
  <a href="#M000018">next_line</a>&nbsp;&nbsp;
93
- <a href="#M000019">next_line</a>&nbsp;&nbsp;
94
- <a href="#M000020">parse</a>&nbsp;&nbsp;
93
+ <a href="#M000019">parse</a>&nbsp;&nbsp;
95
94
  </div>
96
95
  </div>
97
96
 
@@ -109,50 +108,54 @@
109
108
  <div class="name-list">
110
109
  <table summary="Constants">
111
110
  <tr class="top-aligned-row context-row">
112
- <td class="context-item-name">NAME</td>
111
+ <td class="context-item-name">DATE</td>
113
112
  <td>=</td>
114
- <td class="context-item-value">'[-a-z0-9]+'</td>
113
+ <td class="context-item-value">'(\d\d\d\d)-?(\d\d)-?(\d\d)'</td>
115
114
  <td width="3em">&nbsp;</td>
116
115
  <td class="context-item-desc">
117
- 1*(ALPHA / DIGIT / &quot;=&quot;)
116
+ date = date-fullyear [&quot;-&quot;] date-month [&quot;-&quot;] date-mday
117
+ date-fullyear = 4 DIGIT date-month = 2 DIGIT date-mday = 2 DIGIT
118
118
 
119
119
  </td>
120
120
  </tr>
121
121
  <tr class="top-aligned-row context-row">
122
- <td class="context-item-name">QSTR</td>
122
+ <td class="context-item-name">TIME</td>
123
123
  <td>=</td>
124
- <td class="context-item-value">'&quot;[^&quot;]*&quot;'</td>
124
+ <td class="context-item-value">'(\d\d):?(\d\d):?(\d\d)(\.\d+)?(Z|[-+]\d\d:?\d\d)?'</td>
125
125
  <td width="3em">&nbsp;</td>
126
126
  <td class="context-item-desc">
127
- &lt;&quot;&gt; &lt;Any character except CTLs, DQUOTE&gt; &lt;&quot;&gt;
127
+ time = time-hour [&quot;:&quot;] time-minute [&quot;:&quot;] time-second
128
+ [time-secfrac] [time-zone] time-hour = 2 DIGIT time-minute = 2 DIGIT
129
+ time-second = 2 DIGIT time-secfrac = &quot;,&quot; 1*DIGIT time-zone =
130
+ &quot;Z&quot; / time-numzone time-numzome = sign time-hour [&quot;:&quot;]
131
+ time-minute
128
132
 
129
133
  </td>
130
134
  </tr>
131
135
  <tr class="top-aligned-row context-row">
132
- <td class="context-item-name">PTEXT</td>
136
+ <td class="context-item-name">NAME</td>
133
137
  <td>=</td>
134
- <td class="context-item-value">'[^&quot;;:,]*'</td>
138
+ <td class="context-item-value">'[-a-z0-9]+'</td>
135
139
  <td width="3em">&nbsp;</td>
136
140
  <td class="context-item-desc">
137
- *&lt;Any character except CTLs, DQUOTE, &quot;;&quot;, &quot;:&quot;,
138
- &quot;,&quot;&gt;
141
+ 1*(ALPHA / DIGIT / &quot;=&quot;)
139
142
 
140
143
  </td>
141
144
  </tr>
142
145
  <tr class="top-aligned-row context-row">
143
- <td class="context-item-name">PVALUE</td>
146
+ <td class="context-item-name">QSTR</td>
144
147
  <td>=</td>
145
- <td class="context-item-value">&quot;#{PTEXT}|#{QSTR}&quot;</td>
148
+ <td class="context-item-value">'&quot;[^&quot;]*&quot;'</td>
146
149
  <td width="3em">&nbsp;</td>
147
150
  <td class="context-item-desc">
148
- param-value = ptext / quoted-string
151
+ &lt;&quot;&gt; &lt;Any character except CTLs, DQUOTE&gt; &lt;&quot;&gt;
149
152
 
150
153
  </td>
151
154
  </tr>
152
155
  <tr class="top-aligned-row context-row">
153
156
  <td class="context-item-name">LINE</td>
154
157
  <td>=</td>
155
- <td class="context-item-value">&quot;(#{NAME})([^:]*)\:(.*)&quot;</td>
158
+ <td class="context-item-value">&quot;(#{NAME})(.*(?:#{QSTR})|(?:[^:]*))\:(.*)&quot;</td>
156
159
  <td width="3em">&nbsp;</td>
157
160
  <td class="context-item-desc">
158
161
  Contentline
@@ -160,37 +163,33 @@ Contentline
160
163
  </td>
161
164
  </tr>
162
165
  <tr class="top-aligned-row context-row">
163
- <td class="context-item-name">PARAM</td>
166
+ <td class="context-item-name">PTEXT</td>
164
167
  <td>=</td>
165
- <td class="context-item-value">&quot;;(#{NAME})(=?)((?:#{PVALUE})(?:,#{PVALUE})*)&quot;</td>
168
+ <td class="context-item-value">'[^&quot;;:,]*'</td>
166
169
  <td width="3em">&nbsp;</td>
167
170
  <td class="context-item-desc">
168
- param = name &quot;=&quot; param-value *(&quot;,&quot; param-value)
171
+ *&lt;Any character except CTLs, DQUOTE, &quot;;&quot;, &quot;:&quot;,
172
+ &quot;,&quot;&gt;
169
173
 
170
174
  </td>
171
175
  </tr>
172
176
  <tr class="top-aligned-row context-row">
173
- <td class="context-item-name">DATE</td>
177
+ <td class="context-item-name">PVALUE</td>
174
178
  <td>=</td>
175
- <td class="context-item-value">'(\d\d\d\d)-?(\d\d)-?(\d\d)'</td>
179
+ <td class="context-item-value">&quot;#{QSTR}|#{PTEXT}&quot;</td>
176
180
  <td width="3em">&nbsp;</td>
177
181
  <td class="context-item-desc">
178
- date = date-fullyear [&quot;-&quot;] date-month [&quot;-&quot;] date-mday
179
- date-fullyear = 4 DIGIT date-month = 2 DIGIT date-mday = 2 DIGIT
182
+ param-value = ptext / quoted-string
180
183
 
181
184
  </td>
182
185
  </tr>
183
186
  <tr class="top-aligned-row context-row">
184
- <td class="context-item-name">TIME</td>
187
+ <td class="context-item-name">PARAM</td>
185
188
  <td>=</td>
186
- <td class="context-item-value">'(\d\d):?(\d\d):?(\d\d)(\.\d+)?(Z|[-+]\d\d:?\d\d)?'</td>
189
+ <td class="context-item-value">&quot;;(#{NAME})(=?)((?:#{PVALUE})(?:,#{PVALUE})*)&quot;</td>
187
190
  <td width="3em">&nbsp;</td>
188
191
  <td class="context-item-desc">
189
- time = time-hour [&quot;:&quot;] time-minute [&quot;:&quot;] time-second
190
- [time-secfrac] [time-zone] time-hour = 2 DIGIT time-minute = 2 DIGIT
191
- time-second = 2 DIGIT time-secfrac = &quot;,&quot; 1*DIGIT time-zone =
192
- &quot;Z&quot; / time-numzone time-numzome = sign time-hour [&quot;:&quot;]
193
- time-minute
192
+ param = name &quot;=&quot; param-value *(&quot;,&quot; param-value)
194
193
 
195
194
  </td>
196
195
  </tr>
@@ -211,101 +210,13 @@ time-minute
211
210
  <a name="M000017"></a>
212
211
 
213
212
  <div class="method-heading">
214
- <a href="#M000017" class="method-signature">
213
+ <a href="Parser.src/M000017.html" target="Code" class="method-signature"
214
+ onclick="popupCode('Parser.src/M000017.html');return false;">
215
215
  <span class="method-name">new</span><span class="method-args">(src)</span>
216
216
  </a>
217
217
  </div>
218
218
 
219
219
  <div class="method-description">
220
- <p><a class="source-toggle" href="#"
221
- onclick="toggleCode('M000017-source');return false;">[Source]</a></p>
222
- <div class="method-source-code" id="M000017-source">
223
- <pre>
224
- <span class="ruby-comment cmt"># File lib/icalendar/parser.rb, line 48</span>
225
- 48: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">src</span>)
226
- 49: <span class="ruby-ivar">@@logger</span>.<span class="ruby-identifier">debug</span>(<span class="ruby-value str">&quot;New Calendar Parser&quot;</span>)
227
- 50:
228
- 51: <span class="ruby-comment cmt"># Setup the parser method hash table</span>
229
- 52: <span class="ruby-identifier">setup_parsers</span>()
230
- 53:
231
- 54: <span class="ruby-comment cmt"># Define the next line method different depending on whether</span>
232
- 55: <span class="ruby-comment cmt"># this is a string or an IO object so we can be efficient about</span>
233
- 56: <span class="ruby-comment cmt"># parsing large files...</span>
234
- 57:
235
- 58: <span class="ruby-comment cmt"># Just do the unfolding work in one shot if its a whole string</span>
236
- 59: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">src</span>.<span class="ruby-identifier">respond_to?</span>(<span class="ruby-identifier">:split</span>)
237
- 60: <span class="ruby-identifier">unfolded</span> = []
238
- 61:
239
- 62: <span class="ruby-comment cmt"># Split into an array of lines, then unfold those into a new array</span>
240
- 63: <span class="ruby-identifier">src</span>.<span class="ruby-identifier">split</span>(<span class="ruby-regexp re">/\r?\n/</span>).<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">line</span><span class="ruby-operator">|</span>
241
- 64:
242
- 65: <span class="ruby-comment cmt"># If it's a continuation line, add it to the last.</span>
243
- 66: <span class="ruby-comment cmt"># If it's an empty line, drop it from the input.</span>
244
- 67: <span class="ruby-keyword kw">if</span>( <span class="ruby-identifier">line</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp re">/^[ \t]/</span> )
245
- 68: <span class="ruby-identifier">unfolded</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">unfolded</span>.<span class="ruby-identifier">pop</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">line</span>[<span class="ruby-value">1</span>, <span class="ruby-identifier">line</span>.<span class="ruby-identifier">size</span><span class="ruby-operator">-</span><span class="ruby-value">1</span>]
246
- 69: <span class="ruby-keyword kw">elsif</span>( <span class="ruby-identifier">line</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp re">/^$/</span> )
247
- 70: <span class="ruby-keyword kw">else</span>
248
- 71: <span class="ruby-identifier">unfolded</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">line</span>
249
- 72: <span class="ruby-keyword kw">end</span>
250
- 73: <span class="ruby-keyword kw">end</span>
251
- 74:
252
- 75: <span class="ruby-ivar">@lines</span> = <span class="ruby-identifier">unfolded</span>
253
- 76: <span class="ruby-ivar">@index</span> = <span class="ruby-value">0</span>
254
- 77:
255
- 78: <span class="ruby-comment cmt"># Now that we are unfolded we can just iterate through the array.</span>
256
- 79: <span class="ruby-comment cmt"># Dynamically define next line for a string.</span>
257
- 80: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">next_line</span>
258
- 81: <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@index</span> <span class="ruby-operator">==</span> <span class="ruby-ivar">@lines</span>.<span class="ruby-identifier">size</span>
259
- 82: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">nil</span>
260
- 83: <span class="ruby-keyword kw">else</span>
261
- 84: <span class="ruby-identifier">line</span> = <span class="ruby-ivar">@lines</span>[<span class="ruby-ivar">@index</span>]
262
- 85: <span class="ruby-ivar">@index</span> <span class="ruby-operator">+=</span> <span class="ruby-value">1</span>
263
- 86: <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">line</span>
264
- 87: <span class="ruby-keyword kw">end</span>
265
- 88: <span class="ruby-keyword kw">end</span>
266
- 89:
267
- 90: <span class="ruby-comment cmt"># If its a file we need to read and unfold on the go to save from reading</span>
268
- 91: <span class="ruby-comment cmt"># large amounts of data into memory.</span>
269
- 92: <span class="ruby-keyword kw">elsif</span> <span class="ruby-identifier">src</span>.<span class="ruby-identifier">respond_to?</span>(<span class="ruby-identifier">:gets</span>)
270
- 93: <span class="ruby-ivar">@file</span> = <span class="ruby-identifier">src</span>
271
- 94: <span class="ruby-ivar">@prev_line</span> = <span class="ruby-identifier">src</span>.<span class="ruby-identifier">gets</span>
272
- 95: <span class="ruby-keyword kw">if</span> <span class="ruby-operator">!</span><span class="ruby-ivar">@prev_line</span>.<span class="ruby-identifier">nil?</span>
273
- 96: <span class="ruby-ivar">@prev_line</span>.<span class="ruby-identifier">chomp!</span>
274
- 97: <span class="ruby-keyword kw">end</span>
275
- 98:
276
- 99: <span class="ruby-comment cmt"># Dynamically define next line for an IO object</span>
277
- 100: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">next_line</span>
278
- 101: <span class="ruby-identifier">line</span> = <span class="ruby-ivar">@prev_line</span>
279
- 102:
280
- 103: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">line</span>.<span class="ruby-identifier">nil?</span>
281
- 104: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">nil</span>
282
- 105: <span class="ruby-keyword kw">end</span>
283
- 106:
284
- 107: <span class="ruby-comment cmt"># Loop through until we get to a non-continuation line...</span>
285
- 108: <span class="ruby-identifier">loop</span> <span class="ruby-keyword kw">do</span>
286
- 109: <span class="ruby-identifier">nextLine</span> = <span class="ruby-ivar">@file</span>.<span class="ruby-identifier">gets</span>
287
- 110: <span class="ruby-keyword kw">if</span> <span class="ruby-operator">!</span><span class="ruby-identifier">nextLine</span>.<span class="ruby-identifier">nil?</span>
288
- 111: <span class="ruby-identifier">nextLine</span>.<span class="ruby-identifier">chomp!</span>
289
- 112: <span class="ruby-keyword kw">end</span>
290
- 113:
291
- 114: <span class="ruby-comment cmt"># If it's a continuation line, add it to the last.</span>
292
- 115: <span class="ruby-comment cmt"># If it's an empty line, drop it from the input.</span>
293
- 116: <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> )
294
- 117: <span class="ruby-identifier">line</span> <span class="ruby-operator">&lt;&lt;</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>]
295
- 118: <span class="ruby-keyword kw">elsif</span>( <span class="ruby-identifier">nextLine</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp re">/^$/</span> )
296
- 119: <span class="ruby-keyword kw">else</span>
297
- 120: <span class="ruby-ivar">@prev_line</span> = <span class="ruby-identifier">nextLine</span>
298
- 121: <span class="ruby-keyword kw">break</span>
299
- 122: <span class="ruby-keyword kw">end</span>
300
- 123: <span class="ruby-keyword kw">end</span>
301
- 124: <span class="ruby-identifier">line</span>
302
- 125: <span class="ruby-keyword kw">end</span>
303
- 126: <span class="ruby-keyword kw">else</span>
304
- 127: <span class="ruby-identifier">raise</span> <span class="ruby-constant">ArgumentError</span>, <span class="ruby-node">&quot;CalendarParser.new cannot be called with a #{src.class} type!&quot;</span>
305
- 128: <span class="ruby-keyword kw">end</span>
306
- 129: <span class="ruby-keyword kw">end</span>
307
- </pre>
308
- </div>
309
220
  </div>
310
221
  </div>
311
222
 
@@ -315,32 +226,16 @@ time-minute
315
226
  <a name="M000018"></a>
316
227
 
317
228
  <div class="method-heading">
318
- <a href="#M000018" class="method-signature">
229
+ <a href="Parser.src/M000018.html" target="Code" class="method-signature"
230
+ onclick="popupCode('Parser.src/M000018.html');return false;">
319
231
  <span class="method-name">next_line</span><span class="method-args">()</span>
320
232
  </a>
321
233
  </div>
322
234
 
323
235
  <div class="method-description">
324
236
  <p>
325
- Now that we are unfolded we can just iterate through the array. Dynamically
326
- define next line for a string.
237
+ Define next line for an IO object. Works for strings now with StringIO
327
238
  </p>
328
- <p><a class="source-toggle" href="#"
329
- onclick="toggleCode('M000018-source');return false;">[Source]</a></p>
330
- <div class="method-source-code" id="M000018-source">
331
- <pre>
332
- <span class="ruby-comment cmt"># File lib/icalendar/parser.rb, line 80</span>
333
- 80: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">next_line</span>
334
- 81: <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@index</span> <span class="ruby-operator">==</span> <span class="ruby-ivar">@lines</span>.<span class="ruby-identifier">size</span>
335
- 82: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">nil</span>
336
- 83: <span class="ruby-keyword kw">else</span>
337
- 84: <span class="ruby-identifier">line</span> = <span class="ruby-ivar">@lines</span>[<span class="ruby-ivar">@index</span>]
338
- 85: <span class="ruby-ivar">@index</span> <span class="ruby-operator">+=</span> <span class="ruby-value">1</span>
339
- 86: <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">line</span>
340
- 87: <span class="ruby-keyword kw">end</span>
341
- 88: <span class="ruby-keyword kw">end</span>
342
- </pre>
343
- </div>
344
239
  </div>
345
240
  </div>
346
241
 
@@ -348,56 +243,8 @@ define next line for a string.
348
243
  <a name="M000019"></a>
349
244
 
350
245
  <div class="method-heading">
351
- <a href="#M000019" class="method-signature">
352
- <span class="method-name">next_line</span><span class="method-args">()</span>
353
- </a>
354
- </div>
355
-
356
- <div class="method-description">
357
- <p>
358
- Dynamically define next line for an IO object
359
- </p>
360
- <p><a class="source-toggle" href="#"
361
- onclick="toggleCode('M000019-source');return false;">[Source]</a></p>
362
- <div class="method-source-code" id="M000019-source">
363
- <pre>
364
- <span class="ruby-comment cmt"># File lib/icalendar/parser.rb, line 100</span>
365
- 100: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">next_line</span>
366
- 101: <span class="ruby-identifier">line</span> = <span class="ruby-ivar">@prev_line</span>
367
- 102:
368
- 103: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">line</span>.<span class="ruby-identifier">nil?</span>
369
- 104: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">nil</span>
370
- 105: <span class="ruby-keyword kw">end</span>
371
- 106:
372
- 107: <span class="ruby-comment cmt"># Loop through until we get to a non-continuation line...</span>
373
- 108: <span class="ruby-identifier">loop</span> <span class="ruby-keyword kw">do</span>
374
- 109: <span class="ruby-identifier">nextLine</span> = <span class="ruby-ivar">@file</span>.<span class="ruby-identifier">gets</span>
375
- 110: <span class="ruby-keyword kw">if</span> <span class="ruby-operator">!</span><span class="ruby-identifier">nextLine</span>.<span class="ruby-identifier">nil?</span>
376
- 111: <span class="ruby-identifier">nextLine</span>.<span class="ruby-identifier">chomp!</span>
377
- 112: <span class="ruby-keyword kw">end</span>
378
- 113:
379
- 114: <span class="ruby-comment cmt"># If it's a continuation line, add it to the last.</span>
380
- 115: <span class="ruby-comment cmt"># If it's an empty line, drop it from the input.</span>
381
- 116: <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> )
382
- 117: <span class="ruby-identifier">line</span> <span class="ruby-operator">&lt;&lt;</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>]
383
- 118: <span class="ruby-keyword kw">elsif</span>( <span class="ruby-identifier">nextLine</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp re">/^$/</span> )
384
- 119: <span class="ruby-keyword kw">else</span>
385
- 120: <span class="ruby-ivar">@prev_line</span> = <span class="ruby-identifier">nextLine</span>
386
- 121: <span class="ruby-keyword kw">break</span>
387
- 122: <span class="ruby-keyword kw">end</span>
388
- 123: <span class="ruby-keyword kw">end</span>
389
- 124: <span class="ruby-identifier">line</span>
390
- 125: <span class="ruby-keyword kw">end</span>
391
- </pre>
392
- </div>
393
- </div>
394
- </div>
395
-
396
- <div id="method-M000020" class="method-detail">
397
- <a name="M000020"></a>
398
-
399
- <div class="method-heading">
400
- <a href="#M000020" class="method-signature">
246
+ <a href="Parser.src/M000019.html" target="Code" class="method-signature"
247
+ onclick="popupCode('Parser.src/M000019.html');return false;">
401
248
  <span class="method-name">parse</span><span class="method-args">()</span>
402
249
  </a>
403
250
  </div>
@@ -406,29 +253,6 @@ Dynamically define next line for an IO object
406
253
  <p>
407
254
  Parse the calendar into an object representation
408
255
  </p>
409
- <p><a class="source-toggle" href="#"
410
- onclick="toggleCode('M000020-source');return false;">[Source]</a></p>
411
- <div class="method-source-code" id="M000020-source">
412
- <pre>
413
- <span class="ruby-comment cmt"># File lib/icalendar/parser.rb, line 132</span>
414
- 132: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">parse</span>
415
- 133: <span class="ruby-identifier">calendars</span> = []
416
- 134:
417
- 135: <span class="ruby-comment cmt"># Outer loop for Calendar objects</span>
418
- 136: <span class="ruby-keyword kw">while</span> (<span class="ruby-identifier">line</span> = <span class="ruby-identifier">next_line</span>)
419
- 137: <span class="ruby-identifier">fields</span> = <span class="ruby-identifier">parse_line</span>(<span class="ruby-identifier">line</span>)
420
- 138:
421
- 139: <span class="ruby-comment cmt"># Just iterate through until we find the beginning of a calendar object</span>
422
- 140: <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">&quot;BEGIN&quot;</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">&quot;VCALENDAR&quot;</span>
423
- 141: <span class="ruby-identifier">cal</span> = <span class="ruby-identifier">parse_component</span>
424
- 142: <span class="ruby-identifier">calendars</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">cal</span>
425
- 143: <span class="ruby-keyword kw">end</span>
426
- 144: <span class="ruby-keyword kw">end</span>
427
- 145:
428
- 146: <span class="ruby-identifier">calendars</span>
429
- 147: <span class="ruby-keyword kw">end</span>
430
- </pre>
431
- </div>
432
256
  </div>
433
257
  </div>
434
258