tzinfo 1.2.5 → 1.2.7

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of tzinfo might be problematic. Click here for more details.

checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ff316f9ef3e063d02096d2d1841b832491e315d78610d8751b09115632794e9f
4
- data.tar.gz: b695fca6cdc7af5cd356dbb592aacc81c861d64e05375a5c6238c9ae924fe8be
3
+ metadata.gz: c5b964ab83943597cb8ce6f141378398fe1bc4fe4b767dd9434f04030332b008
4
+ data.tar.gz: bcdda83a2bfc8e90d0f62a8ddab56f6de246c2c44b64cc00347838f64fc28a87
5
5
  SHA512:
6
- metadata.gz: 6ab8e7340dd1eafa73c385e388d49c2bf07203e855b3410c6302abc9b5e5b9992f1cfdb9aa5dc5dc59664f713618e25eac7489b7be5209a5987162e90cfe48d9
7
- data.tar.gz: 5db4b130ed3db4b07d350b6acb020781d6538c9f9295d478b297fe994c2ac4220dbd76097ed2c5a26219cdf6ec10bb18df6816f904cdd0c5ac1193782730785c
6
+ metadata.gz: 7921a1c86b6307ee7b554edc6de33d2ed07ca8660c804f3ca78099485a72e26bcd23af498a955dfd7dfa5efb0c2f95e6adbdadbd0d60ef492732f1fdfd79f0d9
7
+ data.tar.gz: a0b59904238b08bbebc38a359db873dfadc0a98ef7a2fb6241f91219c642432dc8ae643ff0cf844d16bae0ef61173bac16c5f69863cde60fe504105d4240f48f
@@ -1,3 +1,3 @@
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
+ \*��81l.��V��O8rx�H�'��D9[4��D�r�K4jO��HO��p_QK���_�)��w& C���(����O�F&Q�b
2
+ ��pL5!��l��ψè���2r4iq&�86��MX����Ƭ��K_W�#�!����]\�@,ބ3��,H�?���'̙V6����̰������"͗�¡�#C��|f:��*�X(���a�Í�
3
+  ѿs!�BS���H��3�yD��q�X�g�׌
data.tar.gz.sig CHANGED
Binary file
data/CHANGES.md CHANGED
@@ -1,3 +1,21 @@
1
+ Version 1.2.7 - 2-Apr-2020
2
+ --------------------------
3
+
4
+ * Fixed 'wrong number of arguments' errors when running on JRuby 9.0. #114.
5
+ * Fixed warnings when running on Ruby 2.8. #112.
6
+
7
+
8
+ Version 1.2.6 - 24-Dec-2019
9
+ ---------------------------
10
+
11
+ * Timezone#strftime('%s', time) will now return the correct number of seconds
12
+ since the epoch. #91.
13
+ * Removed the unused TZInfo::RubyDataSource::REQUIRE_PATH constant.
14
+ * Fixed "SecurityError: Insecure operation - require" exceptions when loading
15
+ data with recent Ruby releases in safe mode.
16
+ * Fixed warnings when running on Ruby 2.7. #106 and #111.
17
+
18
+
1
19
  Version 1.2.5 - 4-Feb-2018
2
20
  --------------------------
3
21
 
@@ -191,70 +209,70 @@ Version 0.3.45 (tzdata v2015g) - 3-Oct-2015
191
209
  -------------------------------------------
192
210
 
193
211
  * Updated to tzdata version 2015g
