icalendar 2.11.0 → 2.11.2

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
  SHA256:
3
- metadata.gz: 8a3ae780c56015cbd4ff657ce042c086038f2f922069fa40eaaeaeedd3b7144c
4
- data.tar.gz: 88d669f06da7a9b91c3c8a92dd08e11e70b8712a2c4b05a752427abc1ed56435
3
+ metadata.gz: 0d1b88e3b63c6a6c5865093d45c296bfc4f0d807922b79bbd071355f5bdf72a2
4
+ data.tar.gz: 2b0e5e61d9dbab1ec76aab2a97bf3055da0ee42bfcb294867e1cba5d60841d17
5
5
  SHA512:
6
- metadata.gz: 250a5156dbb7f7ec7cd7f9fddd51982676d81b5a41ae2815c85b41f3f114e3b3c812c07794463d3563f85a93d8097075a19bb7d37b2ca4694682cc8804ff9be7
7
- data.tar.gz: 11c71867043fd1fd94cc6199e470b9ff4ce55c7c5e2455d0435b46676b4017743cec130de8f5383faf66eee4e28a400b6b807bf76eb1c781fd47604b7276a4c5
6
+ metadata.gz: 070602bed48d0b45c04dc6801944b0f2d8916a67ecc39194ff93a5bc6619aca5eafad06843cb39df72910f9babbe010310dcada5bce1a27d046297586a0d1042
7
+ data.tar.gz: f4e43c98d659fa97b4cffadb0c79ba34ef0ba077d181272747eaf0065301d1b540a3fa5169dcd8d1701a60076f1f748ec8d28a44d1aefaf179197437ecab2958
data/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  ## Unreleased
2
2
 
3
+ ## 2.11.2 - 2025-06-21
4
+ - Deal with more bad value parameter values by falling back to the property default type
5
+
6
+ ## 2.11.1 - 2025-06-06
7
+ - Gracefully deal with malformed ics files that use spaces in the value parameter instead of hyphens
8
+
3
9
  ## 2.11.0 - 2025-04-12
4
10
  - Require gems for ruby 3.4 that used to be in stdlib - Go Sueyoshi
5
11
  - Refactor how timezone offsets are calculated - Pat Allan
@@ -105,7 +105,7 @@ module Icalendar
105
105
  ((multi_property && value =~ WRAP_IN_ARRAY_REGEX_1) || value =~ WRAP_IN_ARRAY_REGEX_2)
106
106
  end
107
107
 
108
- GET_WRAPPER_CLASS_GSUB_REGEX = /(?:\A|-)(.)/.freeze
108
+ GET_WRAPPER_CLASS_GSUB_REGEX = /(?:\A|-|\s+)(.)/.freeze
109
109
 
110
110
  def get_wrapper_class(component, fields)
111
111
  klass = component.class.default_property_types[fields[:name]]
@@ -113,7 +113,12 @@ module Icalendar
113
113
  klass_name = fields[:params].delete('value').first
114
114
  unless klass_name.upcase == klass.value_type
115
115
  klass_name = "Icalendar::Values::#{klass_name.downcase.gsub(GET_WRAPPER_CLASS_GSUB_REGEX) { |m| m[-1].upcase }}"
116
- klass = Object.const_get klass_name if Object.const_defined?(klass_name)
116
+ begin
117
+ klass = Object.const_get klass_name if Object.const_defined?(klass_name)
118
+ rescue NameError => e
119
+ Icalendar.logger.error "NameError trying to find value type for #{component.name} | #{fields[:name]}: #{e.message}"
120
+ raise e if strict?
121
+ end
117
122
  end
118
123
  end
119
124
  klass
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Icalendar
4
4
 
5
- VERSION = '2.11.0'
5
+ VERSION = '2.11.2'
6
6
 
7
7
  end
@@ -0,0 +1,23 @@
1
+ BEGIN:VCALENDAR
2
+ VERSION:2.0
3
+ PRODID:bsprodidfortestabc123
4
+ CALSCALE:GREGORIAN
5
+ BEGIN:VEVENT
6
+ DTSTAMP:20050118T211523Z
7
+ UID:bsuidfortestabc123
8
+ DTSTART;TZID=US-Mountain:20050120T170000
9
+ DTEND;TZID=US-Mountain:20050120T184500
10
+ CLASS:PRIVATE
11
+ GEO:37.386013;-122.0829322
12
+ ORGANIZER;CN="Joe Bob: Magician":mailto:joebob@random.net
13
+ LOCATION;VALUE=1000 MAIN ST EXAMPLE, STATE 12345:1000 Main St Example\, State 12345
14
+ PRIORITY:2
15
+ SUMMARY:This is a really long summary to test the method of unfolding lines
16
+ \, so I'm just going to make it a whole bunch of lines. With a twist: a "
17
+ ö" takes up multiple bytes\, and should be wrapped to the next line.
18
+ ATTACH:http://bush.sucks.org/impeach/him.rhtml
19
+ ATTACH:http://corporations-dominate.existence.net/why.rhtml
20
+ RDATE;TZID=US-Mountain:20050121T170000,20050122T170000
21
+ X-TEST-COMPONENT;QTEST="Hello, World":Shouldn't double double quotes
22
+ END:VEVENT
23
+ END:VCALENDAR
@@ -38,7 +38,7 @@ SEQUENCE:13
38
38
  BEGIN:VALARM
39
39
  X-WR-ALARMUID:6F54CD66-F2A9-491D-8892-7E3209F6A2E4
40
40
  UID:6F54CD66-F2A9-491D-8892-7E3209F6A2E4
41
- TRIGGER;VALUE=DATE-TIME:19760401T005545Z
41
+ TRIGGER;VALUE=DATE TIME:19760401T005545Z
42
42
  ACTION:NONE
43
43
  END:VALARM
44
44
  END:VEVENT
data/spec/parser_spec.rb CHANGED
@@ -116,4 +116,14 @@ describe Icalendar::Parser do
116
116
  expect(event.dtstart).to be_kind_of Icalendar::Values::Date
117
117
  end
118
118
  end
119
+
120
+ describe 'completely bad location value' do
121
+ let(:fn) { 'single_event_bad_location.ics' }
122
+
123
+ it 'falls back to string type for location' do
124
+ event = subject.parse.first.events.first
125
+ expect(event.location).to be_kind_of Icalendar::Values::Text
126
+ expect(event.location.value).to eq "1000 Main St Example, State 12345"
127
+ end
128
+ end
119
129
  end
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: 2.11.0
4
+ version: 2.11.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ryan Ahearn
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2025-04-12 00:00:00.000000000 Z
11
+ date: 2025-06-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: base64
@@ -267,6 +267,7 @@ files:
267
267
  - spec/fixtures/single_event.ics
268
268
  - spec/fixtures/single_event_bad_dtstart.ics
269
269
  - spec/fixtures/single_event_bad_line.ics
270
+ - spec/fixtures/single_event_bad_location.ics
270
271
  - spec/fixtures/single_event_bad_organizer.ics
271
272
  - spec/fixtures/single_event_organizer_parsed.ics
272
273
  - spec/fixtures/timezone.ics
@@ -335,6 +336,7 @@ test_files:
335
336
  - spec/fixtures/single_event.ics
336
337
  - spec/fixtures/single_event_bad_dtstart.ics
337
338
  - spec/fixtures/single_event_bad_line.ics
339
+ - spec/fixtures/single_event_bad_location.ics
338
340
  - spec/fixtures/single_event_bad_organizer.ics
339
341
  - spec/fixtures/single_event_organizer_parsed.ics
340
342
  - spec/fixtures/timezone.ics