icalendar 1.5.2 → 1.5.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/History.txt +5 -0
- data/icalendar.gemspec +2 -1
- data/lib/icalendar/base.rb +1 -1
- data/lib/icalendar/component.rb +11 -7
- data/lib/icalendar/component/event.rb +3 -1
- data/lib/icalendar/component/journal.rb +1 -2
- data/lib/icalendar/component/todo.rb +3 -3
- data/lib/icalendar/parser.rb +1 -1
- data/test/fixtures/nonstandard.ics +1 -0
- data/test/fixtures/single_event.ics +1 -0
- data/test/test_parameter.rb +18 -0
- data/test/test_parser.rb +1 -0
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d4db102bf429a3d77d75304d090f6d70dc7583cc
|
4
|
+
data.tar.gz: b2026750077bf1f1e710ba8c00f44aec5929f4e7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b4f15e10169c03011e3112d6a7cd1b8119a95e3aed2c36b11f493377f3d803cfeb55f28d444f1eafec90e93666d191097e863c6bb6dd9e30334e2813d8089527
|
7
|
+
data.tar.gz: 16a837818c5bc0de6a95b989caf165407ed4a6f33c8bf26301197a33e4c59bf0c6cb1ee31d0b3ad5783c05431513332d96f7b7cf15b4716ea8a4559f1a177287
|
data/History.txt
CHANGED
@@ -1,3 +1,8 @@
|
|
1
|
+
=== 1.5.3 2014-04-20
|
2
|
+
* Restore printing of parameters on multiline properties
|
3
|
+
* Prevent crash on parsing calendar with NAME properties - Philip Müller
|
4
|
+
* Enforce lack of ruby 1.8.7 support
|
5
|
+
|
1
6
|
=== 1.5.2 2014-02-22
|
2
7
|
* Output timezone components first
|
3
8
|
* Fix undefined local variable or method 'e' - Jason Stirk
|
data/icalendar.gemspec
CHANGED
@@ -22,9 +22,10 @@ Gem::Specification.new do |s|
|
|
22
22
|
s.executables = `git ls-files -- bin/*`.split("\n").map { |f| File.basename f }
|
23
23
|
s.require_paths = ['lib']
|
24
24
|
|
25
|
+
s.required_ruby_version = '>= 1.9.3'
|
26
|
+
|
25
27
|
s.add_development_dependency 'rake', '~> 10.0'
|
26
28
|
s.add_development_dependency 'bundler', '~> 1.3'
|
27
29
|
s.add_development_dependency 'tzinfo', '~> 0.3'
|
28
30
|
s.add_development_dependency 'timecop', '~> 0.6.3'
|
29
31
|
end
|
30
|
-
|
data/lib/icalendar/base.rb
CHANGED
data/lib/icalendar/component.rb
CHANGED
@@ -124,15 +124,19 @@ module Icalendar
|
|
124
124
|
properties.sort.map do |key, val|
|
125
125
|
property = fix_conflict_with_built_in(key)
|
126
126
|
prelude = property.gsub(/_/, '-').upcase
|
127
|
-
params = print_parameters(val)
|
128
127
|
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
128
|
+
if multiline_property? property
|
129
|
+
val.map do |part|
|
130
|
+
params = print_parameters part
|
131
|
+
value = escape_chars ":#{part.to_ical}"
|
132
|
+
chunk_lines "#{prelude}#{params}#{value}"
|
133
|
+
end.join
|
134
|
+
else
|
135
|
+
params = print_parameters val
|
136
|
+
value = ":#{val.to_ical}"
|
137
|
+
value = escape_chars(value) unless excludes.include? property
|
138
|
+
chunk_lines "#{prelude}#{params}#{value}"
|
133
139
|
end
|
134
|
-
|
135
|
-
chunk_lines(prelude + params + value)
|
136
140
|
end.join
|
137
141
|
end
|
138
142
|
|
@@ -21,6 +21,8 @@ module Icalendar
|
|
21
21
|
# Access classification (PUBLIC, PRIVATE, CONFIDENTIAL...)
|
22
22
|
ical_property :ip_class, :klass
|
23
23
|
|
24
|
+
ical_property :ip_name
|
25
|
+
|
24
26
|
# Date & time of creation
|
25
27
|
ical_property :created
|
26
28
|
|
@@ -77,7 +79,7 @@ module Icalendar
|
|
77
79
|
## Multi-instance properties
|
78
80
|
|
79
81
|
# Associates a URI or binary blob with this item
|
80
|
-
|
82
|
+
ical_multiline_property :attach, :attachment, :attachments
|
81
83
|
|
82
84
|
# Defines an attendee for this calendar item
|
83
85
|
ical_multiline_property :attendee, :attendee, :attendees
|
@@ -35,7 +35,7 @@ module Icalendar
|
|
35
35
|
ical_property :recurid, :recurrence_id
|
36
36
|
|
37
37
|
# Multi-properties
|
38
|
-
|
38
|
+
ical_multiline_property :attach, :attachment, :attachments
|
39
39
|
ical_multiline_property :attendee, :attendee, :attendees
|
40
40
|
ical_multi_property :categories, :category, :categories
|
41
41
|
ical_multi_property :comment, :comment, :comments
|
@@ -58,4 +58,3 @@ module Icalendar
|
|
58
58
|
|
59
59
|
end
|
60
60
|
end
|
61
|
-
|
@@ -33,13 +33,13 @@ module Icalendar
|
|
33
33
|
ical_property :summary
|
34
34
|
ical_property :uid, :user_id
|
35
35
|
ical_property :url
|
36
|
-
|
36
|
+
|
37
37
|
# Single but mutually exclusive TODO: not testing anything yet
|
38
38
|
ical_property :due
|
39
39
|
ical_property :duration
|
40
40
|
|
41
41
|
# Multi-properties
|
42
|
-
|
42
|
+
ical_multiline_property :attach, :attachment, :attachments
|
43
43
|
ical_multiline_property :attendee, :attendee, :attendees
|
44
44
|
ical_multi_property :categories, :category, :categories
|
45
45
|
ical_multi_property :comment, :comment, :comments
|
@@ -51,7 +51,7 @@ module Icalendar
|
|
51
51
|
ical_multi_property :resources, :resource, :resources
|
52
52
|
ical_multi_property :rdate, :recurrence_date, :recurrence_dates
|
53
53
|
ical_multi_property :rrule, :recurrence_rule, :recurrence_rules
|
54
|
-
|
54
|
+
|
55
55
|
def initialize()
|
56
56
|
super("VTODO")
|
57
57
|
|
data/lib/icalendar/parser.rb
CHANGED
data/test/test_parameter.rb
CHANGED
@@ -38,6 +38,24 @@ class TestParameter < Test::Unit::TestCase
|
|
38
38
|
end
|
39
39
|
end
|
40
40
|
|
41
|
+
def test_attachment_parameters
|
42
|
+
params = {
|
43
|
+
'ENCODING' => ['BASE64'],
|
44
|
+
'FMTYPE' => ['text/directory'],
|
45
|
+
'VALUE' => ['BINARY'],
|
46
|
+
'X-APPLE-FILENAME' => ['1234.vcf']
|
47
|
+
}
|
48
|
+
@event.add_attachment 'binarystring', params
|
49
|
+
|
50
|
+
assert_equal params, @event.attachments[0].ical_params
|
51
|
+
@cal.add_event @event
|
52
|
+
cal_str = @cal.to_ical
|
53
|
+
|
54
|
+
cals = Icalendar::Parser.new(cal_str).parse
|
55
|
+
event = cals.first.events.first
|
56
|
+
assert_equal params, event.attachments[0].ical_params
|
57
|
+
end
|
58
|
+
|
41
59
|
def test_unquoted_property_parameters
|
42
60
|
params = {'ALTREP' => ['"http://my.language.net"'],
|
43
61
|
'LANGUAGE' => ['SPANISH:CATILLAN'],
|
data/test/test_parser.rb
CHANGED
@@ -74,6 +74,7 @@ class TestIcalendarParser < Test::Unit::TestCase
|
|
74
74
|
|
75
75
|
event = cal.events.first
|
76
76
|
assert_equal("bsuidfortestabc123", event.uid)
|
77
|
+
assert_equal("SomeName", event.ip_name)
|
77
78
|
|
78
79
|
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."
|
79
80
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: icalendar
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.5.
|
4
|
+
version: 1.5.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ryan Ahearn
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-04-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|
@@ -142,7 +142,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
142
142
|
requirements:
|
143
143
|
- - '>='
|
144
144
|
- !ruby/object:Gem::Version
|
145
|
-
version:
|
145
|
+
version: 1.9.3
|
146
146
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
147
147
|
requirements:
|
148
148
|
- - '>='
|