tzinfo 1.2.5 → 1.2.10

Sign up to get free protection for your applications and to get access to all the features.
Files changed (67) hide show
  1. checksums.yaml +4 -4
  2. checksums.yaml.gz.sig +2 -3
  3. data/CHANGES.md +96 -48
  4. data/LICENSE +1 -1
  5. data/README.md +9 -8
  6. data/lib/tzinfo/annual_rules.rb +51 -0
  7. data/lib/tzinfo/data_source.rb +1 -1
  8. data/lib/tzinfo/posix_time_zone_parser.rb +136 -0
  9. data/lib/tzinfo/ruby_core_support.rb +24 -1
  10. data/lib/tzinfo/ruby_data_source.rb +25 -21
  11. data/lib/tzinfo/time_or_datetime.rb +11 -0
  12. data/lib/tzinfo/timezone.rb +10 -6
  13. data/lib/tzinfo/transition_rule.rb +325 -0
  14. data/lib/tzinfo/zoneinfo_data_source.rb +35 -11
  15. data/lib/tzinfo/zoneinfo_timezone_info.rb +264 -40
  16. data/lib/tzinfo.rb +3 -0
  17. data/test/assets/payload.rb +1 -0
  18. data/test/tc_annual_rules.rb +95 -0
  19. data/test/tc_country.rb +6 -2
  20. data/test/tc_posix_time_zone_parser.rb +261 -0
  21. data/test/tc_ruby_data_source.rb +33 -3
  22. data/test/tc_time_or_datetime.rb +26 -6
  23. data/test/tc_timezone.rb +14 -3
  24. data/test/tc_transition_data_timezone_info.rb +11 -1
  25. data/test/tc_transition_rule.rb +663 -0
  26. data/test/tc_zoneinfo_data_source.rb +31 -3
  27. data/test/tc_zoneinfo_timezone_info.rb +1034 -113
  28. data/test/test_utils.rb +48 -3
  29. data/test/ts_all_zoneinfo.rb +3 -1
  30. data/test/tzinfo-data/tzinfo/data/definitions/America/Argentina/Buenos_Aires.rb +5 -5
  31. data/test/tzinfo-data/tzinfo/data/definitions/America/New_York.rb +13 -1
  32. data/test/tzinfo-data/tzinfo/data/definitions/Australia/Melbourne.rb +13 -1
  33. data/test/tzinfo-data/tzinfo/data/definitions/EST.rb +1 -1
  34. data/test/tzinfo-data/tzinfo/data/definitions/Etc/GMT__m__1.rb +2 -2
  35. data/test/tzinfo-data/tzinfo/data/definitions/Etc/GMT__p__1.rb +2 -2
  36. data/test/tzinfo-data/tzinfo/data/definitions/Etc/UTC.rb +1 -1
  37. data/test/tzinfo-data/tzinfo/data/definitions/Europe/Amsterdam.rb +15 -3
  38. data/test/tzinfo-data/tzinfo/data/definitions/Europe/Andorra.rb +13 -1
  39. data/test/tzinfo-data/tzinfo/data/definitions/Europe/London.rb +13 -1
  40. data/test/tzinfo-data/tzinfo/data/definitions/Europe/Paris.rb +15 -3
  41. data/test/tzinfo-data/tzinfo/data/definitions/Europe/Prague.rb +19 -4
  42. data/test/tzinfo-data/tzinfo/data/definitions/UTC.rb +1 -1
  43. data/test/tzinfo-data/tzinfo/data/indexes/countries.rb +197 -184
  44. data/test/tzinfo-data/tzinfo/data/indexes/timezones.rb +60 -47
  45. data/test/tzinfo-data/tzinfo/data/version.rb +9 -3
  46. data/test/zoneinfo/America/Argentina/Buenos_Aires +0 -0
  47. data/test/zoneinfo/America/New_York +0 -0
  48. data/test/zoneinfo/Australia/Melbourne +0 -0
  49. data/test/zoneinfo/EST +0 -0
  50. data/test/zoneinfo/Etc/UTC +0 -0
  51. data/test/zoneinfo/Europe/Amsterdam +0 -0
  52. data/test/zoneinfo/Europe/Andorra +0 -0
  53. data/test/zoneinfo/Europe/London +0 -0
  54. data/test/zoneinfo/Europe/Paris +0 -0
  55. data/test/zoneinfo/Europe/Prague +0 -0
  56. data/test/zoneinfo/Factory +0 -0
  57. data/test/zoneinfo/iso3166.tab +13 -14
  58. data/test/zoneinfo/leapseconds +38 -21
  59. data/test/zoneinfo/posix/Europe/London +0 -0
  60. data/test/zoneinfo/posixrules +0 -0
  61. data/test/zoneinfo/right/Europe/London +0 -0
  62. data/test/zoneinfo/zone.tab +172 -159
  63. data/test/zoneinfo/zone1970.tab +185 -170
  64. data/tzinfo.gemspec +2 -2
  65. data.tar.gz.sig +0 -0
  66. metadata +29 -24
  67. metadata.gz.sig +0 -0
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ff316f9ef3e063d02096d2d1841b832491e315d78610d8751b09115632794e9f
4
- data.tar.gz: b695fca6cdc7af5cd356dbb592aacc81c861d64e05375a5c6238c9ae924fe8be
3
+ metadata.gz: e6364432a0aef34ccf3b6b1ecad65dd6f7f13843ac503cbcea1f693b74c96b46
4
+ data.tar.gz: 825fd6905101f51fa700dfa682490851952de8a692c03954d12f38944f8814c8
5
5
  SHA512:
