icalendar 1.5.2 → 1.5.3

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 840281a09af33da66b8c292c3eedda0aafd3ce60
4
- data.tar.gz: 2f5c282164f680485f8f6cc16dfacc0874e542bb
3
+ metadata.gz: d4db102bf429a3d77d75304d090f6d70dc7583cc
4
+ data.tar.gz: b2026750077bf1f1e710ba8c00f44aec5929f4e7
5
5
  SHA512:
6
- metadata.gz: bf6e5b790341c0f4cf523d08b19b67590d631ab4740246ae2f56fcb486e3261f302d59d6e8ed4eb689fa80b1290c11605e62bfc64f1197c6a8a0013d8ae3390d
7
- data.tar.gz: b52091e873332de047e71bcfbc6b2c75b2f54a01b8c40dc98964c8f850f0ef9b4ae25d4f62368a5018ea5341aac991e351e62c2b9b2ee7f9b6f159717c8c594c
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
-
@@ -11,7 +11,7 @@ require 'logger'
11
11
 
12
12
  module Icalendar #:nodoc:
13
13
 
14
- VERSION = '1.5.2'
14
+ VERSION = '1.5.3'
15
15
 
16
16
  # A simple error class to differentiate iCalendar library exceptions
17
17
  # from ruby language exceptions or others.
@@ -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
- value = ":#{val.to_ical}"
130
- multiline = multiline_property?(property)
131
- if multiline || (!multiline && !excludes.include?(property))
132
- value = escape_chars(value)
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
- ical_multi_property :attach, :attachment, :attachments
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
- ical_multi_property :attach, :attachment, :attachments
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
- ical_multi_property :attach, :attachment, :attachments
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
 
@@ -182,7 +182,7 @@ module Icalendar
182
182
  name = name.downcase
183
183
 
184
184
  # TODO: check to see if there are any more conflicts.
185
- if name == 'class' or name == 'method'
185
+ if name == 'class' or name == 'method' or name == 'name'
186
186
  name = "ip_" + name
187
187
  end
188
188
 
@@ -20,5 +20,6 @@ GEO:37.386013;-122.0829322
20
20
  DTSTART;TZID=US-Mountain:20050120T170000
21
21
  DTEND:20050120T184500
22
22
  DTSTAMP:20050118T211523Z
23
+ NAME:SomeName
23
24
  END:VEVENT
24
25
  END:VCALENDAR
@@ -19,5 +19,6 @@ GEO:37.386013;-122.0829322
19
19
  DTSTART;TZID=US-Mountain:20050120T170000
20
20
  DTEND:20050120T184500
21
21
  DTSTAMP:20050118T211523Z
22
+ NAME:SomeName
22
23
  END:VEVENT
23
24
  END:VCALENDAR
@@ -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.2
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-03-22 00:00:00.000000000 Z
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: '0'
145
+ version: 1.9.3
146
146
  required_rubygems_version: !ruby/object:Gem::Requirement
147
147
  requirements:
148
148
  - - '>='