icalendar 0.97 → 0.98

Sign up to get free protection for your applications and to get access to all the features.
Files changed (72) hide show
  1. data/Rakefile +2 -2
  2. data/docs/api/classes/Icalendar/Component.src/M000029.html +1 -1
  3. data/docs/api/classes/Icalendar/Component.src/M000030.html +1 -1
  4. data/docs/api/classes/Icalendar/Component.src/M000035.html +1 -1
  5. data/docs/api/classes/Icalendar/Component.src/M000040.html +1 -1
  6. data/docs/api/classes/Icalendar/Component.src/M000041.html +1 -1
  7. data/docs/api/classes/Icalendar/Component.src/M000042.html +1 -1
  8. data/docs/api/classes/Icalendar/Component.src/M000043.html +9 -4
  9. data/docs/api/classes/Icalendar/Component.src/M000044.html +1 -1
  10. data/docs/api/classes/Icalendar/Component.src/M000045.html +1 -1
  11. data/docs/api/classes/Icalendar/Component.src/M000046.html +1 -1
  12. data/docs/api/classes/Icalendar/Component.src/M000047.html +1 -1
  13. data/docs/api/classes/Icalendar/Component.src/M000048.html +1 -1
  14. data/docs/api/classes/Icalendar/Component.src/M000049.html +1 -1
  15. data/docs/api/classes/Icalendar/Component.src/M000050.html +1 -1
  16. data/docs/api/classes/Icalendar/Geo.html +2 -2
  17. data/docs/api/classes/Icalendar/Geo.src/M000024.html +1 -1
  18. data/docs/api/classes/Icalendar/Geo.src/M000025.html +1 -1
  19. data/docs/api/classes/String.src/M000012.html +1 -1
  20. data/docs/api/created.rid +1 -1
  21. data/docs/api/files/lib/icalendar/component_rb.html +1 -1
  22. data/docs/api/files/lib/icalendar/conversions_rb.html +1 -1
  23. data/docs/api/files/lib/icalendar/parser_rb.html +1 -1
  24. data/lib/icalendar/component.rb +10 -3
  25. data/lib/icalendar/conversions.rb +1 -1
  26. data/lib/icalendar/parser.rb +1 -1
  27. data/test/conversions_test.rb +35 -4
  28. data/test/fixtures/folding.ics +23 -0
  29. data/test/{life.ics → fixtures/life.ics} +0 -0
  30. data/test/{simplecal.ics → fixtures/simplecal.ics} +0 -0
  31. data/test/{single_event.ics → fixtures/single_event.ics} +1 -1
  32. data/test/parser_test.rb +2 -2
  33. metadata +7 -44
  34. data/test/coverage/-home-rosejn-projects-icalendar-lib-hash_attrs_rb.html +0 -574
  35. data/test/coverage/-home-rosejn-projects-icalendar-lib-icalendar-base_rb.html +0 -575
  36. data/test/coverage/-home-rosejn-projects-icalendar-lib-icalendar-calendar_rb.html +0 -629
  37. data/test/coverage/-home-rosejn-projects-icalendar-lib-icalendar-component-alarm_rb.html +0 -581
  38. data/test/coverage/-home-rosejn-projects-icalendar-lib-icalendar-component-event_rb.html +0 -658
  39. data/test/coverage/-home-rosejn-projects-icalendar-lib-icalendar-component-freebusy_rb.html +0 -574
  40. data/test/coverage/-home-rosejn-projects-icalendar-lib-icalendar-component-journal_rb.html +0 -597
  41. data/test/coverage/-home-rosejn-projects-icalendar-lib-icalendar-component-timezone_rb.html +0 -625
  42. data/test/coverage/-home-rosejn-projects-icalendar-lib-icalendar-component-todo_rb.html +0 -600
  43. data/test/coverage/-home-rosejn-projects-icalendar-lib-icalendar-component_rb.html +0 -924
  44. data/test/coverage/-home-rosejn-projects-icalendar-lib-icalendar-conversions_rb.html +0 -667
  45. data/test/coverage/-home-rosejn-projects-icalendar-lib-icalendar-parser_rb.html +0 -938
  46. data/test/coverage/-home-rosejn-projects-icalendar-lib-icalendar_rb.html +0 -576
  47. data/test/coverage/-home-rosejn-projects-icalendar-lib-meta_rb.html +0 -572
  48. data/test/coverage/calendar_test_rb.html +0 -590
  49. data/test/coverage/component_test_rb.html +0 -602
  50. data/test/coverage/index.html +0 -1009
  51. data/test/coverage/lib-hash_attrs_rb.html +0 -574
  52. data/test/coverage/lib-icalendar-base_rb.html +0 -583
  53. data/test/coverage/lib-icalendar-calendar_rb.html +0 -631
  54. data/test/coverage/lib-icalendar-component-alarm_rb.html +0 -581
  55. data/test/coverage/lib-icalendar-component-event_rb.html +0 -661
  56. data/test/coverage/lib-icalendar-component-freebusy_rb.html +0 -576
  57. data/test/coverage/lib-icalendar-component-journal_rb.html +0 -599
  58. data/test/coverage/lib-icalendar-component-timezone_rb.html +0 -625
  59. data/test/coverage/lib-icalendar-component-todo_rb.html +0 -602
  60. data/test/coverage/lib-icalendar-component_rb.html +0 -941
  61. data/test/coverage/lib-icalendar-conversions_rb.html +0 -673
  62. data/test/coverage/lib-icalendar-parser_rb.html +0 -916
  63. data/test/coverage/lib-icalendar_rb.html +0 -576
  64. data/test/coverage/lib-meta_rb.html +0 -572
  65. data/test/coverage/parameter_test_rb.html +0 -569
  66. data/test/coverage/parser_test_rb.html +0 -623
  67. data/test/coverage/test-calendar_test_rb.html +0 -590
  68. data/test/coverage/test-component-event_test_rb.html +0 -584
  69. data/test/coverage/test-component_test_rb.html +0 -606
  70. data/test/coverage/test-conversions_test_rb.html +0 -603
  71. data/test/coverage/test-parameter_test_rb.html +0 -569
  72. data/test/coverage/test-parser_test_rb.html +0 -624