6
- metadata.gz: 6ab8e7340dd1eafa73c385e388d49c2bf07203e855b3410c6302abc9b5e5b9992f1cfdb9aa5dc5dc59664f713618e25eac7489b7be5209a5987162e90cfe48d9
7
- data.tar.gz: 5db4b130ed3db4b07d350b6acb020781d6538c9f9295d478b297fe994c2ac4220dbd76097ed2c5a26219cdf6ec10bb18df6816f904cdd0c5ac1193782730785c
6
+ metadata.gz: ef4b1b6a189bbf011294210d2e0651f41bc82e1db8fe342c9f8dbcefd473e8b49b9affa67bc9a395a5831b376db8d37b5942cfade1dacf5485f23ce3d6f78a46
7
+ data.tar.gz: 2871fbd7aded391c88a74724138073675690710dfca6adbbbe610ec4395e8d6631fad93b22d684650d04d9affeed0ab64a1d7489f766eb9ab1996556329c6ddc
checksums.yaml.gz.sig CHANGED
@@ -1,3 +1,2 @@
1
- 0뱱�M��f\]�!�5 l|��>���P��Cy
2
- ���:��42d��Y.fb�Rv��}�8�.�w.�0�D��A&7`5`�&�.�z,}���"O�O�n^��\��Փ�t�J-{����5�1���i�\�G���C�Q���GX2
3
- �Ck=�t�1�X�{L���z��� @�K�;v�Mz�s�n=/m�I�ZF��;ݍƁu*�-6�Rքt��G�KV�?����C
1
+ Y�1]Q�ti�t���mPo���ڊ -O��D�cu���[<��oͽc5�}�x`��[^�J?7��s����+��ȶ��M�v��ǐ�� 9�e���l9J��ۑ�3?e�V~�E����6E����Eb�)��xdTk�^�BdAC?�����=Jcr�%�����l�~��)�aPʃ\�=[ݪ��{l��fFBݦ��]�_����<v�S��0��7�z|�-�$���ؑ����^ڐ��(�ReaK�s�|�c��d
2
+ KW��
data/CHANGES.md CHANGED
@@ -1,3 +1,51 @@
1
+ Version 1.2.10 - 19-Jul-2022
2
+ ----------------------------
3
+
4
+ * Fixed a relative path traversal bug that could cause arbitrary files to be
5
+ loaded with require when used with RubyDataSource. Please refer to
6
+ https://github.com/tzinfo/tzinfo/security/advisories/GHSA-5cm2-9h8c-rvfx for
7
+ details. CVE-2022-31163.
8
+ * Ignore the SECURITY file from Arch Linux's tzdata package. #134.
9
+
10
+
11
+ Version 1.2.9 - 16-Dec-2020
12
+ ---------------------------
13
+
14
+ * Fixed an incorrect InvalidTimezoneIdentifier exception raised when loading a
15
+ zoneinfo file that includes rules specifying an additional transition to the
16
+ final defined offset (for example, Africa/Casablanca in version 2018e of the
17
+ Time Zone Database). #123.
18
+
19
+
20
+ Version 1.2.8 - 8-Nov-2020
21
+ --------------------------
22
+
23
+ * Added support for handling "slim" format zoneinfo files that are produced by
24
+ default by zic version 2020b and later. The POSIX-style TZ string is now used
25
+ calculate DST transition times after the final defined transition in the file.
26
+ The 64-bit section is now always used regardless of whether Time has support
27
+ for 64-bit times. #120.
28
+ * Rubinius is no longer supported.
29
+
30
+
31
+ Version 1.2.7 - 2-Apr-2020
32
+ --------------------------
33
+
34
+ * Fixed 'wrong number of arguments' errors when running on JRuby 9.0. #114.
35
+ * Fixed warnings when running on Ruby 2.8. #112.
36
+
37
+
38
+ Version 1.2.6 - 24-Dec-2019
39
+ ---------------------------
40
+
41
+ * Timezone#strftime('%s', time) will now return the correct number of seconds
42
+ since the epoch. #91.
43
+ * Removed the unused TZInfo::RubyDataSource::REQUIRE_PATH constant.
44
+ * Fixed "SecurityError: Insecure operation - require" exceptions when loading
45
+ data with recent Ruby releases in safe mode.
46
+ * Fixed warnings when running on Ruby 2.7. #106 and #111.
47
+
48
+
1
49
  Version 1.2.5 - 4-Feb-2018
2
50
  --------------------------
3
51
 
@@ -191,70 +239,70 @@ Version 0.3.45 (tzdata v2015g) - 3-Oct-2015
191
239
  -------------------------------------------
192
240
 
193
241
  * Updated to tzdata version 2015g
194
- (http://mm.icann.org/pipermail/tz-announce/2015-October/000034.html).
242
+ (https://mm.icann.org/pipermail/tz-announce/2015-October/000034.html).
195
243
 
196
244
 
197
245
  Version 0.3.44 (tzdata v2015d) - 24-Apr-2015
198
246
  --------------------------------------------
199
247
 
200
248
  * Updated to tzdata version 2015d
201
- (http://mm.icann.org/pipermail/tz-announce/2015-April/000031.html).
249
+ (https://mm.icann.org/pipermail/tz-announce/2015-April/000031.html).
202
250
 
203
251
 
204
252
  Version 0.3.43 (tzdata v2015a) - 31-Jan-2015
205
253
  --------------------------------------------
206
254
 
207
255
  * Updated to tzdata version 2015a
208
- (http://mm.icann.org/pipermail/tz-announce/2015-January/000028.html).
256
+ (https://mm.icann.org/pipermail/tz-announce/2015-January/000028.html).
209
257
 
210
258
 
211
259
  Version 0.3.42 (tzdata v2014i) - 23-Oct-2014
212
260
  --------------------------------------------
213
261
 
214
262
  * Updated to tzdata version 2014i
215
- (http://mm.icann.org/pipermail/tz-announce/2014-October/000026.html).
263
+ (https://mm.icann.org/pipermail/tz-announce/2014-October/000026.html).
216
264
 
217
265
 
218
266
  Version 0.3.41 (tzdata v2014f) - 8-Aug-2014
219
267
  -------------------------------------------
220
268
 
221
269
  * Updated to tzdata version 2014f
222
- (http://mm.icann.org/pipermail/tz-announce/2014-August/000023.html).
270
+ (https://mm.icann.org/pipermail/tz-announce/2014-August/000023.html).
223
271
 
224
272
 
225
273
  Version 0.3.40 (tzdata v2014e) - 10-Jul-2014
226
274
  --------------------------------------------
227
275
 
228
276
  * Updated to tzdata version 2014e
229
- (http://mm.icann.org/pipermail/tz-announce/2014-June/000022.html).
277
+ (https://mm.icann.org/pipermail/tz-announce/2014-June/000022.html).
230
278
 
231
279
 
232
280
  Version 0.3.39 (tzdata v2014a) - 9-Mar-2014
233
281
  -------------------------------------------
234
282
 
235
283
  * Updated to tzdata version 2014a
236
- (http://mm.icann.org/pipermail/tz-announce/2014-March/000018.html).
284
+ (https://mm.icann.org/pipermail/tz-announce/2014-March/000018.html).
237
285
 
238
286
 
239
287
  Version 0.3.38 (tzdata v2013g) - 8-Oct-2013
240
288
  -------------------------------------------
241
289
 
242
290
  * Updated to tzdata version 2013g
243
- (http://mm.icann.org/pipermail/tz-announce/2013-October/000015.html).
291
+ (https://mm.icann.org/pipermail/tz-announce/2013-October/000015.html).
244
292
 
245
293
 
246
294
  Version 0.3.37 (tzdata v2013b) - 11-Mar-2013
247
295
  --------------------------------------------
248
296
 
249
297
  * Updated to tzdata version 2013b
250
- (http://mm.icann.org/pipermail/tz-announce/2013-March/000010.html).
298
+ (https://mm.icann.org/pipermail/tz-announce/2013-March/000010.html).
251
299
 
252
300
 
253
301
  Version 0.3.36 (tzdata v2013a) - 3-Mar-2013
254
302
  -------------------------------------------
255
303
 
256
304
  * Updated to tzdata version 2013a
257
- (http://mm.icann.org/pipermail/tz-announce/2013-March/000009.html).
305
+ (https://mm.icann.org/pipermail/tz-announce/2013-March/000009.html).
258
306
  * Fix TimezoneTransitionInfo#eql? incorrectly returning false when running on
259
307
  Ruby 2.0.
260
308
  * Change eql? and == implementations to test the class of the passed in object
@@ -265,49 +313,49 @@ Version 0.3.35 (tzdata v2012i) - 4-Nov-2012
265
313
  -------------------------------------------
266
314
 
267
315
  * Updated to tzdata version 2012i
268
- (http://mm.icann.org/pipermail/tz-announce/2012-November/000007.html).
316
+ (https://mm.icann.org/pipermail/tz-announce/2012-November/000007.html).
269
317
 
270
318
 
271
319
  Version 0.3.34 (tzdata v2012h) - 27-Oct-2012
272
320
  --------------------------------------------
273
321
 
274
322
  * Updated to tzdata version 2012h
275
- (http://mm.icann.org/pipermail/tz-announce/2012-October/000006.html).
323
+ (https://mm.icann.org/pipermail/tz-announce/2012-October/000006.html).
276
324
 
277
325
 
278
326
  Version 0.3.33 (tzdata v2012c) - 8-Apr-2012
279
327
  -------------------------------------------
280
328
 
281
329
  * Updated to tzdata version 2012c
282
- (http://article.gmane.org/gmane.comp.time.tz/4859).
330
+ (https://mm.icann.org/pipermail/tz/2012-April/017627.html).
283
331
 
284
332
 
285
333
  Version 0.3.32 (tzdata v2012b) - 4-Mar-2012
286
334
  -------------------------------------------
287
335
 
288
336
  * Updated to tzdata version 2012b
289
- (http://article.gmane.org/gmane.comp.time.tz/4756).
337
+ (https://mm.icann.org/pipermail/tz/2012-March/017524.html).
290
338
 
291
339
 
292
340
  Version 0.3.31 (tzdata v2011n) - 6-Nov-2011
293
341
  -------------------------------------------
294
342
 
295
343
  * Updated to tzdata version 2011n
296
- (http://article.gmane.org/gmane.comp.time.tz/4434).
344
+ (https://mm.icann.org/pipermail/tz/2011-October/017201.html).
297
345
 
298
346
 
299
347
  Version 0.3.30 (tzdata v2011k) - 29-Sep-2011
300
348
  --------------------------------------------
301
349
 
302
350
  * Updated to tzdata version 2011k
303
- (http://article.gmane.org/gmane.comp.time.tz/4084).
351
+ (https://mm.icann.org/pipermail/tz/2011-September/008889.html).
304
352
 
305
353
 
306
354
  Version 0.3.29 (tzdata v2011h) - 27-Jun-2011
307
355
  --------------------------------------------
308
356
 
309
357
  * Updated to tzdata version 2011h
310
- (http://article.gmane.org/gmane.comp.time.tz/3814).
358
+ (https://mm.icann.org/pipermail/tz/2011-June/008576.html).
311
359
  * Allow the default value of the local_to_utc and period_for_local dst
312
360
  parameter to be specified globally with a Timezone.default_dst attribute.
313
361
  Thanks to Kurt Werle for the suggestion and patch.
@@ -325,35 +373,35 @@ Version 0.3.27 (tzdata v2011g) - 26-Apr-2011
325
373
  --------------------------------------------
326
374
 
327
375
  * Updated to tzdata version 2011g
328
- (http://article.gmane.org/gmane.comp.time.tz/3758).
376
+ (https://mm.icann.org/pipermail/tz/2011-April/016875.html).
329
377
 
330
378
 
331
379
  Version 0.3.26 (tzdata v2011e) - 2-Apr-2011
332
380
  -------------------------------------------
333
381
 
334
382
  * Updated to tzdata version 2011e
335
- (http://article.gmane.org/gmane.comp.time.tz/3707).
383
+ (https://mm.icann.org/pipermail/tz/2011-April/016809.html).
336
384
 
337
385
 
338
386
  Version 0.3.25 (tzdata v2011d) - 14-Mar-2011
339
387
  --------------------------------------------
340
388
 
341
389
  * Updated to tzdata version 2011d
342
- (http://article.gmane.org/gmane.comp.time.tz/3662).
390
+ (https://mm.icann.org/pipermail/tz/2011-March/016746.html).
343
391
 
344
392
 
345
393
  Version 0.3.24 (tzdata v2010o) - 15-Jan-2011
346
394
  --------------------------------------------
347
395
 
348
396
  * Updated to tzdata version 2010o
349
- (http://article.gmane.org/gmane.comp.time.tz/3473).
397
+ (https://mm.icann.org/pipermail/tz/2010-November/016517.html).
350
398
 
351
399
 
352
400
  Version 0.3.23 (tzdata v2010l) - 19-Aug-2010
353
401
  --------------------------------------------
354
402
 
355
403
  * Updated to tzdata version 2010l
356
- (http://article.gmane.org/gmane.comp.time.tz/3354).
404
+ (https://mm.icann.org/pipermail/tz/2010-August/016360.html).
357
405
 
358
406
 
359
407
  Version 0.3.22 (tzdata v2010j) - 29-May-2010
@@ -366,7 +414,7 @@ Version 0.3.21 (tzdata v2010j) - 28-May-2010
366
414
  --------------------------------------------
367
415
 
368
416
  * Updated to tzdata version 2010j
369
- (http://article.gmane.org/gmane.comp.time.tz/3225).
417
+ (https://mm.icann.org/pipermail/tz/2010-May/016211.html).
370
418
  * Change invalid timezone check to exclude characters not used in timezone
371
419
  identifiers and avoid 'character class has duplicated range' warnings with
372
420
  Ruby 1.9.2.
@@ -384,28 +432,28 @@ Version 0.3.20 (tzdata v2010i) - 19-Apr-2010
384
432
  --------------------------------------------
385
433
 
386
434
  * Updated to tzdata version 2010i
387
- (http://article.gmane.org/gmane.comp.time.tz/3202).
435
+ (https://mm.icann.org/pipermail/tz/2010-April/016184.html).
388
436
 
389
437
 
390
438
  Version 0.3.19 (tzdata v2010h) - 5-Apr-2010
391
439
  -------------------------------------------
392
440
 
393
441
  * Updated to tzdata version 2010h
394
- (http://article.gmane.org/gmane.comp.time.tz/3188).
442
+ (https://mm.icann.org/pipermail/tz/2010-April/016161.html).
395
443
 
396
444
 
397
445
  Version 0.3.18 (tzdata v2010g) - 29-Mar-2010
398
446
  --------------------------------------------
399
447
 
400
448
  * Updated to tzdata version 2010g
401
- (http://article.gmane.org/gmane.comp.time.tz/3172).
449
+ (https://mm.icann.org/pipermail/tz/2010-March/016140.html).
402
450
 
403
451
 
404
452
  Version 0.3.17 (tzdata v2010e) - 8-Mar-2010
405
453
  -------------------------------------------
406
454
 
407
455
  * Updated to tzdata version 2010e
408
- (http://article.gmane.org/gmane.comp.time.tz/3128).
456
+ (https://mm.icann.org/pipermail/tz/2010-March/016088.html).
409
457
 
410
458
 
411
459
  Version 0.3.16 (tzdata v2009u) - 5-Jan-2010
@@ -414,14 +462,14 @@ Version 0.3.16 (tzdata v2009u) - 5-Jan-2010
414
462
  * Support the use of '-' to denote '0' as an offset in the tz data files.
415
463
  Used for the first time in the SAVE field in tzdata v2009u.
416
464
  * Updated to tzdata version 2009u
417
- (http://article.gmane.org/gmane.comp.time.tz/3053).
465
+ (https://mm.icann.org/pipermail/tz/2009-December/016001.html).
418
466
 
419
467
 
420
468
  Version 0.3.15 (tzdata v2009p) - 26-Oct-2009
421
469
  --------------------------------------------
422
470
 
423
471
  * Updated to tzdata version 2009p
424
- (http://article.gmane.org/gmane.comp.time.tz/2953).
472
+ (https://mm.icann.org/pipermail/tz/2009-October/015889.html).
425
473
  * Added a description to the gem spec.
426
474
  * List test files in test_files instead of files in the gem spec.
427
475
 
@@ -430,7 +478,7 @@ Version 0.3.14 (tzdata v2009l) - 19-Aug-2009
430
478
  --------------------------------------------
431
479
 
432
480
  * Updated to tzdata version 2009l
433
- (http://article.gmane.org/gmane.comp.time.tz/2818).
481
+ (https://mm.icann.org/pipermail/tz/2009-August/015729.html).
434
482
  * Include current directory in load path to allow running tests on
435
483
  Ruby 1.9.2, which doesn't include it by default any more.
436
484
 
@@ -439,7 +487,7 @@ Version 0.3.13 (tzdata v2009f) - 15-Apr-2009
439
487
  --------------------------------------------
440
488
 
441
489
  * Updated to tzdata version 2009f
442
- (http://article.gmane.org/gmane.comp.time.tz/2668).
490
+ (https://mm.icann.org/pipermail/tz/2009-April/015544.html).
443
491
  * Untaint the timezone module filename after validation to allow use
444
492
  with $SAFE == 1 (e.g. under mod_ruby). Thanks to Dmitry Borodaenko for
445
493
  the suggestion. Closes #25349.
@@ -449,14 +497,14 @@ Version 0.3.12 (tzdata v2008i) - 12-Nov-2008
449
497
  --------------------------------------------
450
498
 
451
499
  * Updated to tzdata version 2008i
452
- (http://article.gmane.org/gmane.comp.time.tz/2440).
500
+ (https://mm.icann.org/pipermail/tz/2008-October/015260.html).
453
501
 
454
502
 
455
503
  Version 0.3.11 (tzdata v2008g) - 7-Oct-2008
456
504
  -------------------------------------------
457
505
 
458
506
  * Updated to tzdata version 2008g
459
- (http://article.gmane.org/gmane.comp.time.tz/2335).
507
+ (https://mm.icann.org/pipermail/tz/2008-October/015139.html).
460
508
  * Support Ruby 1.9.0-5. Rational.new! has now been removed in Ruby 1.9.
461
509
  Only use Rational.new! if it is available (it is preferable in Ruby 1.8
462
510
  for performance reasons). Thanks to Jeremy Kemper and Pratik Naik for
@@ -469,14 +517,14 @@ Version 0.3.10 (tzdata v2008f) - 16-Sep-2008
469
517
  --------------------------------------------
470
518
 
471
519
  * Updated to tzdata version 2008f
472
- (http://article.gmane.org/gmane.comp.time.tz/2293).
520
+ (https://mm.icann.org/pipermail/tz/2008-September/015090.html).
473
521
 
474
522
 
475
523
  Version 0.3.9 (tzdata v2008c) - 27-May-2008
476
524
  -------------------------------------------
477
525
 
478
526
  * Updated to tzdata version 2008c
479
- (http://article.gmane.org/gmane.comp.time.tz/2183).
527
+ (https://mm.icann.org/pipermail/tz/2008-May/014956.html).
480
528
  * Support loading timezone data in the latest trunk versions of Ruby 1.9.
481
529
  Rational.new! is now private, so call it using Rational.send :new! instead.
482
530
  Thanks to Jeremy Kemper and Pratik Naik for spotting this. Closes #19184.
@@ -488,7 +536,7 @@ Version 0.3.8 (tzdata v2008b) - 24-Mar-2008
488
536
  -------------------------------------------
489
537
 
490
538
  * Updated to tzdata version 2008b
491
- (http://article.gmane.org/gmane.comp.time.tz/2149).
539
+ (https://mm.icann.org/pipermail/tz/2008-March/014910.html).
492
540
  * Support loading timezone data in Ruby 1.9.0. Use DateTime.new! if it is
493
541
  available instead of DateTime.new0 when constructing transition times.
494
542
  DateTime.new! was added in Ruby 1.8.6. DateTime.new0 was removed in
@@ -501,14 +549,14 @@ Version 0.3.7 (tzdata v2008a) - 10-Mar-2008
501
549
  -------------------------------------------
502
550
 
503
551
  * Updated to tzdata version 2008a
504
- (http://article.gmane.org/gmane.comp.time.tz/2071).
552
+ (https://mm.icann.org/pipermail/tz/2008-March/014851.html).
505
553
 
506
554
 
507
555
  Version 0.3.6 (tzdata v2007k) - 1-Jan-2008
508
556
  ------------------------------------------
509
557
 
510
558
  * Updated to tzdata version 2007k
511
- (http://article.gmane.org/gmane.comp.time.tz/2029).
559
+ (https://mm.icann.org/pipermail/tz/2007-December/014765.html).
512
560
  * Removed deprecated RubyGems autorequire option.
513
561
 
514
562
 
@@ -516,28 +564,28 @@ Version 0.3.5 (tzdata v2007h) - 1-Oct-2007
516
564
  ------------------------------------------
517
565
 
518
566
  * Updated to tzdata version 2007h
519
- (http://article.gmane.org/gmane.comp.time.tz/1878).
567
+ (https://mm.icann.org/pipermail/tz/2007-October/014585.html).
520
568
 
521
569
 
522
570
  Version 0.3.4 (tzdata v2007g) - 21-Aug-2007
523
571
  -------------------------------------------
524
572
 
525
573
  * Updated to tzdata version 2007g
526
- (http://article.gmane.org/gmane.comp.time.tz/1810).
574
+ (https://mm.icann.org/pipermail/tz/2007-August/014499.html).
527
575
 
528
576
 
529
577
  Version 0.3.3 (tzdata v2006p) - 27-Nov-2006
530
578
  -------------------------------------------
531
579
 
532
580
  * Updated to tzdata version 2006p
533
- (http://article.gmane.org/gmane.comp.time.tz/1358).
581
+ (https://mm.icann.org/pipermail/tz/2006-November/013999.html).
534
582
 
535
583
 
536
584
  Version 0.3.2 (tzdata v2006n) - 11-Oct-2006
537
585
  -------------------------------------------
538
586
 
539
587
  * Updated to tzdata version 2006n
540
- (http://article.gmane.org/gmane.comp.time.tz/1288). Note that this release of
588
+ (https://mm.icann.org/pipermail/tz/2006-October/013911.html). Note that this release of
541
589
  tzdata removes the country Serbia and Montenegro (CS) and replaces it with
542
590
  separate Serbia (RS) and Montenegro (ME) entries.
543
591
 
@@ -548,7 +596,7 @@ Version 0.3.1 (tzdata v2006j) - 21-Aug-2006
548
596
  * Remove colon from case statements to avoid warning in Ruby 1.8.5. #5198.
549
597
  * Use temporary variable to avoid dynamic string warning from rdoc.
550
598
  * Updated to tzdata version 2006j
551
- (http://article.gmane.org/gmane.comp.time.tz/1175).
599
+ (https://mm.icann.org/pipermail/tz/2006-August/013767.html).
552
600
 
553
601
 
554
602
  Version 0.3.0 (tzdata v2006g) - 17-Jul-2006
@@ -614,7 +662,7 @@ Version 0.2.2 (tzdata v2006g) - 17-May-2006
614
662
  zone identifier.
615
663
  * The zdumptestall utility now exits if not supplied with enough parameters.
616
664
  * Updated to tzdata version 2006g
617
- (http://article.gmane.org/gmane.comp.time.tz/1008).
665
+ (https://mm.icann.org/pipermail/tz/2006-May/013590.html).
618
666
 
619
667
 
620
668
  Version 0.2.1 (tzdata v2006d) - 17-Apr-2006
@@ -630,7 +678,7 @@ Version 0.2.1 (tzdata v2006d) - 17-Apr-2006
630
678
  Jamis Buck for reporting this.
631
679
  * Added abbreviation as an alias for TimezonePeriod.zone_identifier.
632
680
  * Updated to tzdata version 2006d
633
- (http://article.gmane.org/gmane.comp.time.tz/936).
681
+ (https://mm.icann.org/pipermail/tz/2006-April/013517.html).
634
682
  * Ignore any offset in DateTimes passed in (as is already done for Times).
635
683
  All of the following now refer to the same UTC time (15:40 on 17 April 2006).
636
684
  Previously, the DateTime in the second line would have been interpreted
@@ -663,7 +711,7 @@ Version 0.2.0 (tzdata v2006c) - 3-Apr-2006
663
711
  * Omit the final transition to DST if there is a prior transition in the last
664
712
  year processed to standard time.
665
713
  * Updated to tzdata version 2006c
666
- (http://article.gmane.org/gmane.comp.time.tz/920).
714
+ (https://mm.icann.org/pipermail/tz/2006-April/013500.html).
667
715
 
668
716
 
669
717
  Version 0.1.2 (tzdata v2006a) - 5-Feb-2006
@@ -672,7 +720,7 @@ Version 0.1.2 (tzdata v2006a) - 5-Feb-2006
672
720
  * Add lib directory to the load path when tzinfo is required. Makes it easier
673
721
  to use tzinfo gem when unpacked to vendor directory in rails.
674
722
  * Updated to tzdata version 2006a
675
- (http://article.gmane.org/gmane.comp.time.tz/738).
723
+ (https://mm.icann.org/pipermail/tz/2006-January/013311.html).
676
724
  * build_tz_classes rake task now handles running svn add and svn delete as new
677
725
  timezones and countries are added and old ones are removed.
678
726
  * Return a better error when attempting to use a Timezone instance that was
@@ -777,7 +825,7 @@ Version 0.0.2 (tzdata v2005m) - 13-Sep-2005
777
825
 
778
826
  Thanks to Scott Barron of Lunchbox Software for the suggestions in his
779
827
  article about using TZInfo with Rails
780
- (http://lunchroom.lunchboxsoftware.com/pages/tzinfo_rails)
828
+ (https://web.archive.org/web/20060425190845/http://lunchroom.lunchboxsoftware.com/pages/tzinfo_rails)
781
829
 
782
830
 
783
831
  Version 0.0.1 (tzdata v2005m) - 29-Aug-2005
data/LICENSE CHANGED
@@ -1,4 +1,4 @@
1
- Copyright (c) 2005-2018 Philip Ross
1
+ Copyright (c) 2005-2022 Philip Ross
2
2
 
3
3
  Permission is hereby granted, free of charge, to any person obtaining a copy of
4
4
  this software and associated documentation files (the "Software"), to deal in
data/README.md CHANGED
@@ -1,9 +1,9 @@
1
1
  TZInfo - Ruby Timezone Library
2
2
  ==============================
3
3
 
4
- [![Gem Version](https://badge.fury.io/rb/tzinfo.svg)](http://badge.fury.io/rb/tzinfo) [![Build Status](https://travis-ci.org/tzinfo/tzinfo.svg?branch=master)](https://travis-ci.org/tzinfo/tzinfo)
4
+ [![RubyGems](https://img.shields.io/gem/v/tzinfo?logo=rubygems&label=Gem)](https://rubygems.org/gems/tzinfo) [![Tests](https://github.com/tzinfo/tzinfo/workflows/Tests/badge.svg?branch=1.2&event=push)](https://github.com/tzinfo/tzinfo/actions?query=workflow%3ATests+branch%3A1.2+event%3Apush)
5
5
 
6
- [TZInfo](http://tzinfo.github.io) provides daylight savings aware
6
+ [TZInfo](https://tzinfo.github.io) provides daylight savings aware
7
7
  transformations between times in different timezones.
8
8
 
9
9
 
@@ -13,10 +13,10 @@ Data Sources
13
13
  TZInfo requires a source of timezone data. There are two built-in options:
14
14
 
15
15
  1. The TZInfo::Data library (the tzinfo-data gem). TZInfo::Data contains a set
16
- of Ruby modules that are generated from the [IANA Time Zone Database](http://www.iana.org/time-zones).
16
+ of Ruby modules that are generated from the [IANA Time Zone Database](https://www.iana.org/time-zones).
17
17
  2. A zoneinfo directory. Most Unix-like systems include a zoneinfo directory
18
18
  containing timezone definitions. These are also generated from the
19
- [IANA Time Zone Database](http://www.iana.org/time-zones).
19
+ [IANA Time Zone Database](https://www.iana.org/time-zones).
20
20
 
21
21
  By default, TZInfo::Data will be used. If TZInfo::Data is not available (i.e.
22
22
  if `require 'tzinfo/data'` fails), then TZInfo will search for a zoneinfo
@@ -25,7 +25,7 @@ directory instead (using the search path specified by
25
25
 
26
26
  If no data source can be found, a `TZInfo::DataSourceNotFound` exception will be
27
27
  raised when TZInfo is used. Further information is available
28
- [in the wiki](http://tzinfo.github.io/datasourcenotfound) to help with
28
+ [in the wiki](https://tzinfo.github.io/datasourcenotfound) to help with
29
29
  resolving `TZInfo::DataSourceNotFound` errors.
30
30
 
31
31
  The default data source selection can be overridden using
@@ -60,8 +60,9 @@ of `TZInfo::Timezone`) and convert a time in UTC to local New York time:
60
60
  local = tz.utc_to_local(Time.utc(2005,8,29,15,35,0))
61
61
 
62
62
  Note that the local Time returned will have a UTC timezone (`local.zone` will
63
- return `"UTC"`). This is because the Ruby Time class only supports two timezones:
64
- UTC and the current system local timezone.
63
+ return `"UTC"`). This is because the Time class in older (but still supported by
64
+ TZInfo) versions of Ruby can only handle two timezones: UTC and the system local
65
+ timezone.
65
66
 
66
67
  To convert from a local time to UTC, the `local_to_utc` method can be used as
67
68
  follows:
@@ -129,7 +130,7 @@ thread boundaries.
129
130
  Documentation
130
131
  -------------
131
132
 
132
- API documentation for TZInfo is available on [RubyDoc.info](http://rubydoc.info/gems/tzinfo/frames).
133
+ API documentation for TZInfo is available on [RubyDoc.info](https://rubydoc.info/gems/tzinfo/frames).
133
134
 
134
135
 
135
136
  License
@@ -0,0 +1,51 @@
1
+ module TZInfo
2
+ # A set of rules that define when transitions occur in time zones with
3
+ # annually occurring daylight savings time.
4
+ #
5
+ # @private
6
+ class AnnualRules #:nodoc:
7
+ # Returned by #transitions. #offset is the TimezoneOffset that applies
8
+ # from the UTC TimeOrDateTime #at. #previous_offset is the prior
9
+ # TimezoneOffset.
10
+ Transition = Struct.new(:offset, :previous_offset, :at)
11
+
12
+ # The standard offset that applies when daylight savings time is not in
13
+ # force.
14
+ attr_reader :std_offset
15
+
16
+ # The offset that applies when daylight savings time is in force.
17
+ attr_reader :dst_offset
18
+
19
+ # The rule that determines when daylight savings time starts.
20
+ attr_reader :dst_start_rule
21
+
22
+ # The rule that determines when daylight savings time ends.
23
+ attr_reader :dst_end_rule
24
+
25
+ # Initializes a new {AnnualRules} instance.
26
+ def initialize(std_offset, dst_offset, dst_start_rule, dst_end_rule)
27
+ @std_offset = std_offset
28
+ @dst_offset = dst_offset
29
+ @dst_start_rule = dst_start_rule
30
+ @dst_end_rule = dst_end_rule
31
+ end
32
+
33
+ # Returns the transitions between standard and daylight savings time for a
34
+ # given year. The results are ordered by time of occurrence (earliest to
35
+ # latest).
36
+ def transitions(year)
37
+ start_dst = apply_rule(@dst_start_rule, @std_offset, @dst_offset, year)
38
+ end_dst = apply_rule(@dst_end_rule, @dst_offset, @std_offset, year)
39
+
40
+ end_dst.at < start_dst.at ? [end_dst, start_dst] : [start_dst, end_dst]
41
+ end
42
+
43
+ private
44
+
45
+ # Applies a given rule between offsets on a year.
46
+ def apply_rule(rule, from_offset, to_offset, year)
47
+ at = rule.at(from_offset, year)
48
+ Transition.new(to_offset, from_offset, at)
49
+ end
50
+ end
51
+ end
@@ -179,7 +179,7 @@ module TZInfo
179
179
  begin
180
180
  return ZoneinfoDataSource.new
181
181
  rescue ZoneinfoDirectoryNotFound
182
- raise DataSourceNotFound, "No source of timezone data could be found.\nPlease refer to http://tzinfo.github.io/datasourcenotfound for help resolving this error."
182
+ raise DataSourceNotFound, "No source of timezone data could be found.\nPlease refer to https://tzinfo.github.io/datasourcenotfound for help resolving this error."
183
183
  end
184
184
  end
185
185