icalendar 2.10.0 → 2.10.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4a4c654b36ffe5a09f521ad3c012686f12e582ba5d380242c646334f47153360
4
- data.tar.gz: 184399a11e6e8a39b18ceeef59de8a9b9f7cd581f0c7169cce5c7dca63575e3b
3
+ metadata.gz: 25be453368a5f3878e1914626da23ed5116c8e7835f60bf67c2cf0d87f6766dc
4
+ data.tar.gz: 00163247da24fc8057dcd4e1955f72a709ad3fd668526e35af17004232d4b173
5
5
  SHA512:
6
- metadata.gz: 61837b5d19193d80d72f37edff89290fc2e5ffa0c6b9ee500036de58b0fbd9aacb5e0e9bc9f1a0a4e1ce7a3ad494ed0147e87bf697b54523d8b799e9eaa275fa
7
- data.tar.gz: 00d54cc0ab4b7fc6acf616a537b426d110ddbe65dda1d6ab8ec938ba2df64e87def99023916c6193ab25d1885a2a60e8a1706617ed5a6e0adb5cb34671dae1ec
6
+ metadata.gz: d812eaf1f48875019ce982e7c6fc9ce900a1dccd315ae072867d62407ff8a13fbb0b2dae9e7c0c9b83870e1630fc5c63c09a4d0812eb539f7c8ffb799d5656b1
7
+ data.tar.gz: dcadb2f20833a329b0e4b3845ec2cf41c5b415f739cb34489f8987837892280b888f328dc3e07c6c2aeff6bc5cf5b1db24a9e061993b2868a51cf89444e037e2
@@ -15,11 +15,12 @@ jobs:
15
15
  runs-on: ubuntu-latest
16
16
 
17
17
  strategy:
18
+ fail-fast: false
18
19
  matrix:
19
20
  ruby:
20
- - 3.0.6
21
- - 3.1.4
22
- - 3.2.2
21
+ - 3.1.6
22
+ - 3.2.4
23
+ - 3.3.4
23
24
 
24
25
  steps:
25
26
  - uses: actions/checkout@v4
