Package not found. Please check the package name and try again.
icalendar 0.97 → 0.98
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/Rakefile +2 -2
- data/docs/api/classes/Icalendar/Component.src/M000029.html +1 -1
- data/docs/api/classes/Icalendar/Component.src/M000030.html +1 -1
- data/docs/api/classes/Icalendar/Component.src/M000035.html +1 -1
- data/docs/api/classes/Icalendar/Component.src/M000040.html +1 -1
- data/docs/api/classes/Icalendar/Component.src/M000041.html +1 -1
- data/docs/api/classes/Icalendar/Component.src/M000042.html +1 -1
- data/docs/api/classes/Icalendar/Component.src/M000043.html +9 -4
- data/docs/api/classes/Icalendar/Component.src/M000044.html +1 -1
- data/docs/api/classes/Icalendar/Component.src/M000045.html +1 -1
- data/docs/api/classes/Icalendar/Component.src/M000046.html +1 -1
- data/docs/api/classes/Icalendar/Component.src/M000047.html +1 -1
- data/docs/api/classes/Icalendar/Component.src/M000048.html +1 -1
- data/docs/api/classes/Icalendar/Component.src/M000049.html +1 -1
- data/docs/api/classes/Icalendar/Component.src/M000050.html +1 -1
- data/docs/api/classes/Icalendar/Geo.html +2 -2
- data/docs/api/classes/Icalendar/Geo.src/M000024.html +1 -1
- data/docs/api/classes/Icalendar/Geo.src/M000025.html +1 -1
- data/docs/api/classes/String.src/M000012.html +1 -1
- data/docs/api/created.rid +1 -1
- data/docs/api/files/lib/icalendar/component_rb.html +1 -1
- data/docs/api/files/lib/icalendar/conversions_rb.html +1 -1
- data/docs/api/files/lib/icalendar/parser_rb.html +1 -1
- data/lib/icalendar/component.rb +10 -3
- data/lib/icalendar/conversions.rb +1 -1
- data/lib/icalendar/parser.rb +1 -1
- data/test/conversions_test.rb +35 -4
- data/test/fixtures/folding.ics +23 -0
- data/test/{life.ics → fixtures/life.ics} +0 -0
- data/test/{simplecal.ics → fixtures/simplecal.ics} +0 -0
- data/test/{single_event.ics → fixtures/single_event.ics} +1 -1
- data/test/parser_test.rb +2 -2
- metadata +7 -44
- data/test/coverage/-home-rosejn-projects-icalendar-lib-hash_attrs_rb.html +0 -574
- data/test/coverage/-home-rosejn-projects-icalendar-lib-icalendar-base_rb.html +0 -575
- data/test/coverage/-home-rosejn-projects-icalendar-lib-icalendar-calendar_rb.html +0 -629
- data/test/coverage/-home-rosejn-projects-icalendar-lib-icalendar-component-alarm_rb.html +0 -581
- data/test/coverage/-home-rosejn-projects-icalendar-lib-icalendar-component-event_rb.html +0 -658
- data/test/coverage/-home-rosejn-projects-icalendar-lib-icalendar-component-freebusy_rb.html +0 -574
- data/test/coverage/-home-rosejn-projects-icalendar-lib-icalendar-component-journal_rb.html +0 -597
- data/test/coverage/-home-rosejn-projects-icalendar-lib-icalendar-component-timezone_rb.html +0 -625
- data/test/coverage/-home-rosejn-projects-icalendar-lib-icalendar-component-todo_rb.html +0 -600
- data/test/coverage/-home-rosejn-projects-icalendar-lib-icalendar-component_rb.html +0 -924
- data/test/coverage/-home-rosejn-projects-icalendar-lib-icalendar-conversions_rb.html +0 -667
- data/test/coverage/-home-rosejn-projects-icalendar-lib-icalendar-parser_rb.html +0 -938
- data/test/coverage/-home-rosejn-projects-icalendar-lib-icalendar_rb.html +0 -576
- data/test/coverage/-home-rosejn-projects-icalendar-lib-meta_rb.html +0 -572
- data/test/coverage/calendar_test_rb.html +0 -590
- data/test/coverage/component_test_rb.html +0 -602
- data/test/coverage/index.html +0 -1009
- data/test/coverage/lib-hash_attrs_rb.html +0 -574
- data/test/coverage/lib-icalendar-base_rb.html +0 -583
- data/test/coverage/lib-icalendar-calendar_rb.html +0 -631
- data/test/coverage/lib-icalendar-component-alarm_rb.html +0 -581
- data/test/coverage/lib-icalendar-component-event_rb.html +0 -661
- data/test/coverage/lib-icalendar-component-freebusy_rb.html +0 -576
- data/test/coverage/lib-icalendar-component-journal_rb.html +0 -599
- data/test/coverage/lib-icalendar-component-timezone_rb.html +0 -625
- data/test/coverage/lib-icalendar-component-todo_rb.html +0 -602
- data/test/coverage/lib-icalendar-component_rb.html +0 -941
- data/test/coverage/lib-icalendar-conversions_rb.html +0 -673
- data/test/coverage/lib-icalendar-parser_rb.html +0 -916
- data/test/coverage/lib-icalendar_rb.html +0 -576
- data/test/coverage/lib-meta_rb.html +0 -572
- data/test/coverage/parameter_test_rb.html +0 -569
- data/test/coverage/parser_test_rb.html +0 -623
- data/test/coverage/test-calendar_test_rb.html +0 -590
- data/test/coverage/test-component-event_test_rb.html +0 -584
- data/test/coverage/test-component_test_rb.html +0 -606
- data/test/coverage/test-conversions_test_rb.html +0 -603
- data/test/coverage/test-parameter_test_rb.html +0 -569
- 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.
|
|
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,
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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">"#{DateTime.now}_#{rand(999999999)}@#{Socket.gethostname}"</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
|
|
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">""</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
|
|
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">"BEGIN:#{@name.upcase}\r\n"</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
|
|
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">""</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">
|
|
25
|
+
<span class="ruby-identifier">prelude</span> = <span class="ruby-node">"#{key.gsub(/_/, '-').upcase}"</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>)
|
|
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">":#{val.to_ical}
|
|
31
|
+
<span class="ruby-identifier">value</span> = <span class="ruby-node">":#{val.to_ical}"</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">"\\"</span>, <span class="ruby-value str">"\\\\"</span>).<span class="ruby-identifier">gsub</span>(<span class="ruby-value str">"\n"</span>, <span class="ruby-value str">"\\n"</span>).<span class="ruby-identifier">gsub</span>(<span class="ruby-value str">","</span>, <span class="ruby-value str">"\\,"</span>).<span class="ruby-identifier">gsub</span>(<span class="ruby-value str">";"</span>, <span class="ruby-value str">"\\;"</span>)
|
|
34
|
+
<span class="ruby-identifier">s</span> <span class="ruby-operator"><<</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"><<</span> <span class="ruby-value str">"\r\n "</span> <span class="ruby-keyword kw">while</span> <span class="ruby-identifier">escaped</span>.<span class="ruby-identifier">size</span> <span class="ruby-operator">></span> <span class="ruby-constant">MAX_LINE_LENGTH</span>
|
|
35
|
+
<span class="ruby-identifier">s</span> <span class="ruby-operator"><<</span> <span class="ruby-identifier">escaped</span> <span class="ruby-operator"><<</span> <span class="ruby-value str">"\r\n"</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
|
|
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">""</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
|
|
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
|
|
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
|
|
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
|
|
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">"#{property}"</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">"#{alias_name}"</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
|
|
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">"#{property}"</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">"#{plural}"</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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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">"#{@lat.to_ical};#{@long.to_ical}"</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-
|
|
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
|
-
|
|
1
|
+
Tue Jan 23 17:22:37 CET 2007
|
data/lib/icalendar/component.rb
CHANGED
|
@@ -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
|
-
|
|
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}
|
|
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
|
data/lib/icalendar/parser.rb
CHANGED
|
@@ -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 = {}
|
data/test/conversions_test.rb
CHANGED
|
@@ -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-
|
|
20
|
-
CATEGORIES:foo
|
|
21
|
-
GEO:46.01
|
|
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(
|
|
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 "that thing." " +
|
|
87
|
+
"Inspired fans describe it: "lush shimmering vocals, an intricately " +
|
|
88
|
+
"groovin' guitar style, a lyrical beauty rare in a young songwriter," +
|
|
89
|
+
"" and "this soulful blend of everything that feels good." " +
|
|
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 "\;that thing."\; Inspired fans describe it: &qu
|
|
14
|
+
ot\;lush shimmering vocals\, an intricately groovin'\; guitar style\, a
|
|
15
|
+
lyrical beauty rare in a young songwriter\,"\; and "\;this soulful
|
|
16
|
+
blend of everything that feels good."\; 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.
|
|
7
|
-
date:
|
|
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/
|
|
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/
|
|
47
|
-
- test/
|
|
48
|
-
- test/
|
|
49
|
-
- test/
|
|
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
|