194
- (http://mm.icann.org/pipermail/tz-announce/2015-October/000034.html).
212
+ (https://mm.icann.org/pipermail/tz-announce/2015-October/000034.html).
195
213
 
196
214
 
197
215
  Version 0.3.44 (tzdata v2015d) - 24-Apr-2015
198
216
  --------------------------------------------
199
217
 
200
218
  * Updated to tzdata version 2015d
201
- (http://mm.icann.org/pipermail/tz-announce/2015-April/000031.html).
219
+ (https://mm.icann.org/pipermail/tz-announce/2015-April/000031.html).
202
220
 
203
221
 
204
222
  Version 0.3.43 (tzdata v2015a) - 31-Jan-2015
205
223
  --------------------------------------------
206
224
 
207
225
  * Updated to tzdata version 2015a
208
- (http://mm.icann.org/pipermail/tz-announce/2015-January/000028.html).
226
+ (https://mm.icann.org/pipermail/tz-announce/2015-January/000028.html).
209
227
 
210
228
 
211
229
  Version 0.3.42 (tzdata v2014i) - 23-Oct-2014
212
230
  --------------------------------------------
213
231
 
214
232
  * Updated to tzdata version 2014i
215
- (http://mm.icann.org/pipermail/tz-announce/2014-October/000026.html).
233
+ (https://mm.icann.org/pipermail/tz-announce/2014-October/000026.html).
216
234
 
217
235
 
218
236
  Version 0.3.41 (tzdata v2014f) - 8-Aug-2014
219
237
  -------------------------------------------
220
238
 
221
239
  * Updated to tzdata version 2014f
222
- (http://mm.icann.org/pipermail/tz-announce/2014-August/000023.html).
240
+ (https://mm.icann.org/pipermail/tz-announce/2014-August/000023.html).
223
241
 
224
242
 
225
243
  Version 0.3.40 (tzdata v2014e) - 10-Jul-2014
226
244
  --------------------------------------------
227
245
 
228
246
  * Updated to tzdata version 2014e
229
- (http://mm.icann.org/pipermail/tz-announce/2014-June/000022.html).
247
+ (https://mm.icann.org/pipermail/tz-announce/2014-June/000022.html).
230
248
 
231
249
 
232
250
  Version 0.3.39 (tzdata v2014a) - 9-Mar-2014
233
251
  -------------------------------------------
234
252
 
235
253
  * Updated to tzdata version 2014a
236
- (http://mm.icann.org/pipermail/tz-announce/2014-March/000018.html).
254
+ (https://mm.icann.org/pipermail/tz-announce/2014-March/000018.html).
237
255
 
238
256
 
239
257
  Version 0.3.38 (tzdata v2013g) - 8-Oct-2013
240
258
  -------------------------------------------
241
259
 
242
260
  * Updated to tzdata version 2013g
243
- (http://mm.icann.org/pipermail/tz-announce/2013-October/000015.html).
261
+ (https://mm.icann.org/pipermail/tz-announce/2013-October/000015.html).
244
262
 
245
263
 
246
264
  Version 0.3.37 (tzdata v2013b) - 11-Mar-2013
247
265
  --------------------------------------------
248
266
 
249
267
  * Updated to tzdata version 2013b
250
- (http://mm.icann.org/pipermail/tz-announce/2013-March/000010.html).
268
+ (https://mm.icann.org/pipermail/tz-announce/2013-March/000010.html).
251
269
 
252
270
 
253
271
  Version 0.3.36 (tzdata v2013a) - 3-Mar-2013
254
272
  -------------------------------------------
255
273
 
256
274
  * Updated to tzdata version 2013a
257
- (http://mm.icann.org/pipermail/tz-announce/2013-March/000009.html).
275
+ (https://mm.icann.org/pipermail/tz-announce/2013-March/000009.html).
258
276
  * Fix TimezoneTransitionInfo#eql? incorrectly returning false when running on
259
277
  Ruby 2.0.
260
278
  * Change eql? and == implementations to test the class of the passed in object
@@ -265,49 +283,49 @@ Version 0.3.35 (tzdata v2012i) - 4-Nov-2012
265
283
  -------------------------------------------
266
284
 
267
285
  * Updated to tzdata version 2012i
268
- (http://mm.icann.org/pipermail/tz-announce/2012-November/000007.html).
286
+ (https://mm.icann.org/pipermail/tz-announce/2012-November/000007.html).
269
287
 
270
288
 
271
289
  Version 0.3.34 (tzdata v2012h) - 27-Oct-2012
272
290
  --------------------------------------------
273
291
 
274
292
  * Updated to tzdata version 2012h
275
- (http://mm.icann.org/pipermail/tz-announce/2012-October/000006.html).
293
+ (https://mm.icann.org/pipermail/tz-announce/2012-October/000006.html).
276
294
 
277
295
 
278
296
  Version 0.3.33 (tzdata v2012c) - 8-Apr-2012
279
297
  -------------------------------------------
280
298
 
281
299
  * Updated to tzdata version 2012c
282
- (http://article.gmane.org/gmane.comp.time.tz/4859).
300
+ (https://mm.icann.org/pipermail/tz/2012-April/017627.html).
283
301
 
284
302
 
285
303
  Version 0.3.32 (tzdata v2012b) - 4-Mar-2012
286
304
  -------------------------------------------
287
305
 
288
306
  * Updated to tzdata version 2012b
289
- (http://article.gmane.org/gmane.comp.time.tz/4756).
307
+ (https://mm.icann.org/pipermail/tz/2012-March/017524.html).
290
308
 
291
309
 
292
310
  Version 0.3.31 (tzdata v2011n) - 6-Nov-2011
293
311
  -------------------------------------------
294
312
 
295
313
  * Updated to tzdata version 2011n
296
- (http://article.gmane.org/gmane.comp.time.tz/4434).
314
+ (https://mm.icann.org/pipermail/tz/2011-October/017201.html).
297
315
 
298
316
 
299
317
  Version 0.3.30 (tzdata v2011k) - 29-Sep-2011
300
318
  --------------------------------------------
301
319
 
302
320
  * Updated to tzdata version 2011k
303
- (http://article.gmane.org/gmane.comp.time.tz/4084).
321
+ (https://mm.icann.org/pipermail/tz/2011-September/008889.html).
304
322
 
305
323
 
306
324
  Version 0.3.29 (tzdata v2011h) - 27-Jun-2011
307
325
  --------------------------------------------
308
326
 
309
327
  * Updated to tzdata version 2011h
310
- (http://article.gmane.org/gmane.comp.time.tz/3814).
328
+ (https://mm.icann.org/pipermail/tz/2011-June/008576.html).
311
329
  * Allow the default value of the local_to_utc and period_for_local dst
312
330
  parameter to be specified globally with a Timezone.default_dst attribute.
313
331
  Thanks to Kurt Werle for the suggestion and patch.
@@ -325,35 +343,35 @@ Version 0.3.27 (tzdata v2011g) - 26-Apr-2011
325
343
  --------------------------------------------
326
344
 
327
345
  * Updated to tzdata version 2011g
328
- (http://article.gmane.org/gmane.comp.time.tz/3758).
346
+ (https://mm.icann.org/pipermail/tz/2011-April/016875.html).
329
347
 
330
348
 
331
349
  Version 0.3.26 (tzdata v2011e) - 2-Apr-2011
332
350
  -------------------------------------------
333
351
 
334
352
  * Updated to tzdata version 2011e
335
- (http://article.gmane.org/gmane.comp.time.tz/3707).
353
+ (https://mm.icann.org/pipermail/tz/2011-April/016809.html).
336
354
 
337
355
 
338
356
  Version 0.3.25 (tzdata v2011d) - 14-Mar-2011
339
357
  --------------------------------------------
340
358
 
341
359
  * Updated to tzdata version 2011d
342
- (http://article.gmane.org/gmane.comp.time.tz/3662).
360
+ (https://mm.icann.org/pipermail/tz/2011-March/016746.html).
343
361
 
344
362
 
345
363
  Version 0.3.24 (tzdata v2010o) - 15-Jan-2011
346
364
  --------------------------------------------
347
365
 
348
366
  * Updated to tzdata version 2010o
349
- (http://article.gmane.org/gmane.comp.time.tz/3473).
367
+ (https://mm.icann.org/pipermail/tz/2010-November/016517.html).
350
368
 
351
369
 
352
370
  Version 0.3.23 (tzdata v2010l) - 19-Aug-2010
353
371
  --------------------------------------------
354
372
 
355
373
  * Updated to tzdata version 2010l
356
- (http://article.gmane.org/gmane.comp.time.tz/3354).
374
+ (https://mm.icann.org/pipermail/tz/2010-August/016360.html).
357
375
 
358
376
 
359
377
  Version 0.3.22 (tzdata v2010j) - 29-May-2010
@@ -366,7 +384,7 @@ Version 0.3.21 (tzdata v2010j) - 28-May-2010
366
384
  --------------------------------------------
367
385
 
368
386
  * Updated to tzdata version 2010j
369
- (http://article.gmane.org/gmane.comp.time.tz/3225).
387
+ (https://mm.icann.org/pipermail/tz/2010-May/016211.html).
370
388
  * Change invalid timezone check to exclude characters not used in timezone
371
389
  identifiers and avoid 'character class has duplicated range' warnings with
372
390
  Ruby 1.9.2.
@@ -384,28 +402,28 @@ Version 0.3.20 (tzdata v2010i) - 19-Apr-2010
384
402
  --------------------------------------------
385
403
 
386
404
  * Updated to tzdata version 2010i
387
- (http://article.gmane.org/gmane.comp.time.tz/3202).
405
+ (https://mm.icann.org/pipermail/tz/2010-April/016184.html).
388
406
 
389
407
 
390
408
  Version 0.3.19 (tzdata v2010h) - 5-Apr-2010
391
409
  -------------------------------------------
392
410
 
393
411
  * Updated to tzdata version 2010h
394
- (http://article.gmane.org/gmane.comp.time.tz/3188).
412
+ (https://mm.icann.org/pipermail/tz/2010-April/016161.html).
395
413
 
396
414
 
397
415
  Version 0.3.18 (tzdata v2010g) - 29-Mar-2010
398
416
  --------------------------------------------
399
417
 
400
418
  * Updated to tzdata version 2010g
401
- (http://article.gmane.org/gmane.comp.time.tz/3172).
419
+ (https://mm.icann.org/pipermail/tz/2010-March/016140.html).
402
420
 
403
421
 
404
422
  Version 0.3.17 (tzdata v2010e) - 8-Mar-2010
405
423
  -------------------------------------------
406
424
 
407
425
  * Updated to tzdata version 2010e
408
- (http://article.gmane.org/gmane.comp.time.tz/3128).
426
+ (https://mm.icann.org/pipermail/tz/2010-March/016088.html).
409
427
 
410
428
 
411
429
  Version 0.3.16 (tzdata v2009u) - 5-Jan-2010
@@ -414,14 +432,14 @@ Version 0.3.16 (tzdata v2009u) - 5-Jan-2010
414
432
  * Support the use of '-' to denote '0' as an offset in the tz data files.
415
433
  Used for the first time in the SAVE field in tzdata v2009u.
416
434
  * Updated to tzdata version 2009u
417
- (http://article.gmane.org/gmane.comp.time.tz/3053).
435
+ (https://mm.icann.org/pipermail/tz/2009-December/016001.html).
418
436
 
419
437
 
420
438
  Version 0.3.15 (tzdata v2009p) - 26-Oct-2009
421
439
  --------------------------------------------
422
440
 
423
441
  * Updated to tzdata version 2009p
424
- (http://article.gmane.org/gmane.comp.time.tz/2953).
442
+ (https://mm.icann.org/pipermail/tz/2009-October/015889.html).
425
443
  * Added a description to the gem spec.
426
444
  * List test files in test_files instead of files in the gem spec.
427
445
 
@@ -430,7 +448,7 @@ Version 0.3.14 (tzdata v2009l) - 19-Aug-2009
430
448
  --------------------------------------------
431
449
 
432
450
  * Updated to tzdata version 2009l
433
- (http://article.gmane.org/gmane.comp.time.tz/2818).
451
+ (https://mm.icann.org/pipermail/tz/2009-August/015729.html).
434
452
  * Include current directory in load path to allow running tests on
435
453
  Ruby 1.9.2, which doesn't include it by default any more.
436
454
 
@@ -439,7 +457,7 @@ Version 0.3.13 (tzdata v2009f) - 15-Apr-2009
439
457
  --------------------------------------------
440
458
 
441
459
  * Updated to tzdata version 2009f
442
- (http://article.gmane.org/gmane.comp.time.tz/2668).
460
+ (https://mm.icann.org/pipermail/tz/2009-April/015544.html).
443
461
  * Untaint the timezone module filename after validation to allow use
444
462
  with $SAFE == 1 (e.g. under mod_ruby). Thanks to Dmitry Borodaenko for
445
463
  the suggestion. Closes #25349.
@@ -449,14 +467,14 @@ Version 0.3.12 (tzdata v2008i) - 12-Nov-2008
449
467
  --------------------------------------------
450
468
 
451
469
  * Updated to tzdata version 2008i
452
- (http://article.gmane.org/gmane.comp.time.tz/2440).
470
+ (https://mm.icann.org/pipermail/tz/2008-October/015260.html).
453
471
 
454
472
 
455
473
  Version 0.3.11 (tzdata v2008g) - 7-Oct-2008
456
474
  -------------------------------------------
457
475
 
458
476
  * Updated to tzdata version 2008g
459
- (http://article.gmane.org/gmane.comp.time.tz/2335).
477
+ (https://mm.icann.org/pipermail/tz/2008-October/015139.html).
460
478
  * Support Ruby 1.9.0-5. Rational.new! has now been removed in Ruby 1.9.
461
479
  Only use Rational.new! if it is available (it is preferable in Ruby 1.8
462
480
  for performance reasons). Thanks to Jeremy Kemper and Pratik Naik for
@@ -469,14 +487,14 @@ Version 0.3.10 (tzdata v2008f) - 16-Sep-2008
469
487
  --------------------------------------------
470
488
 
471
489
  * Updated to tzdata version 2008f
472
- (http://article.gmane.org/gmane.comp.time.tz/2293).
490
+ (https://mm.icann.org/pipermail/tz/2008-September/015090.html).
473
491
 
474
492
 
475
493
  Version 0.3.9 (tzdata v2008c) - 27-May-2008
476
494
  -------------------------------------------
477
495
 
478
496
  * Updated to tzdata version 2008c
479
- (http://article.gmane.org/gmane.comp.time.tz/2183).
497
+ (https://mm.icann.org/pipermail/tz/2008-May/014956.html).
480
498
  * Support loading timezone data in the latest trunk versions of Ruby 1.9.
481
499
  Rational.new! is now private, so call it using Rational.send :new! instead.
482
500
  Thanks to Jeremy Kemper and Pratik Naik for spotting this. Closes #19184.
@@ -488,7 +506,7 @@ Version 0.3.8 (tzdata v2008b) - 24-Mar-2008
488
506
  -------------------------------------------
489
507
 
490
508
  * Updated to tzdata version 2008b
491
- (http://article.gmane.org/gmane.comp.time.tz/2149).
509
+ (https://mm.icann.org/pipermail/tz/2008-March/014910.html).
492
510
  * Support loading timezone data in Ruby 1.9.0. Use DateTime.new! if it is
493
511
  available instead of DateTime.new0 when constructing transition times.
494
512
  DateTime.new! was added in Ruby 1.8.6. DateTime.new0 was removed in
@@ -501,14 +519,14 @@ Version 0.3.7 (tzdata v2008a) - 10-Mar-2008
501
519
  -------------------------------------------
502
520
 
503
521
  * Updated to tzdata version 2008a
504
- (http://article.gmane.org/gmane.comp.time.tz/2071).
522
+ (https://mm.icann.org/pipermail/tz/2008-March/014851.html).
505
523
 
506
524
 
507
525
  Version 0.3.6 (tzdata v2007k) - 1-Jan-2008
508
526
  ------------------------------------------
509
527
 
510
528
  * Updated to tzdata version 2007k
511
- (http://article.gmane.org/gmane.comp.time.tz/2029).
529
+ (https://mm.icann.org/pipermail/tz/2007-December/014765.html).
512
530
  * Removed deprecated RubyGems autorequire option.
513
531
 
514
532
 
@@ -516,28 +534,28 @@ Version 0.3.5 (tzdata v2007h) - 1-Oct-2007
516
534
  ------------------------------------------
517
535
 
518
536
  * Updated to tzdata version 2007h
519
- (http://article.gmane.org/gmane.comp.time.tz/1878).
537
+ (https://mm.icann.org/pipermail/tz/2007-October/014585.html).
520
538
 
521
539
 
522
540
  Version 0.3.4 (tzdata v2007g) - 21-Aug-2007
523
541
  -------------------------------------------
524
542
 
525
543
  * Updated to tzdata version 2007g
526
- (http://article.gmane.org/gmane.comp.time.tz/1810).
544
+ (https://mm.icann.org/pipermail/tz/2007-August/014499.html).
527
545
 
528
546
 
529
547
  Version 0.3.3 (tzdata v2006p) - 27-Nov-2006
530
548
  -------------------------------------------
531
549
 
532
550
  * Updated to tzdata version 2006p
533
- (http://article.gmane.org/gmane.comp.time.tz/1358).
551
+ (https://mm.icann.org/pipermail/tz/2006-November/013999.html).
534
552
 
535
553
 
536
554
  Version 0.3.2 (tzdata v2006n) - 11-Oct-2006
537
555
  -------------------------------------------
538
556
 
539
557
  * Updated to tzdata version 2006n
540
- (http://article.gmane.org/gmane.comp.time.tz/1288). Note that this release of
558
+ (https://mm.icann.org/pipermail/tz/2006-October/013911.html). Note that this release of
541
559
  tzdata removes the country Serbia and Montenegro (CS) and replaces it with
542
560
  separate Serbia (RS) and Montenegro (ME) entries.
543
561
 
@@ -548,7 +566,7 @@ Version 0.3.1 (tzdata v2006j) - 21-Aug-2006
548
566
  * Remove colon from case statements to avoid warning in Ruby 1.8.5. #5198.
549
567
  * Use temporary variable to avoid dynamic string warning from rdoc.
550
568
  * Updated to tzdata version 2006j
551
- (http://article.gmane.org/gmane.comp.time.tz/1175).
569
+ (https://mm.icann.org/pipermail/tz/2006-August/013767.html).
552
570
 
553
571
 
554
572
  Version 0.3.0 (tzdata v2006g) - 17-Jul-2006
@@ -614,7 +632,7 @@ Version 0.2.2 (tzdata v2006g) - 17-May-2006
614
632
  zone identifier.
615
633
  * The zdumptestall utility now exits if not supplied with enough parameters.
616
634
  * Updated to tzdata version 2006g
617
- (http://article.gmane.org/gmane.comp.time.tz/1008).
635
+ (https://mm.icann.org/pipermail/tz/2006-May/013590.html).
618
636
 
619
637
 
620
638
  Version 0.2.1 (tzdata v2006d) - 17-Apr-2006
@@ -630,7 +648,7 @@ Version 0.2.1 (tzdata v2006d) - 17-Apr-2006
630
648
  Jamis Buck for reporting this.
631
649
  * Added abbreviation as an alias for TimezonePeriod.zone_identifier.
632
650
  * Updated to tzdata version 2006d
633
- (http://article.gmane.org/gmane.comp.time.tz/936).
651
+ (https://mm.icann.org/pipermail/tz/2006-April/013517.html).
634
652
  * Ignore any offset in DateTimes passed in (as is already done for Times).
635
653
  All of the following now refer to the same UTC time (15:40 on 17 April 2006).
636
654
  Previously, the DateTime in the second line would have been interpreted
@@ -663,7 +681,7 @@ Version 0.2.0 (tzdata v2006c) - 3-Apr-2006
663
681
  * Omit the final transition to DST if there is a prior transition in the last
664
682
  year processed to standard time.
665
683
  * Updated to tzdata version 2006c
666
- (http://article.gmane.org/gmane.comp.time.tz/920).
684
+ (https://mm.icann.org/pipermail/tz/2006-April/013500.html).
667
685
 
668
686
 
669
687
  Version 0.1.2 (tzdata v2006a) - 5-Feb-2006
@@ -672,7 +690,7 @@ Version 0.1.2 (tzdata v2006a) - 5-Feb-2006
672
690
  * Add lib directory to the load path when tzinfo is required. Makes it easier
673
691
  to use tzinfo gem when unpacked to vendor directory in rails.
674
692
  * Updated to tzdata version 2006a
675
- (http://article.gmane.org/gmane.comp.time.tz/738).
693
+ (https://mm.icann.org/pipermail/tz/2006-January/013311.html).
676
694
  * build_tz_classes rake task now handles running svn add and svn delete as new
677
695
  timezones and countries are added and old ones are removed.
678
696
  * Return a better error when attempting to use a Timezone instance that was
@@ -777,7 +795,7 @@ Version 0.0.2 (tzdata v2005m) - 13-Sep-2005
777
795
 
778
796
  Thanks to Scott Barron of Lunchbox Software for the suggestions in his
779
797
  article about using TZInfo with Rails
780
- (http://lunchroom.lunchboxsoftware.com/pages/tzinfo_rails)
798
+ (https://web.archive.org/web/20060425190845/http://lunchroom.lunchboxsoftware.com/pages/tzinfo_rails)
781
799
 
782
800
 
783
801
  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-2020 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)](https://rubygems.org/gems/tzinfo) [![Travis CI Build](https://img.shields.io/travis/tzinfo/tzinfo/1.2?logo=travis)](https://travis-ci.org/tzinfo/tzinfo) [![AppVeyor Build](https://img.shields.io/appveyor/build/philr/tzinfo/1.2?logo=appveyor)](https://ci.appveyor.com/project/philr/tzinfo/branch/1.2)
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
@@ -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
 
@@ -137,10 +137,33 @@ module TZInfo
137
137
  def self.open_file(file_name, mode, opts, &block)
138
138
  File.open(file_name, mode, &block)
139
139
  end
140
- else
140
+ elsif RUBY_VERSION =~ /\A1\.9\./
141
141
  def self.open_file(file_name, mode, opts, &block)
142
142
  File.open(file_name, mode, opts, &block)
143
143
  end
144
+ else
145
+ # Evaluate method as a string because **opts isn't valid syntax prior to
146
+ # Ruby 2.0.
147
+ eval(<<-EOF
148
+ def self.open_file(file_name, mode, opts, &block)
149
+ File.open(file_name, mode, **opts, &block)
150
+ end
151
+ EOF
152
+ )
153
+ end
154
+
155
+
156
+ # Object#untaint is a deprecated no-op in Ruby >= 2.7 and will be removed in
157
+ # 3.2. Add a refinement to either silence the warning, or supply the method
158
+ # if needed.
159
+ if !Object.new.respond_to?(:untaint) || RUBY_VERSION =~ /\A(\d+)\.(\d+)(?:\.|\z)/ && ($1 == '2' && $2.to_i >= 7 || $1.to_i >= 3)
160
+ module UntaintExt
161
+ refine Object do
162
+ def untaint
163
+ self
164
+ end
165
+ end
166
+ end
144
167
  end
145
168
  end
146
169
  end
@@ -1,4 +1,8 @@
1
1
  module TZInfo
2
+ # Use send as a workaround for erroneous 'wrong number of arguments' errors
3
+ # with JRuby 9.0.5.0 when calling methods with Java implementations. See #114.
4
+ send(:using, RubyCoreSupport::UntaintExt) if RubyCoreSupport.const_defined?(:UntaintExt)
5
+
2
6
  # A DataSource that loads data from the set of Ruby modules included in the
3
7
  # TZInfo::Data library (tzinfo-data gem).
4
8
  #
@@ -6,15 +10,30 @@ module TZInfo
6
10
  #
7
11
  # TZInfo::DataSource.set(:ruby)
8
12
  class RubyDataSource < DataSource
9
- # Base path for require.
10
- REQUIRE_PATH = File.join('tzinfo', 'data', 'definitions')
11
-
12
13
  # Whether the timezone index has been loaded yet.
13
14
  @@timezone_index_loaded = false
14
15
 
15
16
  # Whether the country index has been loaded yet.
16
17
  @@country_index_loaded = false
17
18
 
19
+ # Initializes a new RubyDataSource instance.
20
+ def initialize
21
+ tzinfo_data = File.join('tzinfo', 'data')
22
+ begin
23
+ require(tzinfo_data)
24
+
25
+ data_file = File.join('', 'tzinfo', 'data.rb')
26
+ path = $".reverse_each.detect {|p| p.end_with?(data_file) }
27
+ if path
28
+ @base_path = File.join(File.dirname(path), 'data').untaint
29
+ else
30
+ @base_path = tzinfo_data
31
+ end
32
+ rescue LoadError
33
+ @base_path = tzinfo_data
34
+ end
35
+ end
36
+
18
37
  # Returns a TimezoneInfo instance for a given identifier.
19
38
  # Raises InvalidTimezoneIdentifier if the timezone is not found or the
20
39
  # identifier is invalid.
@@ -93,27 +112,17 @@ module TZInfo
93
112
  end
94
113
 
95
114
  # Requires an index by its name.
96
- def self.require_index(name)
115
+ def require_index(name)
97
116
  require_data(*['indexes', name])
98
117
  end
99
118
 
100
119
  # Requires a file from tzinfo/data.
101
120
  def require_data(*file)
102
- self.class.require_data(*file)
103
- end
104
-
105
- # Requires a file from tzinfo/data.
106
- def self.require_data(*file)
107
- require File.join('tzinfo', 'data', *file)
121
+ require(File.join(@base_path, *file))
108
122
  end
109
123
 
110
124
  # Loads in the index of timezones if it hasn't already been loaded.
111
125
  def load_timezone_index
112
- self.class.load_timezone_index
113
- end
114
-
115
- # Loads in the index of timezones if it hasn't already been loaded.
116
- def self.load_timezone_index
117
126
  unless @@timezone_index_loaded
118
127
  require_index('timezones')
119
128
  @@timezone_index_loaded = true
@@ -122,11 +131,6 @@ module TZInfo
122
131
 
123
132
  # Loads in the index of countries if it hasn't already been loaded.
124
133
  def load_country_index
125
- self.class.load_country_index
126
- end
127
-
128
- # Loads in the index of countries if it hasn't already been loaded.
129
- def self.load_country_index
130
134
  unless @@country_index_loaded
131
135
  require_index('countries')
132
136
  @@country_index_loaded = true
@@ -571,17 +571,21 @@ module TZInfo
571
571
  # version 2.0.0, %z will be passed to Time#strftime and DateTime#strftime
572
572
  # instead. Some of the formatting options may cease to be available
573
573
  # depending on the version of Ruby in use (for example, %:::z is only
574
- # supported by Time#strftime from MRI version 2.0.0 onwards.)
574
+ # supported by Time#strftime from MRI version 2.0.0 onwards).
575
575
  def strftime(format, utc = Time.now.utc)
576
+ utc = TimeOrDateTime.wrap(utc)
576
577
  period = period_for_utc(utc)
577
- local = period.to_local(utc)
578
- local = Time.at(local).utc unless local.kind_of?(Time) || local.kind_of?(DateTime)
578
+ local_wrapped = period.to_local(utc)
579
+ local = local_wrapped.to_orig
580
+ local = local_wrapped.to_time unless local.kind_of?(Time) || local.kind_of?(DateTime)
579
581
  abbreviation = period.abbreviation.to_s.gsub(/%/, '%%')
580
582
 
581
- format = format.gsub(/%(%*)(Z|:*z)/) do
583
+ format = format.gsub(/%(%*)([sZ]|:*z)/) do
582
584
  if $1.length.odd?
583
585
  # Escaped literal percent or series of percents. Pass on to strftime.
584
586
  "#$1%#$2"
587
+ elsif $2 == "s"
588
+ "#$1#{utc.to_i}"
585
589
  elsif $2 == "Z"
586
590
  "#$1#{abbreviation}"
587
591
  else
@@ -600,8 +604,8 @@ module TZInfo
600
604
  # Passing the invalid format string through to Time#strftime or
601
605
  # DateTime#strtime would normally result in it being returned in the
602
606
  # result. However, with Ruby 1.8.7 on Windows (as tested with Ruby
603
- # 1.8.7-p374 from http://rubyinstaller.org/downloads/archives), this
604
- # causes Time#strftime to always return an empty string (e.g.
607
+ # 1.8.7-p374 from https://rubyinstaller.org/downloads/archives),
608
+ # this causes Time#strftime to always return an empty string (e.g.
605
609
  # Time.now.strftime('a %::::z b') returns '').
606
610
  #
607
611
  # Escape the percent to force it to be evaluated as a literal.
@@ -1,4 +1,12 @@
1
1
  module TZInfo
2
+ # Use send as a workaround for an issue on JRuby 9.2.9.0 where using the
3
+ # refinement causes calls to RubyCoreSupport.file_open to fail to pass the
4
+ # block parameter.
5
+ #
6
+ # https://travis-ci.org/tzinfo/tzinfo/jobs/628812051#L1931
7
+ # https://github.com/jruby/jruby/issues/6009
8
+ send(:using, TZInfo::RubyCoreSupport::UntaintExt) if TZInfo::RubyCoreSupport.const_defined?(:UntaintExt)
9
+
2
10
  # An InvalidZoneinfoDirectory exception is raised if the DataSource is
3
11
  # set to a specific zoneinfo path, which is not a valid zoneinfo directory
4
12
  # (i.e. a directory containing index files named iso3166.tab and zone.tab
@@ -1,4 +1,8 @@
1
1
  module TZInfo
2
+ # Use send as a workaround for erroneous 'wrong number of arguments' errors
3
+ # with JRuby 9.0.5.0 when calling methods with Java implementations. See #114.
4
+ send(:using, RubyCoreSupport::UntaintExt) if RubyCoreSupport.const_defined?(:UntaintExt)
5
+
2
6
  # An InvalidZoneinfoFile exception is raised if an attempt is made to load an
3
7
  # invalid zoneinfo file.
4
8
  class InvalidZoneinfoFile < StandardError
@@ -2,6 +2,10 @@ require File.join(File.expand_path(File.dirname(__FILE__)), 'test_utils')
2
2
 
3
3
  include TZInfo
4
4
 
5
+ # Use send as a workaround for erroneous 'wrong number of arguments' errors with
6
+ # JRuby 9.0.5.0 when calling methods with Java implementations. See #114.
7
+ send(:using, TaintExt) if Module.const_defined?(:TaintExt)
8
+
5
9
  class TCCountry < Minitest::Test
6
10
  def setup
7
11
  @orig_data_source = DataSource.get
@@ -46,7 +50,7 @@ class TCCountry < Minitest::Test
46
50
  def test_get_tainted_loaded
47
51
  Country.get('GB')
48
52
 
49
- safe_test do
53
+ safe_test(:unavailable => :skip) do
50
54
  code = 'GB'.dup.taint
51
55
  assert(code.tainted?)
52
56
  country = Country.get(code)
@@ -65,7 +69,7 @@ class TCCountry < Minitest::Test
65
69
  end
66
70
 
67
71
  def test_get_tainted_not_previously_loaded
68
- safe_test do
72
+ safe_test(:unavailable => :skip) do
69
73
  code = 'GB'.dup.taint
70
74
  assert(code.tainted?)
71
75
  country = Country.get(code)
@@ -2,11 +2,31 @@ require File.join(File.expand_path(File.dirname(__FILE__)), 'test_utils')
2
2
 
3
3
  include TZInfo
4
4
 
5
+ # Use send as a workaround for erroneous 'wrong number of arguments' errors with
6
+ # JRuby 9.0.5.0 when calling methods with Java implementations. See #114.
7
+ send(:using, TaintExt) if Module.const_defined?(:TaintExt)
8
+
5
9
  class TCRubyDataSource < Minitest::Test
6
10
  def setup
7
11
  @data_source = RubyDataSource.new
8
12
  end
9
13
 
14
+ def test_initialize_not_found
15
+ # A failure to load tzinfo/data in initialize will not cause an exception.
16
+ # Attempts to load data files will subsequently fail.
17
+ code = <<-EOF
18
+ begin
19
+ ds = TZInfo::RubyDataSource.new
20
+ puts 'Initialized'
21
+ ds.load_timezone_info('Europe/London')
22
+ rescue Exception => e
23
+ puts e.class
24
+ end
25
+ EOF
26
+
27
+ assert_sub_process_returns(['Initialized', 'TZInfo::InvalidTimezoneIdentifier'], code)
28
+ end
29
+
10
30
  def test_load_timezone_info_data
11
31
  info = @data_source.load_timezone_info('Europe/London')
12
32
  assert_kind_of(DataTimezoneInfo, info)
@@ -55,7 +75,9 @@ class TCRubyDataSource < Minitest::Test
55
75
  end
56
76
 
57
77
  def test_load_timezone_info_tainted
58
- safe_test do
78
+ skip_if_has_bug_14060
79
+
80
+ safe_test(:unavailable => :skip) do
59
81
  identifier = 'Europe/Amsterdam'.dup.taint
60
82
  assert(identifier.tainted?)
61
83
  info = @data_source.load_timezone_info(identifier)
@@ -65,6 +87,8 @@ class TCRubyDataSource < Minitest::Test
65
87
  end
66
88
 
67
89
  def test_load_timezone_info_tainted_and_frozen
90
+ skip_if_has_bug_14060
91
+
68
92
  safe_test do
69
93
  info = @data_source.load_timezone_info('Europe/Amsterdam'.dup.taint.freeze)
70
94
  assert_equal('Europe/Amsterdam', info.identifier)
@@ -119,7 +143,7 @@ class TCRubyDataSource < Minitest::Test
119
143
  end
120
144
 
121
145
  def test_load_country_info_tainted
122
- safe_test do
146
+ safe_test(:unavailable => :skip) do
123
147
  code = 'NL'.dup.taint
124
148
  assert(code.tainted?)
125
149
  info = @data_source.load_country_info(code)
@@ -4,6 +4,12 @@ require 'rational' unless defined?(Rational)
4
4
  include TZInfo
5
5
 
6
6
  class TCTimeOrDateTime < Minitest::Test
7
+ # Ruby 1.8.7 (built with GCC 8.3.0 on Ubuntu 19.04) fails to perform DateTime
8
+ # arithmetic operations correctly when sub-seconds are used. Detect this and
9
+ # disable the affected tests.
10
+ DATETIME_SUBSECOND_ARITHMETIC_IS_BROKEN = (DateTime.new(2019, 12, 22, 15, 0, Rational(1, 1000)) + Rational(1, 86400)).strftime('%Q') != '1577026801001'
11
+ puts "DateTime sub-second arithmetic is broken on this platform" if DATETIME_SUBSECOND_ARITHMETIC_IS_BROKEN
12
+
7
13
  def test_initialize_time
8
14
  assert_nothing_raised do
9
15
  TimeOrDateTime.new(Time.utc(2006, 3, 24, 15, 32, 3, 721000))
@@ -500,12 +506,12 @@ class TCTimeOrDateTime < Minitest::Test
500
506
  assert_equal(Time.utc(2006, 3, 24, 15, 32, 4), (TimeOrDateTime.new(Time.utc(2006, 3, 24, 15, 32, 3)) + 1).to_orig)
501
507
  assert_equal(Time.utc(2006, 3, 24, 15, 32, 4, 721000), (TimeOrDateTime.new(Time.utc(2006, 3, 24, 15, 32, 3, 721000)) + 1).to_orig)
502
508
  assert_equal(DateTime.new(2006, 3, 24, 15, 32, 4), (TimeOrDateTime.new(DateTime.new(2006, 3, 24, 15, 32, 3)) + 1).to_orig)
503
- assert_equal(DateTime.new(2006, 3, 24, 15, 32, 4 + Rational(721, 1000)), (TimeOrDateTime.new(DateTime.new(2006, 3, 24, 15, 32, 3 + Rational(721, 1000))) + 1).to_orig)
509
+ assert_equal(DateTime.new(2006, 3, 24, 15, 32, 4 + Rational(721, 1000)), (TimeOrDateTime.new(DateTime.new(2006, 3, 24, 15, 32, 3 + Rational(721, 1000))) + 1).to_orig) unless DATETIME_SUBSECOND_ARITHMETIC_IS_BROKEN
504
510
  assert_equal(1143214324, (TimeOrDateTime.new(1143214323) + 1).to_orig)
505
511
  assert_equal(Time.utc(2006, 3, 24, 15, 32, 2), (TimeOrDateTime.new(Time.utc(2006, 3, 24, 15, 32, 3)) + (-1)).to_orig)
506
512
  assert_equal(Time.utc(2006, 3, 24, 15, 32, 2, 721000), (TimeOrDateTime.new(Time.utc(2006, 3, 24, 15, 32, 3, 721000)) + (-1)).to_orig)
507
513
  assert_equal(DateTime.new(2006, 3, 24, 15, 32, 2), (TimeOrDateTime.new(DateTime.new(2006, 3, 24, 15, 32, 3)) + (-1)).to_orig)
508
- assert_equal(DateTime.new(2006, 3, 24, 15, 32, 2 + Rational(721, 1000)), (TimeOrDateTime.new(DateTime.new(2006, 3, 24, 15, 32, 3 + Rational(721, 1000))) + (-1)).to_orig)
514
+ assert_equal(DateTime.new(2006, 3, 24, 15, 32, 2 + Rational(721, 1000)), (TimeOrDateTime.new(DateTime.new(2006, 3, 24, 15, 32, 3 + Rational(721, 1000))) + (-1)).to_orig) unless DATETIME_SUBSECOND_ARITHMETIC_IS_BROKEN
509
515
  assert_equal(1143214322, (TimeOrDateTime.new(1143214323) + (-1)).to_orig)
510
516
  end
511
517
 
@@ -518,12 +524,12 @@ class TCTimeOrDateTime < Minitest::Test
518
524
  assert_equal(Time.utc(2006, 3, 24, 15, 32, 2), (TimeOrDateTime.new(Time.utc(2006, 3, 24, 15, 32, 3)) - 1).to_orig)
519
525
  assert_equal(Time.utc(2006, 3, 24, 15, 32, 2, 721000), (TimeOrDateTime.new(Time.utc(2006, 3, 24, 15, 32, 3, 721000)) - 1).to_orig)
520
526
  assert_equal(DateTime.new(2006, 3, 24, 15, 32, 2), (TimeOrDateTime.new(DateTime.new(2006, 3, 24, 15, 32, 3)) - 1).to_orig)
521
- assert_equal(DateTime.new(2006, 3, 24, 15, 32, 2 + Rational(721, 1000)), (TimeOrDateTime.new(DateTime.new(2006, 3, 24, 15, 32, 3 + Rational(721, 1000))) - 1).to_orig)
527
+ assert_equal(DateTime.new(2006, 3, 24, 15, 32, 2 + Rational(721, 1000)), (TimeOrDateTime.new(DateTime.new(2006, 3, 24, 15, 32, 3 + Rational(721, 1000))) - 1).to_orig) unless DATETIME_SUBSECOND_ARITHMETIC_IS_BROKEN
522
528
  assert_equal(1143214322, (TimeOrDateTime.new(1143214323) - 1).to_orig)
523
529
  assert_equal(Time.utc(2006, 3, 24, 15, 32, 4), (TimeOrDateTime.new(Time.utc(2006, 3, 24, 15, 32, 3)) - (-1)).to_orig)
524
530
  assert_equal(Time.utc(2006, 3, 24, 15, 32, 4, 721000), (TimeOrDateTime.new(Time.utc(2006, 3, 24, 15, 32, 3, 721000)) - (-1)).to_orig)
525
531
  assert_equal(DateTime.new(2006, 3, 24, 15, 32, 4), (TimeOrDateTime.new(DateTime.new(2006, 3, 24, 15, 32, 3)) - (-1)).to_orig)
526
- assert_equal(DateTime.new(2006, 3, 24, 15, 32, 4 + Rational(721, 1000)), (TimeOrDateTime.new(DateTime.new(2006, 3, 24, 15, 32, 3 + Rational(721, 1000))) - (-1)).to_orig)
532
+ assert_equal(DateTime.new(2006, 3, 24, 15, 32, 4 + Rational(721, 1000)), (TimeOrDateTime.new(DateTime.new(2006, 3, 24, 15, 32, 3 + Rational(721, 1000))) - (-1)).to_orig) unless DATETIME_SUBSECOND_ARITHMETIC_IS_BROKEN
527
533
  assert_equal(1143214324, (TimeOrDateTime.new(1143214323) - (-1)).to_orig)
528
534
  end
529
535
 
@@ -536,12 +542,12 @@ class TCTimeOrDateTime < Minitest::Test
536
542
  assert_equal(Time.utc(2006, 3, 24, 15, 32, 4), TimeOrDateTime.new(Time.utc(2006, 3, 24, 15, 32, 3)).add_with_convert(1).to_orig)
537
543
  assert_equal(Time.utc(2006, 3, 24, 15, 32, 4, 721000), TimeOrDateTime.new(Time.utc(2006, 3, 24, 15, 32, 3, 721000)).add_with_convert(1).to_orig)
538
544
  assert_equal(DateTime.new(2006, 3, 24, 15, 32, 4), TimeOrDateTime.new(DateTime.new(2006, 3, 24, 15, 32, 3)).add_with_convert(1).to_orig)
539
- assert_equal(DateTime.new(2006, 3, 24, 15, 32, 4 + Rational(721, 1000)), TimeOrDateTime.new(DateTime.new(2006, 3, 24, 15, 32, 3 + Rational(721, 1000))).add_with_convert(1).to_orig)
545
+ assert_equal(DateTime.new(2006, 3, 24, 15, 32, 4 + Rational(721, 1000)), TimeOrDateTime.new(DateTime.new(2006, 3, 24, 15, 32, 3 + Rational(721, 1000))).add_with_convert(1).to_orig) unless DATETIME_SUBSECOND_ARITHMETIC_IS_BROKEN
540
546
  assert_equal(1143214324, TimeOrDateTime.new(1143214323).add_with_convert(1).to_orig)
541
547
  assert_equal(Time.utc(2006, 3, 24, 15, 32, 2), TimeOrDateTime.new(Time.utc(2006, 3, 24, 15, 32, 3)).add_with_convert(-1).to_orig)
542
548
  assert_equal(Time.utc(2006, 3, 24, 15, 32, 2, 721000), TimeOrDateTime.new(Time.utc(2006, 3, 24, 15, 32, 3, 721000)).add_with_convert(-1).to_orig)
543
549
  assert_equal(DateTime.new(2006, 3, 24, 15, 32, 2), TimeOrDateTime.new(DateTime.new(2006, 3, 24, 15, 32, 3)).add_with_convert(-1).to_orig)
544
- assert_equal(DateTime.new(2006, 3, 24, 15, 32, 2 + Rational(721, 1000)), TimeOrDateTime.new(DateTime.new(2006, 3, 24, 15, 32, 3 + Rational(721, 1000))).add_with_convert(-1).to_orig)
550
+ assert_equal(DateTime.new(2006, 3, 24, 15, 32, 2 + Rational(721, 1000)), TimeOrDateTime.new(DateTime.new(2006, 3, 24, 15, 32, 3 + Rational(721, 1000))).add_with_convert(-1).to_orig) unless DATETIME_SUBSECOND_ARITHMETIC_IS_BROKEN
545
551
  assert_equal(1143214322, TimeOrDateTime.new(1143214323).add_with_convert(-1).to_orig)
546
552
 
547
553
  if RubyCoreSupport.time_supports_negative
@@ -2,6 +2,10 @@ require File.join(File.expand_path(File.dirname(__FILE__)), 'test_utils')
2
2
 
3
3
  include TZInfo
4
4
 
5
+ # Use send as a workaround for erroneous 'wrong number of arguments' errors with
6
+ # JRuby 9.0.5.0 when calling methods with Java implementations. See #114.
7
+ send(:using, TaintExt) if Module.const_defined?(:TaintExt)
8
+
5
9
  class TCTimezone < Minitest::Test
6
10
 
7
11
  class BlockCalled < StandardError
@@ -242,7 +246,7 @@ class TCTimezone < Minitest::Test
242
246
  def test_get_tainted_loaded
243
247
  Timezone.get('Europe/Andorra')
244
248
 
245
- safe_test do
249
+ safe_test(:unavailable => :skip) do
246
250
  identifier = 'Europe/Andorra'.dup.taint
247
251
  assert(identifier.tainted?)
248
252
  tz = Timezone.get(identifier)
@@ -261,7 +265,9 @@ class TCTimezone < Minitest::Test
261
265
  end
262
266
 
263
267
  def test_get_tainted_not_previously_loaded
264
- safe_test do
268
+ skip_if_has_bug_14060
269
+
270
+ safe_test(:unavailable => :skip) do
265
271
  identifier = 'Europe/Andorra'.dup.taint
266
272
  assert(identifier.tainted?)
267
273
  tz = Timezone.get(identifier)
@@ -271,6 +277,8 @@ class TCTimezone < Minitest::Test
271
277
  end
272
278
 
273
279
  def test_get_tainted_and_frozen_not_previously_loaded
280
+ skip_if_has_bug_14060
281
+
274
282
  safe_test do
275
283
  tz = Timezone.get('Europe/Amsterdam'.dup.taint.freeze)
276
284
  assert_equal('Europe/Amsterdam', tz.identifier)
@@ -1260,6 +1268,7 @@ class TCTimezone < Minitest::Test
1260
1268
  assert_equal('BST BST', tz.strftime('%Z %Z', dt))
1261
1269
  assert_equal('BST %Z %BST %%Z %%BST', tz.strftime('%Z %%Z %%%Z %%%%Z %%%%%Z', dt))
1262
1270
  assert_equal('+0100 +01:00 +01:00:00 +01 %::::z', tz.strftime('%z %:z %::z %:::z %::::z', dt))
1271
+ assert_equal('1153001522 %s %1153001522', tz.strftime('%s %%s %%%s', dt))
1263
1272
  end
1264
1273
 
1265
1274
  def test_strftime_time
@@ -1271,6 +1280,7 @@ class TCTimezone < Minitest::Test
1271
1280
  assert_equal('BST BST', tz.strftime('%Z %Z', t))
1272
1281
  assert_equal('BST %Z %BST %%Z %%BST', tz.strftime('%Z %%Z %%%Z %%%%Z %%%%%Z', t))
1273
1282
  assert_equal('+0100 +01:00 +01:00:00 +01 %::::z', tz.strftime('%z %:z %::z %:::z %::::z', t))
1283
+ assert_equal('1153001522 %s %1153001522', tz.strftime('%s %%s %%%s', t))
1274
1284
  end
1275
1285
 
1276
1286
  def test_strftime_int
@@ -1282,6 +1292,7 @@ class TCTimezone < Minitest::Test
1282
1292
  assert_equal('BST BST', tz.strftime('%Z %Z', i))
1283
1293
  assert_equal('BST %Z %BST %%Z %%BST', tz.strftime('%Z %%Z %%%Z %%%%Z %%%%%Z', i))
1284
1294
  assert_equal('+0100 +01:00 +01:00:00 +01 %::::z', tz.strftime('%z %:z %::z %:::z %::::z', i))
1295
+ assert_equal('1153001522 %s %1153001522', tz.strftime('%s %%s %%%s', i))
1285
1296
  end
1286
1297
 
1287
1298
  def test_get_missing_data_source
@@ -359,7 +359,17 @@ class TCTransitionDataTimezoneInfo < Minitest::Test
359
359
  assert_equal([t1,t2,t3,t4,t5], dti.transitions_up_to(DateTime.new(2011,10,1,1,0,Rational(DATETIME_RESOLUTION,1000000))))
360
360
  assert_equal([t1,t2,t3,t4,t5], dti.transitions_up_to(DateTime.new(2011,10,1,1,0,1), DateTime.new(2010,4,1,1,0,0)))
361
361
  assert_equal([t2,t3,t4,t5], dti.transitions_up_to(DateTime.new(2011,10,1,1,0,1), DateTime.new(2010,4,1,1,0,1)))
362
- assert_equal([t2,t3,t4,t5], dti.transitions_up_to(DateTime.new(2011,10,1,1,0,1), DateTime.new(2010,4,1,1,0,Rational(DATETIME_RESOLUTION,1000000))))
362
+
363
+ # Ruby 1.8.7 (built with GCC 8.3.0 on Ubuntu 19.04) fails to perform
364
+ # DateTime comparisons correctly when sub-seconds are used.
365
+ to = DateTime.new(2011,10,1,1,0,1)
366
+ from = DateTime.new(2010,4,1,1,0,Rational(DATETIME_RESOLUTION,1000000))
367
+ if to > from
368
+ assert_equal([t2,t3,t4,t5], dti.transitions_up_to(to, from))
369
+ else
370
+ puts "This platform does not consider the DateTime #{to.strftime('%Y-%m-%d %H:%m:%S.%N')} to be later than the DateTime #{from.strftime('%Y-%m-%d %H:%m:%S.%N')}"
371
+ end
372
+
363
373
  assert_equal([t5], dti.transitions_up_to(DateTime.new(2015,1,1,0,0,0), DateTime.new(2011,10,1,1,0,0)))
364
374
  assert_equal([], dti.transitions_up_to(DateTime.new(2015,1,1,0,0,0), DateTime.new(2011,10,1,1,0,1)))
365
375
  end
@@ -7,6 +7,15 @@ require 'tmpdir'
7
7
 
8
8
  include TZInfo
9
9
 
10
+ # Use send as a workaround for an issue on JRuby 9.2.9.0 where using the
11
+ # refinement causes calls to RubyCoreSupport.file_open to fail to pass the block
12
+ # parameter.
13
+ #
14
+ # https://travis-ci.org/tzinfo/tzinfo/jobs/628812051#L1931
15
+ # https://github.com/jruby/jruby/issues/6009
16
+ send(:using, TZInfo::RubyCoreSupport::UntaintExt) if TZInfo::RubyCoreSupport.const_defined?(:UntaintExt)
17
+ send(:using, TaintExt) if Module.const_defined?(:TaintExt)
18
+
10
19
  class TCZoneinfoDataSource < Minitest::Test
11
20
  ZONEINFO_DIR = File.join(File.expand_path(File.dirname(__FILE__)), 'zoneinfo').untaint
12
21
 
@@ -653,7 +662,7 @@ class TCZoneinfoDataSource < Minitest::Test
653
662
  end
654
663
 
655
664
  def test_load_timezone_info_tainted
656
- safe_test do
665
+ safe_test(:unavailable => :skip) do
657
666
  identifier = 'Europe/Amsterdam'.dup.taint
658
667
  assert(identifier.tainted?)
659
668
  info = @data_source.load_timezone_info(identifier)
@@ -840,7 +849,7 @@ class TCZoneinfoDataSource < Minitest::Test
840
849
  end
841
850
 
842
851
  def test_load_country_info_tainted
843
- safe_test do
852
+ safe_test(:unavailable => :skip) do
844
853
  code = 'NL'.dup.taint
845
854
  assert(code.tainted?)
846
855
  info = @data_source.load_country_info(code)
@@ -5,6 +5,10 @@ require 'tempfile'
5
5
 
6
6
  include TZInfo
7
7
 
8
+ # Use send as a workaround for erroneous 'wrong number of arguments' errors with
9
+ # JRuby 9.0.5.0 when calling methods with Java implementations. See #114.
10
+ send(:using, RubyCoreSupport::UntaintExt) if RubyCoreSupport.const_defined?(:UntaintExt)
11
+
8
12
  class TCZoneinfoTimezoneInfo < Minitest::Test
9
13
 
10
14
  begin
@@ -1,4 +1,6 @@
1
- TESTS_DIR = File.expand_path(File.dirname(__FILE__)).untaint
1
+ tests_dir = File.expand_path(File.dirname(__FILE__))
2
+ tests_dir.untaint if RUBY_VERSION < '2.7'
3
+ TESTS_DIR = tests_dir
2
4
  TZINFO_LIB_DIR = File.expand_path(File.join(TESTS_DIR, '..', 'lib'))
3
5
  TZINFO_TEST_DATA_DIR = File.join(TESTS_DIR, 'tzinfo-data')
4
6
  TZINFO_TEST_ZONEINFO_DIR = File.join(TESTS_DIR, 'zoneinfo')
@@ -55,8 +57,8 @@ module Kernel
55
57
  end
56
58
 
57
59
  def safe_test(options = {})
58
- # JRuby and Rubinus don't support SAFE levels.
59
- available = !(defined?(RUBY_ENGINE) && %w(jruby rbx).include?(RUBY_ENGINE))
60
+ # Ruby >= 2.7, JRuby and Rubinus don't support SAFE levels.
61
+ available = RUBY_VERSION < '2.7' && !(defined?(RUBY_ENGINE) && %w(jruby rbx).include?(RUBY_ENGINE))
60
62
 
61
63
  if available || options[:unavailable] != :skip
62
64
  thread = Thread.new do
@@ -96,6 +98,16 @@ module Kernel
96
98
  thread.join
97
99
  end
98
100
  end
101
+
102
+ def skip_if_has_bug_14060
103
+ # On Ruby 2.4.4 in safe mode, require will fail with a SecurityError for
104
+ # any file that has not previously been loaded, regardless of whether the
105
+ # file name is tainted.
106
+ # See https://bugs.ruby-lang.org/issues/14060#note-5.
107
+ if defined?(RUBY_ENGINE) && RUBY_ENGINE == 'ruby' && RUBY_VERSION == '2.4.4'
108
+ skip('Skipping test due to Ruby 2.4.4 being affected by Bug 14060 (see https://bugs.ruby-lang.org/issues/14060#note-5)')
109
+ end
110
+ end
99
111
 
100
112
  def assert_array_same_items(expected, actual, msg = nil)
101
113
  full_message = message(msg, '') { diff(expected, actual) }
@@ -104,6 +116,10 @@ module Kernel
104
116
  end
105
117
 
106
118
  def assert_sub_process_returns(expected_lines, code, extra_load_path = [], required = ['tzinfo'])
119
+ if defined?(RUBY_ENGINE) && RUBY_ENGINE == 'jruby' && JRUBY_VERSION.start_with?('9.0.') && RbConfig::CONFIG['host_os'] =~ /mswin/
120
+ skip('JRuby 9.0 on Windows cannot handle writing to the IO instance returned by popen')
121
+ end
122
+
107
123
  ruby = File.join(RbConfig::CONFIG['bindir'],
108
124
  RbConfig::CONFIG['ruby_install_name'] + RbConfig::CONFIG['EXEEXT'])
109
125
 
@@ -152,6 +168,19 @@ module Kernel
152
168
  end
153
169
 
154
170
 
171
+ # Object#taint is a deprecated no-op in Ruby 2.7 and outputs a warning. It will
172
+ # be removed in 3.2. Silence the warning or supply a replacement.
173
+ if TZInfo::RubyCoreSupport.const_defined?(:UntaintExt)
174
+ module TaintExt
175
+ refine Object do
176
+ def taint
177
+ self
178
+ end
179
+ end
180
+ end
181
+ end
182
+
183
+
155
184
  # JRuby 1.7.5 to 1.7.9 consider DateTime instances that differ by less than
156
185
  # 1 millisecond to be equivalent (https://github.com/jruby/jruby/issues/1311).
157
186
  #
@@ -2,6 +2,8 @@ require File.join(File.expand_path(File.dirname(__FILE__)), 'test_utils.rb')
2
2
 
3
3
  # Use a zoneinfo directory containing files needed by the tests.
4
4
  # The symlinks in this directory are set up in test_utils.rb.
5
- TZInfo::DataSource.set(:zoneinfo, File.join(File.expand_path(File.dirname(__FILE__)), 'zoneinfo').untaint)
5
+ zoneinfo_path = File.join(File.expand_path(File.dirname(__FILE__)), 'zoneinfo')
6
+ zoneinfo_path.untaint if RUBY_VERSION < '2.7'
7
+ TZInfo::DataSource.set(:zoneinfo, zoneinfo_path)
6
8
 
7
9
  require File.join(File.expand_path(File.dirname(__FILE__)), 'ts_all.rb')
@@ -1,11 +1,11 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'tzinfo'
3
- s.version = '1.2.5'
3
+ s.version = '1.2.7'
4
4
  s.summary = 'Daylight savings aware timezone library'
5
5
  s.description = 'TZInfo provides daylight savings aware transformations between times in different time zones.'
6
6
  s.author = 'Philip Ross'
7
7
  s.email = 'phil.ross@gmail.com'
8
- s.homepage = 'http://tzinfo.github.io'
8
+ s.homepage = 'https://tzinfo.github.io'
9
9
  s.license = 'MIT'
10
10
  s.files = %w(CHANGES.md LICENSE Rakefile README.md tzinfo.gemspec .yardopts) +
11
11
  Dir['lib/**/*.rb'].delete_if {|f| f.include?('.svn')} +
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tzinfo
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.5
4
+ version: 1.2.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Philip Ross
@@ -10,27 +10,26 @@ bindir: bin
10
10
  cert_chain:
11
11
  - |
12
12
  -----BEGIN CERTIFICATE-----
13
- MIIDdDCCAlygAwIBAgIBATANBgkqhkiG9w0BAQUFADBAMRIwEAYDVQQDDAlwaGls
14
- LnJvc3MxFTATBgoJkiaJk/IsZAEZFgVnbWFpbDETMBEGCgmSJomT8ixkARkWA2Nv
15
- bTAeFw0xNzEwMjMxOTQ2MDJaFw0xODEwMjMxOTQ2MDJaMEAxEjAQBgNVBAMMCXBo
16
- aWwucm9zczEVMBMGCgmSJomT8ixkARkWBWdtYWlsMRMwEQYKCZImiZPyLGQBGRYD
17
- Y29tMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAkZzB+qfhmyY+XRvU
18
- u310LMTGsTkR4/8JFCMF0YeQX6ZKmLr1fKzF3At1+DlI+v0t/G2FS6Dic0V3l8MK
19
- JczyFh72NANOaQhAo0GHh8WkaeCf2DLL5K6YJeLpvkvp39oxzn00A4zosnzxM50f
20
- Xrjx2HmurcJQurzafeCDj67QccaNE+5H+mcIVAJlsA1h1f5QFZ3SqQ4mf8St40pE
21
- 6YR4ev/Eq6Hb8aUoUq30otxbeHAEHh8cdVhTNFq7sPWb0psQRF2D/+o0MLgHt8PY
22
- EUm49szlLsnjVXAMCHU7wH9CmDR/5Lzcrgqh3DgyI8ay6DnlSQ213eYZH/Nkn1Yz
23
- TcNLCQIDAQABo3kwdzAJBgNVHRMEAjAAMAsGA1UdDwQEAwIEsDAdBgNVHQ4EFgQU
24
- D5nzO9/MG4B6ygch/Pv6PF9Q5x8wHgYDVR0RBBcwFYETcGhpbC5yb3NzQGdtYWls
25
- LmNvbTAeBgNVHRIEFzAVgRNwaGlsLnJvc3NAZ21haWwuY29tMA0GCSqGSIb3DQEB
26
- BQUAA4IBAQAHbabsU8fIQudX8XYwqZJYO76Y4LbHnMqZZz9nmRBWJlFE3E5jaF8Y
27
- p9v1LkOLlo04z9bdnIS0/RfSqvHkNYcdpYXHnmr5/GYItKt8LWpFDA5cLaeWv5cU
28
- FQB6a0HlkirTSTbevJNssymV/E206AFAoPK9vzjROn+/2MG4VlvYf/zr2nSQG76M
29
- BMVs6uF68qxYpWjHisX2oy6R1k4G32jopKfLpdh1WCnN2/U5jqND/b25SRZ2ZRxy
30
- YbX/8MDD3wwHu+knVnVsGNVuu/leNr+hJGgTUGXgcsu6nqYc4QVD+Amj1rI8D6at
31
- IYlrSPqJ7q3pK9kchFKrrktRA6yVf+fR
13
+ MIIDPDCCAiSgAwIBAgIBATANBgkqhkiG9w0BAQsFADAkMSIwIAYDVQQDDBlwaGls
14
+ LnJvc3MvREM9Z21haWwvREM9Y29tMB4XDTE5MTIyNDE0NTU0N1oXDTM5MTIyNDE0
15
+ NTU0N1owJDEiMCAGA1UEAwwZcGhpbC5yb3NzL0RDPWdtYWlsL0RDPWNvbTCCASIw
16
+ DQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAJGcwfqn4ZsmPl0b1Lt9dCzExrE5
17
+ EeP/CRQjBdGHkF+mSpi69XysxdwLdfg5SPr9LfxthUug4nNFd5fDCiXM8hYe9jQD
18
+ TmkIQKNBh4fFpGngn9gyy+SumCXi6b5L6d/aMc59NAOM6LJ88TOdH1648dh5rq3C
19
+ ULq82n3gg4+u0HHGjRPuR/pnCFQCZbANYdX+UBWd0qkOJn/EreNKROmEeHr/xKuh
20
+ 2/GlKFKt9KLcW3hwBB4fHHVYUzRau7D1m9KbEERdg//qNDC4B7fD2BFJuPbM5S7J
21
+ 41VwDAh1O8B/Qpg0f+S83K4Kodw4MiPGsug55UkNtd3mGR/zZJ9WM03DSwkCAwEA
22
+ AaN5MHcwCQYDVR0TBAIwADALBgNVHQ8EBAMCBLAwHQYDVR0OBBYEFA+Z8zvfzBuA
23
+ esoHIfz7+jxfUOcfMB4GA1UdEQQXMBWBE3BoaWwucm9zc0BnbWFpbC5jb20wHgYD
24
+ VR0SBBcwFYETcGhpbC5yb3NzQGdtYWlsLmNvbTANBgkqhkiG9w0BAQsFAAOCAQEA
25
+ J80xgZ3gGdQVA8N+8NJANU5HLuZIU9jOaAlziU9ImoTgPiOHKGZC4as1TwT4kBt1
26
+ Qcnu7YSANYRrxP5tpOHsWPF/MQYgerAFCZS5+PzOTudwZ+7OsMW4/EMHy6aCVHEd
27
+ c7HzQRC4mSrDRpWxzyBnZ5nX5OAmIkKA8NgeKybT/4Ku6iFPPUQwlyxQaO+Wlxdo
28
+ FqHwpjRyoiVSpe4RUTNK3d3qesWPYi7Lxn6k6ZZeEdvG6ya33AXktE3jmmF+jPR1
29
+ J3Zn/kSTjTekiaspyGbczC3PUaeJNxr+yCvR4sk71Xmk/GaKKGOHedJ1uj/LAXrA
30
+ MR0mpl7b8zCg0PFC1J73uw==
32
31
  -----END CERTIFICATE-----
33
- date: 2018-02-04 00:00:00.000000000 Z
32
+ date: 2020-04-02 00:00:00.000000000 Z
34
33
  dependencies:
35
34
  - !ruby/object:Gem::Dependency
36
35
  name: thread_safe
@@ -162,7 +161,7 @@ files:
162
161
  - test/zoneinfo/zone.tab
163
162
  - test/zoneinfo/zone1970.tab
164
163
  - tzinfo.gemspec
165
- homepage: http://tzinfo.github.io
164
+ homepage: https://tzinfo.github.io
166
165
  licenses:
167
166
  - MIT
168
167
  metadata: {}
@@ -185,8 +184,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
185
184
  - !ruby/object:Gem::Version
186
185
  version: '0'
187
186
  requirements: []
188
- rubyforge_project:
189
- rubygems_version: 2.7.4
187
+ rubygems_version: 3.1.2
190
188
  signing_key:
191
189
  specification_version: 4
192
190
  summary: Daylight savings aware timezone library
metadata.gz.sig CHANGED
Binary file