data/CHANGELOG.md ADDED
@@ -0,0 +1,206 @@
1
+ ## Unreleased
2
+
3
+ ## 2.10.2 - 2024-07-21
4
+ - Raise Icalendar::Parser::ParseError on bad .ics file input instead of RuntimeError - Micah Geisel
5
+ - Remove Ruby 3.0 from the test matrix - still should work for now with ice_cube < 0.17.0
6
+ - Add Ruby 3.3 to the test matrix
7
+ - Move from old History.txt file to modern CHANGELOG.md - Guillaume Briday
8
+
9
+ ## 2.10.1 - 2023-12-01
10
+ - Parsing now handles VTIMEZONE blocks defined after their TZID is used in events and other components
11
+
12
+ ## 2.10.0 - 2023-11-01
13
+ - Add changelog metadata to gemspec - Juri Hahn
14
+ - Attempt to rescue timezone info when given a nonstandard tzid with no VTIMEZONE
15
+ - Move Values classes that shouldn't be directly used into Helpers module
16
+
17
+ ## 2.9.0 - 2023-08-11
18
+ - Always include the VALUE of Event URLs for improved compatibility - Sean Kelley
19
+ - Improved parse performance - Thomas Cannon
20
+ - Add helper methods for other Calendar method verbs
21
+ - bugfix: Require stringio before use in Parser - vwyu
22
+
23
+ ## 2.8.0 - 2022-07-10
24
+ - Fix compatibility with ActiveSupport 7 - Pat Allan
25
+ - Set default action of "DISPLAY" on alarms - Rikson
26
+ - Add license information to gemspec - Robert Reiz
27
+ - Support RFC7986 properties - Daniele Frisanco
28
+
29
+ ## 2.7.1 - 2021-03-14
30
+ - Recover from bad line-wrapping code that splits in the middle of Unicode code points
31
+ - Add a verbose option to the Parser to quiet some of the chattier log entries
32
+
33
+ ## 2.7.0 - 2020-09-12
34
+ - Handle custom component names, with and without X- prefix
35
+ - Fix Component lookup to avoid namespace collisions
36
+
37
+ ## 2.6.1 - 2019-12-07
38
+ - Improve performance when generating large ICS files - Alex Balhatchet
39
+
40
+ ## 2.6.0 - 2019-11-26
41
+ - Improve performance for calculating timezone offsets - Justin Howard
42
+ - Make it possible to de/serialize with Marshal - Pawel Niewiadomski
43
+ - Avoid FrozenError when running with frozen_string_literal
44
+ - Update minimum Ruby version to supported versions
45
+
46
+ ## 2.5.3 - 2019-03-04
47
+ - Improve parsing performance - nehresma
48
+ - Support tzinfo 2.0 - Misty De Meo
49
+
50
+ ## 2.5.2 - 2018-12-08
51
+ - Remove usage of the global TimezoneStore instance, in favor of a local variable in the parser
52
+ - Deprecate TimezoneStore class methods
53
+
54
+ ## 2.5.1 - 2018-10-30
55
+ - Fix usage without ActiveSupport installed.
56
+
57
+ ## 2.5.0 - 2018-09-10
58
+ - Set timezone information from VTIMEZONE components in cases that ActiveSupport can't figure it out (or isn't installed)
59
+ - Prevent rewinding the Parser IO input during parsing - Niels Laukens
60
+ - Update tested/supported ruby versions & documentation updates.
61
+
62
+ ## 2.4.1 - 2016-09-03
63
+ - Fix parsing multiple calendars or components in same file - Patrick Schnetger
64
+ - Fix multi-byte folding bug - Niels Laukens
65
+ - Fix typos across the code - Martin Edenhofer & yuuji.yaginuma
66
+
67
+ ## 2.4.0 - 2016-07-04
68
+ - Enable parsing individual ICalendar components - Patrick Schnetger
69
+ - many bug fixes. Thanks to Quan Sun, Garry Shutler, Ryan Bigg, Patrick Schnetger and others
70
+ - README/documentation updates. Thanks to JonMidhir and Hendrik Sollich
71
+
72
+ ## 2.3.0 - 2015-04-26
73
+ - fix value parameter for properties with multiple values
74
+ - fix error when assigning Icalendar::Values::Array to a component
75
+ - Fall back to Icalendar::Values::Date if Icalendar::Values::DateTime is not given a properly formatted value
76
+ - Downcase the keys in ical_params to ensure we aren't assigning both tzid and TZID
77
+
78
+ ## 2.2.2 - 2014-12-27
79
+ - add a `has_#{component}?` method for testing if component exists - John Hope
80
+ - add documentation & tests for organizer attribute - Ben Walding
81
+
82
+ ## 2.2.1 - 2014-12-03
83
+ - Prevent crashes when using ActiveSupport::TimeWithZone in multi-property DateTime fields - Danny (tdg5)
84
+ - Ensure TimeWithZone is loaded before using, not just ActiveSupport - Jeremy Evans
85
+ - Improve error message on unparseable DateTimes - Garry Shutler
86
+
87
+ ## 2.2.0 - 2014-09-23
88
+ - Default to non-strict parsing
89
+ - Enable sorting events by dtstart - Mark Rickert
90
+ - Better tolerate malformed lines in parser - Garry Shutler
91
+ - Deduplicate timezone code - Jan Vlnas
92
+ - Eliminate warnings - rochefort
93
+
94
+ ## 2.1.2 - 2014-09-10
95
+ - Fix timezone abbreviation generation - Jan Vlnas
96
+ - Fix timezone repeat rules for end of month
97
+
98
+ ## 2.1.1 - 2014-07-23
99
+ - Quiet TimeWithZone support logging
100
+ - Use SecureRandom.uuid - antoinelyset
101
+
102
+ ## 2.1.0 - 2014-06-17
103
+ - Enable parsing all custom properties, not just X- prefixed ones
104
+ Requires non-strict parsing
105
+ - Fixed bugs when using non-MRI ruby interpreters
106
+ - Fix bug copying OpenStruct-backed value types
107
+
108
+ ## 2.0.1 - 2014-04-27
109
+ - Re-add support for ruby 1.9.2
110
+
111
+ ## 2.0.0 - 2014-04-22
112
+ - Add Icalendar.logger class & logging in Parser
113
+ - Support tzinfo ~> 0.3 and ~> 1.1
114
+
115
+ ## 2.0.0.beta.2 - 2014-04-11
116
+ - Add uid & acknowledged fields from valarm extensions
117
+ - Swallow NoMethodError on non-strict parsers
118
+ - Expose a parse_property method on Icalendar::Parser
119
+
120
+ ## 2.0.0.beta.1 - 2014-03-30
121
+ - Rewrite for easier development going forward.
122
+
123
+ ## 1.5.2 - 2014-02-22
124
+ - Output timezone components first
125
+ - Fix undefined local variable or method 'e' - Jason Stirk
126
+
127
+ ## 1.5.1 - 2014-02-27
128
+ - Check for dtend existence before setting timezone - Jonas Grau
129
+ - Clean up and refactor components - Kasper Timm Hansen
130
+
131
+ ## 1.5.0 - 2013-12-06
132
+ - Support for custom x- properties - Jake Craige
133
+
134
+ ## 1.4.5 - 2013-11-14
135
+ - Fix Geo accessor methods - bouzuya
136
+ - Add ical_multiline_property :related_to for Alarm
137
+ - Allow using multi setters to append single values
138
+
139
+ ## 1.4.4 - 2013-11-05
140
+ - Allow user to handle TZInfo::AmbiguousTime error - David Bradford
141
+ - Better handling of multiple exdate and rdate values
142
+
143
+ ## 1.4.3 - 2013-09-18
144
+ - Fix concatenation of multiple BYWEEK or BYMONTH recurrence rules
145
+
146
+ ## 1.4.2 - 2013-09-11
147
+ - Double Quote parameter values that contain forbidden characters
148
+ - Update Component#respond_to? to match Ruby 2.0 - Keith Marcum
149
+
150
+ ## 1.4.1 - 2013-06-25
151
+ - Don't escape semicolon in GEO property - temirov
152
+ - Allow access to various parts of RRule class
153
+
154
+ ## 1.4.0 - 2013-05-21
155
+ - Implement ACKNOWLEDGED property for VALARM - tsuzuki08
156
+ - Output VERSION property as first line after BEGIN:VCALENDAR
157
+ - Check for unbounded timezone transitions in tzinfo
158
+
159
+ ## 1.3.0 - 2013-03-31
160
+ - Lenient parsing mode ignores unknown properties - David Grandinetti
161
+ - VTIMEZONE positive offsets properly have "+" prepended (Fixed issue
162
+ #18) - Benjamin Jorgensen (sorry for misspelling your last name)
163
+
164
+ ## 1.2.4 - 2013-03-26
165
+ - Proxy component values now frozen in Ruby 2.0 (Fixed issue #17)
166
+ - Clean up gemspec for cleaner installing via bundler/git
167
+
168
+ ## 1.2.3 - 2013-03-09
169
+ - Call `super` from Component#method_missing
170
+ - Clean up warnings in test suite
171
+ - Add Gemfile for installing development dependencies
172
+
173
+ ## 1.2.2 - 2013-02-16
174
+ - added TZURL property to Timezone component - spacepixels
175
+ - correct days in RRule ("[TU,WE]" -> "TU,WE") - Christoph Finkensiep
176
+
177
+ ## 1.2.1 - 2012-11-12
178
+ - Adds uid property to alarms to support iCloud - Jeroen Jacobs
179
+ - Fix up testing docs - Eric Carty-Fickes
180
+ - Fix parsing property params that have : in them - Sean Dague
181
+ - Clean up warnings in test suite - Sean Dague
182
+
183
+ ## 1.2.0 - 2012-08-30
184
+ * Fix calendar handling for dates < 1000 - Ryan Ahearn
185
+ * Updated license to GPL/BSD/Ruby at users option
186
+
187
+ ## 1.1.6 - 2011-03-10
188
+ * Fix todo handling (thanks to Frank Schwarz)
189
+ * clean up a number of warnings during test runs
190
+
191
+ ## 1.1.5 - 2010-06-21
192
+ * Fix for windows line endings (thanks to Rowan Collins)
193
+
194
+ ## 1.1.4 - 2010-04-23
195
+ * Fix for RRULE escaping
196
+ * Fix tests so they run under 1.8.7 in multiple environments
197
+ * Readme fix
198
+
199
+ ## 1.1.3 - 2010-03-15
200
+ * Revert component sorting behavior that I was trying to make
201
+ the tests run more consistantly on different platforms.
202
+ * Added new test for multiple events in a calendar which caught that break.
203
+
204
+ ## 1.1.2 - 2010-03-10
205
+
206
+ * Convert project to newgem to make for easier publishing
data/README.md CHANGED
@@ -1,7 +1,7 @@
1
1
  iCalendar -- Internet calendaring, Ruby style
2
2
  ===
3
3
 
4
- [![Build Status](https://travis-ci.com/icalendar/icalendar.svg?branch=master)](https://travis-ci.com/icalendar/icalendar)
4
+ [![Ruby](https://github.com/icalendar/icalendar/actions/workflows/main.yml/badge.svg)](https://github.com/icalendar/icalendar/actions/workflows/main.yml)
5
5
  [![Code Climate](https://codeclimate.com/github/icalendar/icalendar.png)](https://codeclimate.com/github/icalendar/icalendar)
6
6
 
7
7
  <http://github.com/icalendar/icalendar>
data/icalendar.gemspec CHANGED
@@ -21,7 +21,7 @@ ActiveSupport is required for TimeWithZone support, but not required for general
21
21
  EOM
22
22
 
23
23
  s.metadata = {
24
- 'changelog_uri' => 'https://github.com/icalendar/icalendar/blob/main/History.txt'
24
+ 'changelog_uri' => 'https://github.com/icalendar/icalendar/blob/main/CHANGELOG.md'
25
25
  }
26
26
 
27
27
  s.files = `git ls-files`.split "\n"
@@ -38,13 +38,13 @@ ActiveSupport is required for TimeWithZone support, but not required for general
38
38
 
39
39
  # test with all groups of tzinfo dependencies
40
40
  # tzinfo 2.x
41
- # s.add_development_dependency 'tzinfo', '~> 2.0'
42
- # s.add_development_dependency 'tzinfo-data', '~> 1.2020'
43
- # tzinfo 1.x
44
- s.add_development_dependency 'activesupport', '~> 6.0'
45
- s.add_development_dependency 'i18n', '~> 1.8'
46
- s.add_development_dependency 'tzinfo', '~> 1.2'
41
+ s.add_development_dependency 'activesupport', '~> 7.1'
42
+ s.add_development_dependency 'tzinfo', '~> 2.0'
47
43
  s.add_development_dependency 'tzinfo-data', '~> 1.2020'
44
+ # tzinfo 1.x
45
+ # s.add_development_dependency 'activesupport', '~> 6.0'
46
+ # s.add_development_dependency 'tzinfo', '~> 1.2'
47
+ # s.add_development_dependency 'tzinfo-data', '~> 1.2020'
48
48
  # tzinfo 0.x
49
49
  # s.add_development_dependency 'tzinfo', '~> 0.3'
50
50
  # end tzinfo
@@ -52,4 +52,5 @@ ActiveSupport is required for TimeWithZone support, but not required for general
52
52
  s.add_development_dependency 'timecop', '~> 0.9'
53
53
  s.add_development_dependency 'rspec', '~> 3.8'
54
54
  s.add_development_dependency 'simplecov', '~> 0.16'
55
+ s.add_development_dependency 'byebug'
55
56
  end
@@ -197,7 +197,7 @@ module Icalendar
197
197
  value = parts[:value]
198
198
  else
199
199
  parts = BAD_LINE_REGEX.match(input) unless strict?
200
- parts or fail "Invalid iCalendar input line: #{input}"
200
+ parts or fail ParseError, "Invalid iCalendar input line: #{input}"
201
201
  # Non-strict and bad line so use a value of empty string
202
202
  value = ''
203
203
  end
@@ -211,7 +211,7 @@ module Icalendar
211
211
  param_value = param_value.gsub(PVALUE_GSUB_REGEX, '')
212
212
  params[param_name] << param_value
213
213
  if param_name == 'tzid'
214
- params['x-tz-info'] = timezone_store.retrieve param_value
214
+ params['x-tz-store'] = timezone_store
215
215
  end
216
216
  end
217
217
  end
@@ -227,5 +227,8 @@ module Icalendar
227
227
  value: value
228
228
  }
229
229
  end
230
+
231
+ class ParseError < RuntimeError
232
+ end
230
233
  end
231
234
  end
@@ -108,15 +108,17 @@ module Icalendar
108
108
 
109
109
  def standard_for(local)
110
110
  possible = standards.map do |std|
111
- [std.previous_occurrence(local.to_time), std]
112
- end
111
+ prev = std.previous_occurrence(local.to_time)
112
+ [prev, std] unless prev.nil?
113
+ end.compact
113
114
  possible.sort_by(&:first).last
114
115
  end
115
116
 
116
117
  def daylight_for(local)
117
118
  possible = daylights.map do |day|
118
- [day.previous_occurrence(local.to_time), day]
119
- end
119
+ prev = day.previous_occurrence(local.to_time)
120
+ [prev, day] unless prev.nil?
121
+ end.compact
120
122
  possible.sort_by(&:first).last
121
123
  end
122
124
  end
@@ -10,7 +10,7 @@ module Icalendar
10
10
 
11
11
  def initialize(value, params = {})
12
12
  params.delete 'tzid'
13
- params.delete 'x-tz-info'
13
+ params.delete 'x-tz-store'
14
14
  if value.is_a? String
15
15
  begin
16
16
  parsed_date = ::Date.strptime(value, FORMAT)
@@ -20,22 +20,45 @@ module Icalendar
20
20
  module Values
21
21
  module Helpers
22
22
  module TimeWithZone
23
- attr_reader :tz_utc
23
+ attr_reader :tz_utc, :timezone_store
24
24
 
25
25
  def initialize(value, params = {})
26
26
  params = Icalendar::DowncasedHash(params)
27
27
  @tz_utc = params['tzid'] == 'UTC'
28
- x_tz_info = params.delete 'x-tz-info'
28
+ @timezone_store = params.delete 'x-tz-store'
29
+ super (offset_value(value, params) || value), params
30
+ end
31
+
32
+ def __getobj__
33
+ orig_value = super
34
+ if set_offset?
35
+ orig_value
36
+ else
37
+ offset = offset_value(orig_value, ical_params)
38
+ __setobj__(offset) unless offset.nil?
39
+ offset || orig_value
40
+ end
41
+ end
29
42
 
30
- offset_value = unless params['tzid'].nil?
43
+ def params_ical
44
+ ical_params.delete 'tzid' if tz_utc
45
+ super
46
+ end
47
+
48
+ private
49
+
50
+ def offset_value(value, params)
51
+ @offset_value = unless params.nil? || params['tzid'].nil?
31
52
  tzid = params['tzid'].is_a?(::Array) ? params['tzid'].first : params['tzid']
32
53
  support_classes_defined = defined?(ActiveSupport::TimeZone) && defined?(ActiveSupportTimeWithZoneAdapter)
33
54
  if support_classes_defined && (tz = ActiveSupport::TimeZone[tzid])
55
+ Icalendar.logger.debug("Plan a - parsing #{value}/#{tzid} as ActiveSupport::TimeWithZone")
34
56
  # plan a - use ActiveSupport::TimeWithZone
35
57
  ActiveSupportTimeWithZoneAdapter.new(nil, tz, value)
36
- elsif !x_tz_info.nil?
58
+ elsif !timezone_store.nil? && !(x_tz_info = timezone_store.retrieve(tzid)).nil?
37
59
  # plan b - use definition from provided `VTIMEZONE`
38
60
  offset = x_tz_info.offset_for_local(value).to_s
61
+ Icalendar.logger.debug("Plan b - parsing #{value} with offset: #{offset}")
39
62
  if value.respond_to?(:change)
40
63
  value.change offset: offset
41
64
  else
@@ -43,17 +66,19 @@ module Icalendar
43
66
  end
44
67
  elsif support_classes_defined && (tz = ActiveSupport::TimeZone[tzid.split.first])
45
68
  # plan c - try to find an ActiveSupport::TimeWithZone based on the first word of the tzid
69
+ Icalendar.logger.debug("Plan c - parsing #{value}/#{tz.tzinfo.name} as ActiveSupport::TimeWithZone")
46
70
  params['tzid'] = [tz.tzinfo.name]
47
71
  ActiveSupportTimeWithZoneAdapter.new(nil, tz, value)
72
+ else
73
+ # plan d - just ignore the tzid
74
+ Icalendar.logger.info("Ignoring timezone #{tzid} for time #{value}")
75
+ nil
48
76
  end
49
- # plan d - just ignore the tzid
50
77
  end
51
- super((offset_value || value), params)
52
78
  end
53
79
 
54
- def params_ical
55
- ical_params.delete 'tzid' if tz_utc
56
- super
80
+ def set_offset?
81
+ !!@offset_value
57
82
  end
58
83
  end
59
84
  end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Icalendar
4
4
 
5
- VERSION = '2.10.0'
5
+ VERSION = '2.10.2'
6
6
 
7
7
  end
@@ -0,0 +1,143 @@
1
+ BEGIN:VCALENDAR
2
+ VERSION:2.0
3
+ X-WR-CALNAME:My Calendar
4
+ X-APPLE-CALENDAR-COLOR:#44A703
5
+ BEGIN:VEVENT
6
+ CREATED:20231026T211915Z
7
+ DTEND;TZID=NONSTANDARDTZ:20231025T180000
8
+ DTSTAMP:20231026T211916Z
9
+ DTSTART;TZID=NONSTANDARDTZ:20231025T163000
10
+ LAST-MODIFIED:20231026T211915Z
11
+ LOCATION:Somewhere
12
+ SEQUENCE:0
13
+ SUMMARY:Summary summary summary
14
+ UID:some-unique-uid
15
+ END:VEVENT
16
+ BEGIN:VTIMEZONE
17
+ TZID:NONSTANDARDTZ
18
+ X-LIC-LOCATION:NONSTANDARDTZ
19
+ BEGIN:STANDARD
20
+ DTSTART:18831118T120702
21
+ RDATE:18831118T120702
22
+ TZNAME:PST
23
+ TZOFFSETFROM:-075258
24
+ TZOFFSETTO:-0800
25
+ END:STANDARD
26
+ BEGIN:DAYLIGHT
27
+ DTSTART:19180331T020000
28
+ RRULE:FREQ=YEARLY;UNTIL=19190330T100000Z;BYMONTH=3;BYDAY=-1SU
29
+ TZNAME:PDT
30
+ TZOFFSETFROM:-0800
31
+ TZOFFSETTO:-0700
32
+ END:DAYLIGHT
33
+ BEGIN:STANDARD
34
+ DTSTART:19181027T020000
35
+ RRULE:FREQ=YEARLY;UNTIL=19191026T090000Z;BYMONTH=10;BYDAY=-1SU
36
+ TZNAME:PST
37
+ TZOFFSETFROM:-0700
38
+ TZOFFSETTO:-0800
39
+ END:STANDARD
40
+ BEGIN:DAYLIGHT
41
+ DTSTART:19420209T020000
42
+ RDATE:19420209T020000
43
+ TZNAME:PWT
44
+ TZOFFSETFROM:-0800
45
+ TZOFFSETTO:-0700
46
+ END:DAYLIGHT
47
+ BEGIN:DAYLIGHT
48
+ DTSTART:19450814T160000
49
+ RDATE:19450814T160000
50
+ TZNAME:PPT
51
+ TZOFFSETFROM:-0700
52
+ TZOFFSETTO:-0700
53
+ END:DAYLIGHT
54
+ BEGIN:STANDARD
55
+ DTSTART:19450930T020000
56
+ RDATE:19450930T020000
57
+ RDATE:19490101T020000
58
+ TZNAME:PST
59
+ TZOFFSETFROM:-0700
60
+ TZOFFSETTO:-0800
61
+ END:STANDARD
62
+ BEGIN:STANDARD
63
+ DTSTART:19460101T000000
64
+ RDATE:19460101T000000
65
+ RDATE:19670101T000000
66
+ TZNAME:PST
67
+ TZOFFSETFROM:-0800
68
+ TZOFFSETTO:-0800
69
+ END:STANDARD
70
+ BEGIN:DAYLIGHT
71
+ DTSTART:19480314T020100
72
+ RDATE:19480314T020100
73
+ RDATE:19740106T020000
74
+ RDATE:19750223T020000
75
+ TZNAME:PDT
76
+ TZOFFSETFROM:-0800
77
+ TZOFFSETTO:-0700
78
+ END:DAYLIGHT
79
+ BEGIN:DAYLIGHT
80
+ DTSTART:19500430T010000
81
+ RRULE:FREQ=YEARLY;UNTIL=19660424T090000Z;BYMONTH=4;BYDAY=-1SU
82
+ TZNAME:PDT
83
+ TZOFFSETFROM:-0800
84
+ TZOFFSETTO:-0700
85
+ END:DAYLIGHT
86
+ BEGIN:STANDARD
87
+ DTSTART:19500924T020000
88
+ RRULE:FREQ=YEARLY;UNTIL=19610924T090000Z;BYMONTH=9;BYDAY=-1SU
89
+ TZNAME:PST
90
+ TZOFFSETFROM:-0700
91
+ TZOFFSETTO:-0800
92
+ END:STANDARD
93
+ BEGIN:STANDARD
94
+ DTSTART:19621028T020000
95
+ RRULE:FREQ=YEARLY;UNTIL=19661030T090000Z;BYMONTH=10;BYDAY=-1SU
96
+ TZNAME:PST
97
+ TZOFFSETFROM:-0700
98
+ TZOFFSETTO:-0800
99
+ END:STANDARD
100
+ BEGIN:DAYLIGHT
101
+ DTSTART:19670430T020000
102
+ RRULE:FREQ=YEARLY;UNTIL=19730429T100000Z;BYMONTH=4;BYDAY=-1SU
103
+ TZNAME:PDT
104
+ TZOFFSETFROM:-0800
105
+ TZOFFSETTO:-0700
106
+ END:DAYLIGHT
107
+ BEGIN:STANDARD
108
+ DTSTART:19671029T020000
109
+ RRULE:FREQ=YEARLY;UNTIL=20061029T090000Z;BYMONTH=10;BYDAY=-1SU
110
+ TZNAME:PST
111
+ TZOFFSETFROM:-0700
112
+ TZOFFSETTO:-0800
113
+ END:STANDARD
114
+ BEGIN:DAYLIGHT
115
+ DTSTART:19760425T020000
116
+ RRULE:FREQ=YEARLY;UNTIL=19860427T100000Z;BYMONTH=4;BYDAY=-1SU
117
+ TZNAME:PDT
118
+ TZOFFSETFROM:-0800
119
+ TZOFFSETTO:-0700
120
+ END:DAYLIGHT
121
+ BEGIN:DAYLIGHT
122
+ DTSTART:19870405T020000
123
+ RRULE:FREQ=YEARLY;UNTIL=20060402T100000Z;BYMONTH=4;BYDAY=1SU
124
+ TZNAME:PDT
125
+ TZOFFSETFROM:-0800
126
+ TZOFFSETTO:-0700
127
+ END:DAYLIGHT
128
+ BEGIN:DAYLIGHT
129
+ DTSTART:20070311T020000
130
+ RRULE:FREQ=YEARLY;BYMONTH=3;BYDAY=2SU
131
+ TZNAME:PDT
132
+ TZOFFSETFROM:-0800
133
+ TZOFFSETTO:-0700
134
+ END:DAYLIGHT
135
+ BEGIN:STANDARD
136
+ DTSTART:20071104T020000
137
+ RRULE:FREQ=YEARLY;BYMONTH=11;BYDAY=1SU
138
+ TZNAME:PST
139
+ TZOFFSETFROM:-0700
140
+ TZOFFSETTO:-0800
141
+ END:STANDARD
142
+ END:VTIMEZONE
143
+ END:VCALENDAR
data/spec/parser_spec.rb CHANGED
@@ -5,6 +5,15 @@ describe Icalendar::Parser do
5
5
  let(:source) { File.read File.join(File.dirname(__FILE__), 'fixtures', fn) }
6
6
 
7
7
  describe '#parse' do
8
+ context 'reversed_timezone.ics' do
9
+ let(:fn) { 'reversed_timezone.ics' }
10
+
11
+ it 'correctly parses the event timezone' do
12
+ event = subject.parse.first.events.first
13
+ expect(event.dtstart.utc_offset).to eq -25200
14
+ end
15
+ end
16
+
8
17
  context 'single_event.ics' do
9
18
  let(:fn) { 'single_event.ics' }
10
19
 
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.10.0
4
+ version: 2.10.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: 2023-11-01 00:00:00.000000000 Z
11
+ date: 2024-07-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: ice_cube
@@ -58,42 +58,28 @@ dependencies:
58
58
  requirements:
59
59
  - - "~>"
60
60
  - !ruby/object:Gem::Version
61
- version: '6.0'
61
+ version: '7.1'
62
62
  type: :development
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
66
  - - "~>"
67
67
  - !ruby/object:Gem::Version
68
- version: '6.0'
69
- - !ruby/object:Gem::Dependency
70
- name: i18n
71
- requirement: !ruby/object:Gem::Requirement
72
- requirements:
73
- - - "~>"
74
- - !ruby/object:Gem::Version
75
- version: '1.8'
76
- type: :development
77
- prerelease: false
78
- version_requirements: !ruby/object:Gem::Requirement
79
- requirements:
80
- - - "~>"
81
- - !ruby/object:Gem::Version
82
- version: '1.8'
68
+ version: '7.1'
83
69
  - !ruby/object:Gem::Dependency
84
70
  name: tzinfo
85
71
  requirement: !ruby/object:Gem::Requirement
86
72
  requirements:
87
73
  - - "~>"
88
74
  - !ruby/object:Gem::Version
89
- version: '1.2'
75
+ version: '2.0'
90
76
  type: :development
91
77
  prerelease: false
92
78
  version_requirements: !ruby/object:Gem::Requirement
93
79
  requirements:
94
80
  - - "~>"
95
81
  - !ruby/object:Gem::Version
96
- version: '1.2'
82
+ version: '2.0'
97
83
  - !ruby/object:Gem::Dependency
98
84
  name: tzinfo-data
99
85
  requirement: !ruby/object:Gem::Requirement
@@ -150,6 +136,20 @@ dependencies:
150
136
  - - "~>"
151
137
  - !ruby/object:Gem::Version
152
138
  version: '0.16'
139
+ - !ruby/object:Gem::Dependency
140
+ name: byebug
141
+ requirement: !ruby/object:Gem::Requirement
142
+ requirements:
143
+ - - ">="
144
+ - !ruby/object:Gem::Version
145
+ version: '0'
146
+ type: :development
147
+ prerelease: false
148
+ version_requirements: !ruby/object:Gem::Requirement
149
+ requirements:
150
+ - - ">="
151
+ - !ruby/object:Gem::Version
152
+ version: '0'
153
153
  description: |
154
154
  Implements the iCalendar specification (RFC-5545) in Ruby. This allows
155
155
  for the generation and parsing of .ics files, which are used by a
@@ -163,8 +163,8 @@ files:
163
163
  - ".github/workflows/main.yml"
164
164
  - ".gitignore"
165
165
  - ".rspec"
166
+ - CHANGELOG.md
166
167
  - Gemfile
167
- - History.txt
168
168
  - LICENSE
169
169
  - README.md
170
170
  - Rakefile
@@ -216,6 +216,7 @@ files:
216
216
  - spec/fixtures/nondefault_values.ics
217
217
  - spec/fixtures/nonstandard.ics
218
218
  - spec/fixtures/recurrence.ics
219
+ - spec/fixtures/reversed_timezone.ics
219
220
  - spec/fixtures/single_event.ics
220
221
  - spec/fixtures/single_event_bad_dtstart.ics
221
222
  - spec/fixtures/single_event_bad_line.ics
@@ -248,7 +249,7 @@ licenses:
248
249
  - GPL-3.0-only
249
250
  - icalendar
250
251
  metadata:
251
- changelog_uri: https://github.com/icalendar/icalendar/blob/main/History.txt
252
+ changelog_uri: https://github.com/icalendar/icalendar/blob/main/CHANGELOG.md
252
253
  post_install_message: 'ActiveSupport is required for TimeWithZone support, but not
253
254
  required for general use.
254
255
 
@@ -267,7 +268,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
267
268
  - !ruby/object:Gem::Version
268
269
  version: '0'
269
270
  requirements: []
270
- rubygems_version: 3.4.10
271
+ rubygems_version: 3.3.27
271
272
  signing_key:
272
273
  specification_version: 4
273
274
  summary: A ruby implementation of the iCalendar specification (RFC-5545).
@@ -282,6 +283,7 @@ test_files:
282
283
  - spec/fixtures/nondefault_values.ics
283
284
  - spec/fixtures/nonstandard.ics
284
285
  - spec/fixtures/recurrence.ics
286
+ - spec/fixtures/reversed_timezone.ics
285
287
  - spec/fixtures/single_event.ics
286
288
  - spec/fixtures/single_event_bad_dtstart.ics
287
289
  - spec/fixtures/single_event_bad_line.ics
data/History.txt DELETED
@@ -1,197 +0,0 @@
1
- === Unreleased
2
-
3
- === 2.10.0 2023-11-01
4
- * Add changelog metadata to gemspec - Juri Hahn
5
- * Attempt to rescue timezone info when given a nonstandard tzid with no VTIMEZONE
6
- * Move Values classes that shouldn't be directly used into Helpers module
7
-
8
- === 2.9.0 2023-08-11
9
- * Always include the VALUE of Event URLs for improved compatibility - Sean Kelley
10
- * Improved parse performance - Thomas Cannon
11
- * Add helper methods for other Calendar method verbs
12
- * bugfix: Require stringio before use in Parser - vwyu
13
-
14
- === 2.8.0 2022-07-10
15
- * Fix compatibility with ActiveSupport 7 - Pat Allan
16
- * Set default action of "DISPLAY" on alarms - Rikson
17
- * Add license information to gemspec - Robert Reiz
18
- * Support RFC7986 properties - Daniele Frisanco
19
-
20
- === 2.7.1 2021-03-14
21
- * Recover from bad line-wrapping code that splits in the middle of Unicode code points
22
- * Add a verbose option to the Parser to quiet some of the chattier log entries
23
-
24
- === 2.7.0 2020-09-12
25
- * Handle custom component names, with and without X- prefix
26
- * Fix Component lookup to avoid namespace collisions
27
-
28
- === 2.6.1 2019-12-07
29
- * Improve performance when generating large ICS files - Alex Balhatchet
30
-
31
- === 2.6.0 2019-11-26
32
- * Improve performance for calculating timezone offsets - Justin Howard
33
- * Make it possible to de/serialize with Marshal - Pawel Niewiadomski
34
- * Avoid FrozenError when running with frozen_string_literal
35
- * Update minimum Ruby version to supported versions
36
-
37
- === 2.5.3 2019-03-04
38
- * Improve parsing performance - nehresma
39
- * Support tzinfo 2.0 - Misty De Meo
40
-
41
- === 2.5.2 2018-12-08
42
- * Remove usage of the global TimezoneStore instance, in favor of a local variable in the parser
43
- * Deprecate TimezoneStore class methods
44
-
45
- === 2.5.1 2018-10-30
46
- * Fix usage without ActiveSupport installed.
47
-
48
- === 2.5.0 2018-09-10
49
- * Set timezone information from VTIMEZONE components in cases that ActiveSupport can't figure it out (or isn't installed)
50
- * Prevent rewinding the Parser IO input during parsing - Niels Laukens
51
- * Update tested/supported ruby versions & documentation updates.
52
-
53
- === 2.4.1 2016-09-03
54
- * Fix parsing multiple calendars or components in same file - Patrick Schnetger
55
- * Fix multi-byte folding bug - Niels Laukens
56
- * Fix typos across the code - Martin Edenhofer & yuuji.yaginuma
57
-
58
- === 2.4.0 2016-07-04
59
- * Enable parsing individual ICalendar components - Patrick Schnetger
60
- * many bug fixes. Thanks to Quan Sun, Garry Shutler, Ryan Bigg, Patrick Schnetger and others
61
- * README/documentation updates. Thanks to JonMidhir and Hendrik Sollich
62
-
63
- === 2.3.0 2015-04-26
64
- * fix value parameter for properties with multiple values
65
- * fix error when assigning Icalendar::Values::Array to a component
66
- * Fall back to Icalendar::Values::Date if Icalendar::Values::DateTime is not given a properly formatted value
67
- * Downcase the keys in ical_params to ensure we aren't assigning both tzid and TZID
68
-
69
- === 2.2.2 2014-12-27
70
- * add a `has_#{component}?` method for testing if component exists - John Hope
71
- * add documentation & tests for organizer attribute - Ben Walding
72
-
73
- === 2.2.1 2014-12-03
74
- * Prevent crashes when using ActiveSupport::TimeWithZone in multi-property DateTime fields - Danny (tdg5)
75
- * Ensure TimeWithZone is loaded before using, not just ActiveSupport - Jeremy Evans
76
- * Improve error message on unparseable DateTimes - Garry Shutler
77
-
78
- === 2.2.0 2014-09-23
79
- * Default to non-strict parsing
80
- * Enable sorting events by dtstart - Mark Rickert
81
- * Better tolerate malformed lines in parser - Garry Shutler
82
- * Deduplicate timezone code - Jan Vlnas
83
- * Eliminate warnings - rochefort
84
-
85
- === 2.1.2 2014-09-10
86
- * Fix timezone abbreviation generation - Jan Vlnas
87
- * Fix timezone repeat rules for end of month
88
-
89
- === 2.1.1 2014-07-23
90
- * Quiet TimeWithZone support logging
91
- * Use SecureRandom.uuid - antoinelyset
92
-
93
- === 2.1.0 2014-06-17
94
- * Enable parsing all custom properties, not just X- prefixed ones
95
- Requires non-strict parsing
96
- * Fixed bugs when using non-MRI ruby interpreters
97
- * Fix bug copying OpenStruct-backed value types
98
-
99
- === 2.0.1 2014-04-27
100
- * Re-add support for ruby 1.9.2
101
-
102
- === 2.0.0 2014-04-22
103
- * Add Icalendar.logger class & logging in Parser
104
- * Support tzinfo ~> 0.3 and ~> 1.1
105
-
106
- === 2.0.0.beta.2 2014-04-11
107
- * Add uid & acknowledged fields from valarm extensions
108
- * Swallow NoMethodError on non-strict parsers
109
- * Expose a parse_property method on Icalendar::Parser
110
-
111
- === 2.0.0.beta.1 2014-03-30
112
- * Rewrite for easier development going forward.
113
-
114
- === 1.5.2 2014-02-22
115
- * Output timezone components first
116
- * Fix undefined local variable or method 'e' - Jason Stirk
117
-
118
- === 1.5.1 2014-02-27
119
- * Check for dtend existence before setting timezone - Jonas Grau
120
- * Clean up and refactor components - Kasper Timm Hansen
121
-
122
- === 1.5.0 2013-12-06
123
- * Support for custom x- properties - Jake Craige
124
-
125
- === 1.4.5 2013-11-14
126
- * Fix Geo accessor methods - bouzuya
127
- * Add ical_multiline_property :related_to for Alarm
128
- * Allow using multi setters to append single values
129
-
130
- === 1.4.4 2013-11-05
131
- * Allow user to handle TZInfo::AmbiguousTime error - David Bradford
132
- * Better handling of multiple exdate and rdate values
133
-
134
- === 1.4.3 2013-09-18
135
- * Fix concatenation of multiple BYWEEK or BYMONTH recurrence rules
136
-
137
- === 1.4.2 2013-09-11
138
- * Double Quote parameter values that contain forbidden characters
139
- * Update Component#respond_to? to match Ruby 2.0 - Keith Marcum
140
-
141
- === 1.4.1 2013-06-25
142
- * Don't escape semicolon in GEO property - temirov
143
- * Allow access to various parts of RRule class
144
-
145
- === 1.4.0 2013-05-21
146
- * Implement ACKNOWLEDGED property for VALARM - tsuzuki08
147
- * Output VERSION property as first line after BEGIN:VCALENDAR
148
- * Check for unbounded timezone transitions in tzinfo
149
-
150
- === 1.3.0 2013-03-31
151
- * Lenient parsing mode ignores unknown properties - David Grandinetti
152
- * VTIMEZONE positive offsets properly have "+" prepended (Fixed issue
153
- #18) - Benjamin Jorgensen (sorry for misspelling your last name)
154
-
155
- === 1.2.4 2013-03-26
156
- * Proxy component values now frozen in Ruby 2.0 (Fixed issue #17)
157
- * Clean up gemspec for cleaner installing via bundler/git
158
-
159
- === 1.2.3 2013-03-09
160
- * Call `super` from Component#method_missing
161
- * Clean up warnings in test suite
162
- * Add Gemfile for installing development dependencies
163
-
164
- === 1.2.2 2013-02-16
165
- * added TZURL property to Timezone component - spacepixels
166
- * correct days in RRule ("[TU,WE]" -> "TU,WE") - Christoph Finkensiep
167
-
168
- === 1.2.1 2012-11-12
169
- * Adds uid property to alarms to support iCloud - Jeroen Jacobs
170
- * Fix up testing docs - Eric Carty-Fickes
171
- * Fix parsing property params that have : in them - Sean Dague
172
- * Clean up warnings in test suite - Sean Dague
173
-
174
- === 1.2.0 2012-08-30
175
- * Fix calendar handling for dates < 1000 - Ryan Ahearn
176
- * Updated license to GPL/BSD/Ruby at users option
177
-
178
- === 1.1.6 2011-03-10
179
- * Fix todo handling (thanks to Frank Schwarz)
180
- * clean up a number of warnings during test runs
181
-
182
- === 1.1.5 2010-06-21
183
- * Fix for windows line endings (thanks to Rowan Collins)
184
-
185
- === 1.1.4 2010-04-23
186
- * Fix for RRULE escaping
187
- * Fix tests so they run under 1.8.7 in multiple environments
188
- * Readme fix
189
-
190
- === 1.1.3 2010-03-15
191
- * Revert component sorting behavior that I was trying to make
192
- the tests run more consistantly on different platforms.
193
- * Added new test for multiple events in a calendar which caught that break.
194
-
195
- === 1.1.2 2010-03-10
196
-
197
- * Convert project to newgem to make for easier publishing