data/Rakefile CHANGED
@@ -5,7 +5,7 @@ require 'rake/rdoctask'
5
5
  require 'rake/clean'
6
6
  require 'rake/contrib/sshpublisher'
7
7
 
8
- PKG_VERSION = "0.97"
8
+ PKG_VERSION = "0.98"
9
9
 
10
10
  $VERBOSE = nil
11
11
  TEST_CHANGES_SINCE = Time.now - 600 # Recent tests = changed in last 10 minutes
@@ -23,7 +23,7 @@ Rake::TestTask.new(:test) { |t|
23
23
  # rcov code coverage
24
24
  rcov_path = '/usr/local/bin/rcov'
25
25
  rcov_test_output = "./test/coverage"
26
- rcov_exclude = "interactive.rb,read_write.rb,single_event.ics,simplecal,life.ics"
26
+ rcov_exclude = "interactive.rb,read_write.rb,fixtures"
27
27
 
28
28
  # Add our created paths to the 'rake clobber' list
29
29
  CLOBBER.include(rcov_test_output)
@@ -10,7 +10,7 @@
10
10
  <link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
11
11
  </head>
12
12
  <body class="standalone-code">
13
- <pre><span class="ruby-comment cmt"># File lib/icalendar/component.rb, line 43</span>
13
+ <pre><span class="ruby-comment cmt"># File lib/icalendar/component.rb, line 45</span>
14
14
  <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">name</span>)
15
15
  <span class="ruby-ivar">@name</span> = <span class="ruby-identifier">name</span>
16
16
  <span class="ruby-ivar">@components</span> = <span class="ruby-constant">Hash</span>.<span class="ruby-identifier">new</span>([])
@@ -10,7 +10,7 @@
10
10
  <link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
11
11
  </head>
12
12
  <body class="standalone-code">
13
- <pre><span class="ruby-comment cmt"># File lib/icalendar/component.rb, line 52</span>
13
+ <pre><span class="ruby-comment cmt"># File lib/icalendar/component.rb, line 54</span>
14
14
  <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">add_component</span>(<span class="ruby-identifier">component</span>)
15
15
  <span class="ruby-identifier">key</span> = (<span class="ruby-identifier">component</span>.<span class="ruby-identifier">class</span>.<span class="ruby-identifier">to_s</span>.<span class="ruby-identifier">downcase</span> <span class="ruby-operator">+</span> <span class="ruby-value str">'s'</span>).<span class="ruby-identifier">gsub</span>(<span class="ruby-value str">'icalendar::'</span>, <span class="ruby-value str">''</span>).<span class="ruby-identifier">to_sym</span>
16
16
 
@@ -10,7 +10,7 @@
10
10
  <link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
11
11
  </head>
12
12
  <body class="standalone-code">
13
- <pre><span class="ruby-comment cmt"># File lib/icalendar/component.rb, line 74</span>
13
+ <pre><span class="ruby-comment cmt"># File lib/icalendar/component.rb, line 76</span>
14
14
  <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">remove_component</span>(<span class="ruby-identifier">component</span>)
15
15
  <span class="ruby-identifier">key</span> = (<span class="ruby-identifier">component</span>.<span class="ruby-identifier">class</span>.<span class="ruby-identifier">to_s</span>.<span class="ruby-identifier">downcase</span> <span class="ruby-operator">+</span> <span class="ruby-value str">'s'</span>).<span class="ruby-identifier">gsub</span>(<span class="ruby-value str">'icalendar::'</span>, <span class="ruby-value str">''</span>).<span class="ruby-identifier">to_sym</span>
16
16
 
@@ -10,7 +10,7 @@
10
10
  <link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
11
11
  </head>
12
12
  <body class="standalone-code">
13
- <pre><span class="ruby-comment cmt"># File lib/icalendar/component.rb, line 95</span>
13
+ <pre><span class="ruby-comment cmt"># File lib/icalendar/component.rb, line 97</span>
14
14
  <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">new_uid</span>
15
15
  <span class="ruby-node">&quot;#{DateTime.now}_#{rand(999999999)}@#{Socket.gethostname}&quot;</span>
16
16
  <span class="ruby-keyword kw">end</span></pre>
@@ -10,7 +10,7 @@
10
10
  <link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
11
11
  </head>
12
12
  <body class="standalone-code">
13
- <pre><span class="ruby-comment cmt"># File lib/icalendar/component.rb, line 100</span>
13
+ <pre><span class="ruby-comment cmt"># File lib/icalendar/component.rb, line 102</span>
14
14
  <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">to_ical</span>
15
15
  <span class="ruby-identifier">print_component</span> <span class="ruby-keyword kw">do</span>
16
16
  <span class="ruby-identifier">s</span> = <span class="ruby-value str">&quot;&quot;</span>
@@ -10,7 +10,7 @@
10
10
  <link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
11
11
  </head>
12
12
  <body class="standalone-code">
13
- <pre><span class="ruby-comment cmt"># File lib/icalendar/component.rb, line 111</span>
13
+ <pre><span class="ruby-comment cmt"># File lib/icalendar/component.rb, line 113</span>
14
14
  <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">print_component</span>
15
15
  <span class="ruby-comment cmt"># Begin a new component</span>
16
16
  <span class="ruby-node">&quot;BEGIN:#{@name.upcase}\r\n&quot;</span> <span class="ruby-operator">+</span>
@@ -10,7 +10,7 @@
10
10
  <link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
11
11
  </head>
12
12
  <body class="standalone-code">
13
- <pre><span class="ruby-comment cmt"># File lib/icalendar/component.rb, line 126</span>
13
+ <pre><span class="ruby-comment cmt"># File lib/icalendar/component.rb, line 128</span>
14
14
  <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">print_properties</span>
15
15
  <span class="ruby-identifier">s</span> = <span class="ruby-value str">&quot;&quot;</span>
16
16
 
@@ -22,13 +22,18 @@
22
22
  <span class="ruby-keyword kw">end</span>
23
23
 
24
24
  <span class="ruby-comment cmt"># Property name</span>
25
- <span class="ruby-identifier">s</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-node">&quot;#{key.upcase}&quot;</span> <span class="ruby-operator">+</span>
25
+ <span class="ruby-identifier">prelude</span> = <span class="ruby-node">&quot;#{key.gsub(/_/, '-').upcase}&quot;</span> <span class="ruby-operator">+</span>
26
26
 
27
27
  <span class="ruby-comment cmt"># Possible parameters</span>
28
- <span class="ruby-identifier">print_parameters</span>(<span class="ruby-identifier">val</span>) <span class="ruby-operator">+</span>
28
+ <span class="ruby-identifier">print_parameters</span>(<span class="ruby-identifier">val</span>)
29
29
 
30
30
  <span class="ruby-comment cmt"># Property value</span>
31
- <span class="ruby-node">&quot;:#{val.to_ical}\r\n&quot;</span>
31
+ <span class="ruby-identifier">value</span> = <span class="ruby-node">&quot;:#{val.to_ical}&quot;</span>
32
+
33
+ <span class="ruby-identifier">escaped</span> = <span class="ruby-identifier">prelude</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">value</span>.<span class="ruby-identifier">gsub</span>(<span class="ruby-value str">&quot;\\&quot;</span>, <span class="ruby-value str">&quot;\\\\&quot;</span>).<span class="ruby-identifier">gsub</span>(<span class="ruby-value str">&quot;\n&quot;</span>, <span class="ruby-value str">&quot;\\n&quot;</span>).<span class="ruby-identifier">gsub</span>(<span class="ruby-value str">&quot;,&quot;</span>, <span class="ruby-value str">&quot;\\,&quot;</span>).<span class="ruby-identifier">gsub</span>(<span class="ruby-value str">&quot;;&quot;</span>, <span class="ruby-value str">&quot;\\;&quot;</span>)
34
+ <span class="ruby-identifier">s</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">escaped</span>.<span class="ruby-identifier">slice!</span>(<span class="ruby-value">0</span>, <span class="ruby-constant">MAX_LINE_LENGTH</span>) <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-value str">&quot;\r\n &quot;</span> <span class="ruby-keyword kw">while</span> <span class="ruby-identifier">escaped</span>.<span class="ruby-identifier">size</span> <span class="ruby-operator">&gt;</span> <span class="ruby-constant">MAX_LINE_LENGTH</span>
35
+ <span class="ruby-identifier">s</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">escaped</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-value str">&quot;\r\n&quot;</span>
36
+ <span class="ruby-identifier">s</span>.<span class="ruby-identifier">gsub!</span>(<span class="ruby-regexp re">/ *$/</span>, <span class="ruby-value str">''</span>)
32
37
  <span class="ruby-keyword kw">end</span>
33
38
 
34
39
  <span class="ruby-identifier">s</span>
@@ -10,7 +10,7 @@
10
10
  <link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
11
11
  </head>
12
12
  <body class="standalone-code">
13
- <pre><span class="ruby-comment cmt"># File lib/icalendar/component.rb, line 150</span>
13
+ <pre><span class="ruby-comment cmt"># File lib/icalendar/component.rb, line 157</span>
14
14
  <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">print_parameters</span>(<span class="ruby-identifier">val</span>)
15
15
  <span class="ruby-identifier">s</span> = <span class="ruby-value str">&quot;&quot;</span>
16
16
  <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">s</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">val</span>.<span class="ruby-identifier">respond_to?</span>(<span class="ruby-identifier">:ical_params</span>) <span class="ruby-keyword kw">and</span> <span class="ruby-keyword kw">not</span> <span class="ruby-identifier">val</span>.<span class="ruby-identifier">ical_params</span>.<span class="ruby-identifier">nil?</span>
@@ -10,7 +10,7 @@
10
10
  <link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
11
11
  </head>
12
12
  <body class="standalone-code">
13
- <pre><span class="ruby-comment cmt"># File lib/icalendar/component.rb, line 176</span>
13
+ <pre><span class="ruby-comment cmt"># File lib/icalendar/component.rb, line 183</span>
14
14
  <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">custom_property</span>(<span class="ruby-identifier">name</span>, <span class="ruby-identifier">value</span>)
15
15
  <span class="ruby-ivar">@properties</span>[<span class="ruby-identifier">name</span>] = <span class="ruby-identifier">value</span>
16
16
  <span class="ruby-keyword kw">end</span></pre>
@@ -10,7 +10,7 @@
10
10
  <link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
11
11
  </head>
12
12
  <body class="standalone-code">
13
- <pre><span class="ruby-comment cmt"># File lib/icalendar/component.rb, line 180</span>
13
+ <pre><span class="ruby-comment cmt"># File lib/icalendar/component.rb, line 187</span>
14
14
  <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">multi_property?</span>(<span class="ruby-identifier">name</span>)
15
15
  <span class="ruby-ivar">@@multi_properties</span>.<span class="ruby-identifier">has_key?</span>(<span class="ruby-identifier">name</span>.<span class="ruby-identifier">downcase</span>)
16
16
  <span class="ruby-keyword kw">end</span></pre>
@@ -10,7 +10,7 @@
10
10
  <link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
11
11
  </head>
12
12
  <body class="standalone-code">
13
- <pre><span class="ruby-comment cmt"># File lib/icalendar/component.rb, line 187</span>
13
+ <pre><span class="ruby-comment cmt"># File lib/icalendar/component.rb, line 194</span>
14
14
  <span class="ruby-keyword kw">def</span> <span class="ruby-constant">Component</span>.<span class="ruby-identifier">ical_component</span>(<span class="ruby-operator">*</span><span class="ruby-identifier">syms</span>)
15
15
  <span class="ruby-identifier">hash_accessor</span> <span class="ruby-identifier">:@components</span>, <span class="ruby-operator">*</span><span class="ruby-identifier">syms</span>
16
16
  <span class="ruby-keyword kw">end</span></pre>
@@ -10,7 +10,7 @@
10
10
  <link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
11
11
  </head>
12
12
  <body class="standalone-code">
13
- <pre><span class="ruby-comment cmt"># File lib/icalendar/component.rb, line 192</span>
13
+ <pre><span class="ruby-comment cmt"># File lib/icalendar/component.rb, line 199</span>
14
14
  <span class="ruby-keyword kw">def</span> <span class="ruby-constant">Component</span>.<span class="ruby-identifier">ical_property</span>(<span class="ruby-identifier">property</span>, <span class="ruby-identifier">alias_name</span> = <span class="ruby-keyword kw">nil</span>, <span class="ruby-identifier">prop_name</span> = <span class="ruby-keyword kw">nil</span>)
15
15
  <span class="ruby-identifier">property</span> = <span class="ruby-node">&quot;#{property}&quot;</span>.<span class="ruby-identifier">strip</span>.<span class="ruby-identifier">downcase</span>
16
16
  <span class="ruby-identifier">alias_name</span> = <span class="ruby-node">&quot;#{alias_name}&quot;</span>.<span class="ruby-identifier">strip</span>.<span class="ruby-identifier">downcase</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">alias_name</span>.<span class="ruby-identifier">nil?</span>
@@ -10,7 +10,7 @@
10
10
  <link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
11
11
  </head>
12
12
  <body class="standalone-code">
13
- <pre><span class="ruby-comment cmt"># File lib/icalendar/component.rb, line 206</span>
13
+ <pre><span class="ruby-comment cmt"># File lib/icalendar/component.rb, line 213</span>
14
14
  <span class="ruby-keyword kw">def</span> <span class="ruby-constant">Component</span>.<span class="ruby-identifier">ical_multi_property</span>(<span class="ruby-identifier">property</span>, <span class="ruby-identifier">singular</span>, <span class="ruby-identifier">plural</span>)
15
15
  <span class="ruby-identifier">property</span> = <span class="ruby-node">&quot;#{property}&quot;</span>.<span class="ruby-identifier">strip</span>.<span class="ruby-identifier">downcase</span>.<span class="ruby-identifier">gsub</span>(<span class="ruby-regexp re">/-/</span>, <span class="ruby-value str">'_'</span>)
16
16
  <span class="ruby-identifier">plural</span> = <span class="ruby-node">&quot;#{plural}&quot;</span>.<span class="ruby-identifier">strip</span>.<span class="ruby-identifier">downcase</span>
@@ -10,7 +10,7 @@
10
10
  <link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
11
11
  </head>
12
12
  <body class="standalone-code">
13
- <pre><span class="ruby-comment cmt"># File lib/icalendar/component.rb, line 408</span>
13
+ <pre><span class="ruby-comment cmt"># File lib/icalendar/component.rb, line 415</span>
14
14
  <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">respond_to?</span>(<span class="ruby-identifier">method_name</span>)
15
15
  <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">method_name</span>.<span class="ruby-identifier">to_s</span>.<span class="ruby-identifier">downcase</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp re">/x_.*/</span>
16
16
  <span class="ruby-keyword kw">super</span>
@@ -109,12 +109,12 @@
109
109
  <table summary="aliases">
110
110
  <tr class="top-aligned-row context-row">
111
111
  <td class="context-item-name">latitude</td>
112
- <td>-&gt;</td>
112
+ <td>-></td>
113
113
  <td class="context-item-value">lat</td>
114
114
  </tr>
115
115
  <tr class="top-aligned-row context-row">
116
116
  <td class="context-item-name">longitude</td>
117
- <td>-&gt;</td>
117
+ <td>-></td>
118
118
  <td class="context-item-value">long</td>
119
119
  </tr>
120
120
  </table>
@@ -10,7 +10,7 @@
10
10
  <link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
11
11
  </head>
12
12
  <body class="standalone-code">
13
- <pre><span class="ruby-comment cmt"># File lib/icalendar/component.rb, line 17</span>
13
+ <pre><span class="ruby-comment cmt"># File lib/icalendar/component.rb, line 19</span>
14
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
15
  <span class="ruby-ivar">@lat</span> = <span class="ruby-identifier">lat</span>
16
16
  <span class="ruby-ivar">@long</span> = <span class="ruby-identifier">long</span>
@@ -10,7 +10,7 @@
10
10
  <link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
11
11
  </head>
12
12
  <body class="standalone-code">
13
- <pre><span class="ruby-comment cmt"># File lib/icalendar/component.rb, line 22</span>
13
+ <pre><span class="ruby-comment cmt"># File lib/icalendar/component.rb, line 24</span>
14
14
  <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">to_ical</span>
15
15
  <span class="ruby-node">&quot;#{@lat.to_ical};#{@long.to_ical}&quot;</span>
16
16
  <span class="ruby-keyword kw">end</span></pre>
@@ -12,7 +12,7 @@
12
12
  <body class="standalone-code">
13
13
  <pre><span class="ruby-comment cmt"># File lib/icalendar/conversions.rb, line 22</span>
14
14
  <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">to_ical</span>
15
- <span class="ruby-node">&quot;#{self}&quot;</span>
15
+ <span class="ruby-keyword kw">self</span>
16
16
  <span class="ruby-keyword kw">end</span></pre>
17
17
  </body>
18
18
  </html>
data/docs/api/created.rid CHANGED
@@ -1 +1 @@
1
- Thu Jul 20 22:04:34 CEST 2006
1
+ Tue Jan 23 17:22:37 CET 2007
@@ -56,7 +56,7 @@
56
56
  </tr>
57
57
  <tr class="top-aligned-row">
58
58
  <td><strong>Last Update:</strong></td>
59
- <td>Thu Jul 20 19:41:55 CEST 2006</td>
59
+ <td>Tue Jan 23 14:44:05 CET 2007</td>
60
60
  </tr>
61
61
  </table>
62
62
  </div>
@@ -56,7 +56,7 @@
56
56
  </tr>
57
57
  <tr class="top-aligned-row">
58
58
  <td><strong>Last Update:</strong></td>
59
- <td>Thu Jul 20 18:08:51 CEST 2006</td>
59
+ <td>Tue Jan 23 14:25:27 CET 2007</td>
60
60
  </tr>
61
61
  </table>
62
62
  </div>
@@ -56,7 +56,7 @@
56
56
  </tr>
57
57
  <tr class="top-aligned-row">
58
58
  <td><strong>Last Update:</strong></td>
59
- <td>Thu Jul 20 15:35:13 CEST 2006</td>
59
+ <td>Tue Jan 23 14:12:41 CET 2007</td>
60
60
  </tr>
61
61
  </table>
62
62
  </div>
@@ -9,6 +9,8 @@
9
9
  module Icalendar
10
10
  require 'socket'
11
11
 
12
+ MAX_LINE_LENGTH = 75
13
+
12
14
  class Geo < Icalendar::Base
13
15
  attr_accessor :latitude, :longitude
14
16
  alias :lat :latitude
@@ -134,13 +136,18 @@ module Icalendar
134
136
  end
135
137
 
136
138
  # Property name
137
- s << "#{key.upcase}" +
139
+ prelude = "#{key.gsub(/_/, '-').upcase}" +
138
140
 
139
141
  # Possible parameters
140
- print_parameters(val) +
142
+ print_parameters(val)
141
143
 
142
144
  # Property value
143
- ":#{val.to_ical}\r\n"
145
+ value = ":#{val.to_ical}"
146
+
147
+ escaped = prelude + value.gsub("\\", "\\\\").gsub("\n", "\\n").gsub(",", "\\,").gsub(";", "\\;")
148
+ s << escaped.slice!(0, MAX_LINE_LENGTH) << "\r\n " while escaped.size > MAX_LINE_LENGTH
149
+ s << escaped << "\r\n"
150
+ s.gsub!(/ *$/, '')
144
151
  end
145
152
 
146
153
  s
@@ -20,7 +20,7 @@ require 'uri/generic'
20
20
 
21
21
  class String
22
22
  def to_ical
23
- "#{self}"
23
+ self
24
24
  end
25
25
  end
26
26
 
@@ -213,7 +213,7 @@ module Icalendar
213
213
 
214
214
  name = $1.upcase # The case insensitive part is upcased for easier comparison...
215
215
  paramslist = $2
216
- value = $3
216
+ value = $3.gsub("\\;", ";").gsub("\\,", ",").gsub("\\n", "\n").gsub("\\\\", "\\")
217
217
 
218
218
  # Parse the parameters
219
219
  params = {}
@@ -14,11 +14,12 @@ VERSION:2.0
14
14
  CALSCALE:GREGORIAN
15
15
  PRODID:iCalendar-Ruby
16
16
  BEGIN:VEVENT
17
+ LAST-MODIFIED:19960817T133000
17
18
  ORGANIZER:mailto:joe@example.com?subject=Ruby
18
19
  UID:foobar
19
- X-TIME_OF_DAY:012034
20
- CATEGORIES:foo,bar,baz
21
- GEO:46.01;8.57
20
+ X-TIME-OF-DAY:111736
21
+ CATEGORIES:foo\\,bar\\,baz
22
+ GEO:46.01\\;8.57
22
23
  DESCRIPTION:desc
23
24
  DTSTART:20060720
24
25
  DTSTAMP:20060720T174052
@@ -46,6 +47,9 @@ EOS
46
47
  categories ["foo", "bar"]
47
48
  add_category "baz"
48
49
 
50
+ # Last Modified
51
+ last_modified DateTime.parse("1996-08-17T13:30:00")
52
+
49
53
  # URI
50
54
  organizer(URI::MailTo.build(['joe@example.com', 'subject=Ruby']))
51
55
 
@@ -56,11 +60,38 @@ EOS
56
60
  timestamp DateTime.parse("2006-07-20T17:40:52+0200")
57
61
 
58
62
  # Time
59
- x_time_of_day Time.at(1234)
63
+ x_time_of_day Time.at(123456)
60
64
 
61
65
  uid "foobar"
62
66
  end
63
67
 
64
68
  assert_equal(RESULT.gsub("\n", "\r\n"), @cal.to_ical)
65
69
  end
70
+
71
+ def test_to_ical_folding
72
+ @cal.x_wr_calname = 'Test Long Description'
73
+
74
+ @cal.event do
75
+ url 'http://test.com/events/644'
76
+ dtend DateTime.parse('20061215T180000')
77
+ dtstart DateTime.parse('20061215T160000')
78
+ timestamp DateTime.parse('20061215T114034')
79
+ seq 0
80
+ uid 'foobar'
81
+ summary 'DigiWorld 2006'
82
+
83
+ description "FULL DETAILS:\nhttp://test.com/events/570\n\n" +
84
+ "Cary Brothers walks the same musical ground as Pete Yorn, Nick Drake, " +
85
+ "Jeff Buckley and others; crafting emotional melodies, with strong vocals " +
86
+ "and thoughtful lyrics. Brett Dennen has &quot;that thing.&quot; " +
87
+ "Inspired fans describe it: &quot;lush shimmering vocals, an intricately " +
88
+ "groovin&#39; guitar style, a lyrical beauty rare in a young songwriter," +
89
+ "&quot; and &quot;this soulful blend of everything that feels good.&quot; " +
90
+ "Rising up around him is music; transcending genres, genders and generations."
91
+ end
92
+
93
+ folded = File.read(File.join(File.dirname(__FILE__), 'fixtures/folding.ics')).gsub("\n", "\r\n")
94
+ assert_equal(folded, @cal.to_ical)
95
+ end
96
+
66
97
  end
@@ -0,0 +1,23 @@
1
+ BEGIN:VCALENDAR
2
+ VERSION:2.0
3
+ CALSCALE:GREGORIAN
4
+ PRODID:iCalendar-Ruby
5
+ X-WR-CALNAME:Test Long Description
6
+ BEGIN:VEVENT
7
+ DTEND:20061215T180000
8
+ URL:http://test.com/events/644
9
+ UID:foobar
10
+ DESCRIPTION:FULL DETAILS:\nhttp://test.com/events/570\n\nCary Brothers walk
11
+ s the same musical ground as Pete Yorn\, Nick Drake\, Jeff Buckley and othe
12
+ rs\; crafting emotional melodies\, with strong vocals and thoughtful lyrics
13
+ . Brett Dennen has &quot\;that thing.&quot\; Inspired fans describe it: &qu
14
+ ot\;lush shimmering vocals\, an intricately groovin&#39\; guitar style\, a
15
+ lyrical beauty rare in a young songwriter\,&quot\; and &quot\;this soulful
16
+ blend of everything that feels good.&quot\; Rising up around him is music\;
17
+ transcending genres\, genders and generations.
18
+ SUMMARY:DigiWorld 2006
19
+ DTSTART:20061215T160000
20
+ DTSTAMP:20061215T114034
21
+ SEQ:0
22
+ END:VEVENT
23
+ END:VCALENDAR
File without changes
File without changes
@@ -7,7 +7,7 @@ ORGANIZER:mailto:joebob@random.net
7
7
  ATTACH:http://bush.sucks.org/impeach/him.rhtml
8
8
  ATTACH:http://corporations-dominate.existence.net/why.rhtml
9
9
  SUMMARY:This is a really long summary
10
- to test the method of unfolding lines
10
+ to test the method of unfolding lines\,
11
11
  so I'm just going to ma
12
12
  ke it
13
13
  a whol
data/test/parser_test.rb CHANGED
@@ -6,7 +6,7 @@ require 'icalendar'
6
6
  # This is a test class for the calendar parser.
7
7
  class TestIcalendarParser < Test::Unit::TestCase
8
8
 
9
- TEST_CAL = File.join(File.dirname(__FILE__), 'single_event.ics')
9
+ TEST_CAL = File.join(File.dirname(__FILE__), 'fixtures', 'single_event.ics')
10
10
 
11
11
  # First make sure that we can run the parser and get back objects.
12
12
  def test_new
@@ -60,7 +60,7 @@ class TestIcalendarParser < Test::Unit::TestCase
60
60
  event = cal.events.first
61
61
  assert_equal("bsuidfortestabc123", event.uid)
62
62
 
63
- summary = "This is a really long summary to test the method of unfolding lines so I'm just going to make it a whole bunch of lines."
63
+ summary = "This is a really long summary to test the method of unfolding lines, so I'm just going to make it a whole bunch of lines."
64
64
 
65
65
  assert_equal(summary, event.summary)
66
66
 
metadata CHANGED
@@ -3,8 +3,8 @@ rubygems_version: 0.9.0
3
3
  specification_version: 1
4
4
  name: icalendar
5
5
  version: !ruby/object:Gem::Version
6
- version: "0.97"
7
- date: 2006-07-20 00:00:00 +02:00
6
+ version: "0.98"
7
+ date: 2007-01-23 00:00:00 +01:00
8
8
  summary: A ruby implementation of the iCalendar specification (RFC-2445).
9
9
  require_paths:
10
10
  - lib
@@ -32,56 +32,19 @@ files:
32
32
  - test/component
33
33
  - test/parameter_test.rb
34
34
  - test/interactive.rb
35
- - test/single_event.ics
36
35
  - test/coverage
37
36
  - test/component_test.rb
38
- - test/simplecal.ics
37
+ - test/fixtures
39
38
  - test/read_write.rb
40
39
  - test/calendar_test.rb
41
- - test/life.ics
42
40
  - test/parser_test.rb
43
41
  - test/conversions_test.rb
44
42
  - test/component/event_test.rb
45
43
  - test/component/todo_test.rb
46
- - test/coverage/index.html
47
- - test/coverage/calendar_test_rb.html
48
- - test/coverage/-home-rosejn-projects-icalendar-lib-icalendar-parser_rb.html
49
- - test/coverage/-home-rosejn-projects-icalendar-lib-icalendar-component-alarm_rb.html
50
- - test/coverage/-home-rosejn-projects-icalendar-lib-icalendar-component-journal_rb.html
51
- - test/coverage/-home-rosejn-projects-icalendar-lib-icalendar-component-timezone_rb.html
52
- - test/coverage/-home-rosejn-projects-icalendar-lib-icalendar-conversions_rb.html
53
- - test/coverage/-home-rosejn-projects-icalendar-lib-icalendar-calendar_rb.html
54
- - test/coverage/-home-rosejn-projects-icalendar-lib-hash_attrs_rb.html
55
- - test/coverage/-home-rosejn-projects-icalendar-lib-meta_rb.html
56
- - test/coverage/-home-rosejn-projects-icalendar-lib-icalendar-base_rb.html
57
- - test/coverage/-home-rosejn-projects-icalendar-lib-icalendar-component-todo_rb.html
58
- - test/coverage/-home-rosejn-projects-icalendar-lib-icalendar_rb.html
59
- - test/coverage/-home-rosejn-projects-icalendar-lib-icalendar-component-freebusy_rb.html
60
- - test/coverage/-home-rosejn-projects-icalendar-lib-icalendar-component-event_rb.html
61
- - test/coverage/-home-rosejn-projects-icalendar-lib-icalendar-component_rb.html
62
- - test/coverage/parameter_test_rb.html
63
- - test/coverage/parser_test_rb.html
64
- - test/coverage/component_test_rb.html
65
- - test/coverage/lib-icalendar-component-journal_rb.html
66
- - test/coverage/lib-icalendar-conversions_rb.html
67
- - test/coverage/lib-icalendar-component-timezone_rb.html
68
- - test/coverage/lib-icalendar-component-event_rb.html
69
- - test/coverage/lib-icalendar_rb.html
70
- - test/coverage/test-component-event_test_rb.html
71
- - test/coverage/lib-icalendar-component-todo_rb.html
72
- - test/coverage/lib-icalendar-component-freebusy_rb.html
73
- - test/coverage/lib-hash_attrs_rb.html
74
- - test/coverage/lib-icalendar-calendar_rb.html
75
- - test/coverage/lib-meta_rb.html
76
- - test/coverage/test-component_test_rb.html
77
- - test/coverage/lib-icalendar-component-alarm_rb.html
78
- - test/coverage/lib-icalendar-parser_rb.html
79
- - test/coverage/test-parameter_test_rb.html
80
- - test/coverage/test-calendar_test_rb.html
81
- - test/coverage/lib-icalendar-component_rb.html
82
- - test/coverage/test-parser_test_rb.html
83
- - test/coverage/lib-icalendar-base_rb.html
84
- - test/coverage/test-conversions_test_rb.html
44
+ - test/fixtures/simplecal.ics
45
+ - test/fixtures/folding.ics
46
+ - test/fixtures/single_event.ics
47
+ - test/fixtures/life.ics
85
48
  - lib/icalendar
86
49
  - lib/hash_attrs.rb
87
50
  - lib/icalendar.rb