icalendar 1.2.3 → 1.2.4
Sign up to get free protection for your applications and to get access to all the features.
- data/History.txt +4 -0
- data/Rakefile +2 -0
- data/config/website.yml +2 -2
- data/icalendar.gemspec +7 -1
- data/lib/icalendar/base.rb +1 -1
- data/lib/icalendar/component.rb +12 -11
- data/lib/icalendar/conversions.rb +5 -0
- data/test/test_parameter.rb +22 -8
- data/website/index.html +3 -1
- data/website/index.txt +4 -0
- metadata +18 -8
data/History.txt
CHANGED
data/Rakefile
CHANGED
data/config/website.yml
CHANGED
@@ -1,2 +1,2 @@
|
|
1
|
-
host:
|
2
|
-
remote_dir: /var/www/gforge-projects/icalendar
|
1
|
+
host: rcahearn@rubyforge.org
|
2
|
+
remote_dir: /var/www/gforge-projects/icalendar
|
data/icalendar.gemspec
CHANGED
@@ -1,6 +1,11 @@
|
|
1
|
+
$:.push File.expand_path('../lib', __FILE__)
|
2
|
+
require 'icalendar/base'
|
3
|
+
|
1
4
|
Gem::Specification.new do |s|
|
5
|
+
s.authors = ['Ryan Ahearn']
|
6
|
+
|
2
7
|
s.name = "icalendar"
|
3
|
-
s.version =
|
8
|
+
s.version = Icalendar::VERSION
|
4
9
|
|
5
10
|
s.homepage = "http://icalendar.rubyforge.org/"
|
6
11
|
s.platform = Gem::Platform::RUBY
|
@@ -10,5 +15,6 @@ Gem::Specification.new do |s|
|
|
10
15
|
s.add_development_dependency 'hoe', '~> 3.5'
|
11
16
|
s.add_development_dependency 'newgem', '~> 1.5'
|
12
17
|
s.add_development_dependency 'rubyforge', '~> 2.0'
|
18
|
+
s.add_development_dependency 'rdoc', '~> 4.0'
|
13
19
|
end
|
14
20
|
|
data/lib/icalendar/base.rb
CHANGED
data/lib/icalendar/component.rb
CHANGED
@@ -184,8 +184,8 @@ module Icalendar
|
|
184
184
|
unless val.empty?
|
185
185
|
s << "="
|
186
186
|
sep = "" # First entry comes after = sign, but then we need commas
|
187
|
-
val.each do |pval|
|
188
|
-
if pval.respond_to? :to_ical
|
187
|
+
val.each do |pval|
|
188
|
+
if pval.respond_to? :to_ical
|
189
189
|
s << sep << pval.to_ical
|
190
190
|
sep = ","
|
191
191
|
end
|
@@ -228,8 +228,8 @@ module Icalendar
|
|
228
228
|
generate_setter(property, alias_name)
|
229
229
|
generate_query(property, alias_name)
|
230
230
|
end
|
231
|
-
|
232
|
-
# Define a set of methods defining a new property, which
|
231
|
+
|
232
|
+
# Define a set of methods defining a new property, which
|
233
233
|
# supports multiple values for the same property name.
|
234
234
|
def Component.ical_multi_property(property, singular, plural)
|
235
235
|
property = "#{property}".strip.downcase.gsub(/-/, '_')
|
@@ -246,7 +246,7 @@ module Icalendar
|
|
246
246
|
generate_multi_remover(property, singular)
|
247
247
|
end
|
248
248
|
|
249
|
-
# Define a set of methods defining a new property, which
|
249
|
+
# Define a set of methods defining a new property, which
|
250
250
|
# supports multiple values in multiple lines with same property name
|
251
251
|
def Component.ical_multiline_property(property, singular, plural)
|
252
252
|
@@multiline_properties["#{property}"] = true
|
@@ -267,8 +267,9 @@ module Icalendar
|
|
267
267
|
end
|
268
268
|
|
269
269
|
unless params.nil?
|
270
|
+
val = FrozenProxy.new val if val.frozen?
|
270
271
|
# Extend with the parameter methods only if we have to...
|
271
|
-
unless val.respond_to?(:ical_params)
|
272
|
+
unless val.respond_to?(:ical_params)
|
272
273
|
val.class.class_eval { attr_accessor :ical_params }
|
273
274
|
end
|
274
275
|
val.ical_params = params
|
@@ -309,10 +310,10 @@ module Icalendar
|
|
309
310
|
class_eval code, "component.rb", 226
|
310
311
|
|
311
312
|
alias_method("#{alias_name}\?", "#{query}") unless alias_name.nil?
|
312
|
-
end
|
313
|
+
end
|
313
314
|
end
|
314
315
|
|
315
|
-
def Component.generate_multi_getter(property, plural)
|
316
|
+
def Component.generate_multi_getter(property, plural)
|
316
317
|
# Getter for whole array
|
317
318
|
unless instance_methods.include? plural
|
318
319
|
code = <<-code
|
@@ -321,7 +322,7 @@ module Icalendar
|
|
321
322
|
@properties["#{property}"] || []
|
322
323
|
else
|
323
324
|
self.#{plural}=(a)
|
324
|
-
end
|
325
|
+
end
|
325
326
|
end
|
326
327
|
code
|
327
328
|
|
@@ -377,7 +378,7 @@ module Icalendar
|
|
377
378
|
|
378
379
|
unless params.nil?
|
379
380
|
# Extend with the parameter methods only if we have to...
|
380
|
-
unless val.respond_to?(:ical_params)
|
381
|
+
unless val.respond_to?(:ical_params)
|
381
382
|
val.class.class_eval { attr_accessor :ical_params }
|
382
383
|
end
|
383
384
|
val.ical_params = params
|
@@ -392,7 +393,7 @@ module Icalendar
|
|
392
393
|
code
|
393
394
|
|
394
395
|
class_eval code, "component.rb", 289
|
395
|
-
alias_method("add_#{property.downcase}", "#{adder}")
|
396
|
+
alias_method("add_#{property.downcase}", "#{adder}")
|
396
397
|
end
|
397
398
|
end
|
398
399
|
|
data/test/test_parameter.rb
CHANGED
@@ -13,28 +13,42 @@ class TestParameter < Test::Unit::TestCase
|
|
13
13
|
@cal = Icalendar::Calendar.new
|
14
14
|
@event = Icalendar::Event.new
|
15
15
|
end
|
16
|
-
|
16
|
+
|
17
17
|
def test_property_parameters
|
18
18
|
tests = [
|
19
|
-
{"ALTREP" =>['"http://my.language.net"'],
|
19
|
+
{"ALTREP" =>['"http://my.language.net"'],
|
20
20
|
"LANGUAGE" => ["SPANISH"]},
|
21
|
-
{"ALTREP" =>['"http://my.language.net"'],
|
21
|
+
{"ALTREP" =>['"http://my.language.net"'],
|
22
22
|
"LANGUAGE" => ['"SPANISH:CATILLAN"']},
|
23
|
-
{"ALTREP" =>["foo"],
|
23
|
+
{"ALTREP" =>["foo"],
|
24
24
|
"LANGUAGE" => ["SPANISH"]}
|
25
25
|
]
|
26
26
|
|
27
|
-
tests.each do |params|
|
27
|
+
tests.each do |params|
|
28
28
|
@event.summary("This is a test summary.", params)
|
29
|
-
|
29
|
+
|
30
30
|
assert_equal params, @event.summary.ical_params
|
31
|
-
|
31
|
+
|
32
32
|
@cal.add_event @event
|
33
33
|
cal_str = @cal.to_ical
|
34
|
-
|
34
|
+
|
35
35
|
cals = Icalendar::Parser.new(cal_str).parse
|
36
36
|
event = cals.first.events.first
|
37
37
|
assert_equal params, event.summary.ical_params
|
38
38
|
end
|
39
39
|
end
|
40
|
+
|
41
|
+
def test_nonstandard_property_parameters
|
42
|
+
params = {'CUSTOM' => ['yours']}
|
43
|
+
@event.priority(2, params)
|
44
|
+
|
45
|
+
assert_equal params, @event.priority.ical_params
|
46
|
+
|
47
|
+
@cal.add_event @event
|
48
|
+
cal_str = @cal.to_ical
|
49
|
+
|
50
|
+
cals = Icalendar::Parser.new(cal_str).parse
|
51
|
+
event = cals.first.events.first
|
52
|
+
assert_equal params, event.priority.ical_params
|
53
|
+
end
|
40
54
|
end
|
data/website/index.html
CHANGED
@@ -34,13 +34,15 @@
|
|
34
34
|
<div class="sidebar">
|
35
35
|
<div id="version" class="clickable" onclick='document.location = "http://rubyforge.org/projects/icalendar"; return false'>
|
36
36
|
<p>Get Version</p>
|
37
|
-
<a href="http://rubyforge.org/projects/icalendar" class="numbers">1.2.
|
37
|
+
<a href="http://rubyforge.org/projects/icalendar" class="numbers">1.2.3</a>
|
38
38
|
</div>
|
39
39
|
</div>
|
40
40
|
<h2>What</h2>
|
41
41
|
<p>This gem implements the iCalendar specification (<span class="caps">RFC</span>-2445) in Ruby. This allows for the generation and parsing of .ics files, which are used by a variety of calendaring applications.</p>
|
42
42
|
<h2>How</h2>
|
43
43
|
<p>Please see <a href="https://github.com/icalendar/icalendar/blob/master/README.rdoc">the <span class="caps">README</span></a> for more information.</p>
|
44
|
+
<h2>Docs</h2>
|
45
|
+
<p>The best documents are the code, but we’ll attempt to keep the <a href="http://icalendar.rubyforge.org/rdoc">rdoc</a> up to date.</p>
|
44
46
|
<h2>Installing</h2>
|
45
47
|
<p><pre class='syntax'><span class="ident">sudo</span> <span class="ident">gem</span> <span class="ident">install</span> <span class="ident">icalendar</span></pre></p>
|
46
48
|
<h2>How to submit patches</h2>
|
data/website/index.txt
CHANGED
@@ -8,6 +8,10 @@ h2. How
|
|
8
8
|
|
9
9
|
Please see "the README":https://github.com/icalendar/icalendar/blob/master/README.rdoc for more information.
|
10
10
|
|
11
|
+
h2. Docs
|
12
|
+
|
13
|
+
The best documents are the code, but we'll attempt to keep the "rdoc":http://icalendar.rubyforge.org/rdoc up to date.
|
14
|
+
|
11
15
|
h2. Installing
|
12
16
|
|
13
17
|
<pre syntax="ruby">sudo gem install icalendar</pre>
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: icalendar
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.2.
|
4
|
+
version: 1.2.4
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,8 +9,24 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-03-
|
12
|
+
date: 2013-03-27 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
15
|
+
name: rubyforge
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
17
|
+
none: false
|
18
|
+
requirements:
|
19
|
+
- - ! '>='
|
20
|
+
- !ruby/object:Gem::Version
|
21
|
+
version: 2.0.4
|
22
|
+
type: :development
|
23
|
+
prerelease: false
|
24
|
+
version_requirements: !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
26
|
+
requirements:
|
27
|
+
- - ! '>='
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: 2.0.4
|
14
30
|
- !ruby/object:Gem::Dependency
|
15
31
|
name: rdoc
|
16
32
|
requirement: !ruby/object:Gem::Requirement
|
@@ -161,18 +177,12 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
161
177
|
- - ! '>='
|
162
178
|
- !ruby/object:Gem::Version
|
163
179
|
version: '0'
|
164
|
-
segments:
|
165
|
-
- 0
|
166
|
-
hash: -3884597809888146880
|
167
180
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
168
181
|
none: false
|
169
182
|
requirements:
|
170
183
|
- - ! '>='
|
171
184
|
- !ruby/object:Gem::Version
|
172
185
|
version: '0'
|
173
|
-
segments:
|
174
|
-
- 0
|
175
|
-
hash: -3884597809888146880
|
176
186
|
requirements: []
|
177
187
|
rubyforge_project: icalendar
|
178
188
|
rubygems_version: 1.8.25
|