tzinfo 1.2.11 → 2.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (151) hide show
  1. checksums.yaml +4 -4
  2. checksums.yaml.gz.sig +0 -0
  3. data/.yardopts +3 -0
  4. data/CHANGES.md +469 -431
  5. data/LICENSE +13 -13
  6. data/README.md +368 -114
  7. data/lib/tzinfo/country.rb +131 -129
  8. data/lib/tzinfo/country_timezone.rb +70 -112
  9. data/lib/tzinfo/data_source.rb +389 -144
  10. data/lib/tzinfo/data_sources/constant_offset_data_timezone_info.rb +56 -0
  11. data/lib/tzinfo/data_sources/country_info.rb +42 -0
  12. data/lib/tzinfo/data_sources/data_timezone_info.rb +91 -0
  13. data/lib/tzinfo/data_sources/linked_timezone_info.rb +33 -0
  14. data/lib/tzinfo/data_sources/ruby_data_source.rb +141 -0
  15. data/lib/tzinfo/data_sources/timezone_info.rb +47 -0
  16. data/lib/tzinfo/data_sources/transitions_data_timezone_info.rb +214 -0
  17. data/lib/tzinfo/data_sources/zoneinfo_data_source.rb +573 -0
  18. data/lib/tzinfo/data_sources/zoneinfo_reader.rb +284 -0
  19. data/lib/tzinfo/data_sources.rb +8 -0
  20. data/lib/tzinfo/data_timezone.rb +33 -47
  21. data/lib/tzinfo/datetime_with_offset.rb +153 -0
  22. data/lib/tzinfo/format1/country_definer.rb +17 -0
  23. data/lib/tzinfo/format1/country_index_definition.rb +64 -0
  24. data/lib/tzinfo/format1/timezone_definer.rb +64 -0
  25. data/lib/tzinfo/format1/timezone_definition.rb +39 -0
  26. data/lib/tzinfo/format1/timezone_index_definition.rb +77 -0
  27. data/lib/tzinfo/format1.rb +10 -0
  28. data/lib/tzinfo/format2/country_definer.rb +68 -0
  29. data/lib/tzinfo/format2/country_index_definer.rb +68 -0
  30. data/lib/tzinfo/format2/country_index_definition.rb +46 -0
  31. data/lib/tzinfo/format2/timezone_definer.rb +94 -0
  32. data/lib/tzinfo/format2/timezone_definition.rb +73 -0
  33. data/lib/tzinfo/format2/timezone_index_definer.rb +45 -0
  34. data/lib/tzinfo/format2/timezone_index_definition.rb +55 -0
  35. data/lib/tzinfo/format2.rb +10 -0
  36. data/lib/tzinfo/info_timezone.rb +26 -21
  37. data/lib/tzinfo/linked_timezone.rb +33 -52
  38. data/lib/tzinfo/offset_timezone_period.rb +42 -0
  39. data/lib/tzinfo/string_deduper.rb +118 -0
  40. data/lib/tzinfo/time_with_offset.rb +128 -0
  41. data/lib/tzinfo/timestamp.rb +548 -0
  42. data/lib/tzinfo/timestamp_with_offset.rb +85 -0
  43. data/lib/tzinfo/timezone.rb +979 -502
  44. data/lib/tzinfo/timezone_offset.rb +84 -74
  45. data/lib/tzinfo/timezone_period.rb +151 -217
  46. data/lib/tzinfo/timezone_proxy.rb +70 -79
  47. data/lib/tzinfo/timezone_transition.rb +77 -109
  48. data/lib/tzinfo/transitions_timezone_period.rb +63 -0
  49. data/lib/tzinfo/version.rb +7 -0
  50. data/lib/tzinfo/with_offset.rb +61 -0
  51. data/lib/tzinfo.rb +60 -40
  52. data.tar.gz.sig +0 -0
  53. metadata +51 -115
  54. metadata.gz.sig +2 -3
  55. data/Rakefile +0 -107
  56. data/lib/tzinfo/annual_rules.rb +0 -51
  57. data/lib/tzinfo/country_index_definition.rb +0 -31
  58. data/lib/tzinfo/country_info.rb +0 -42
  59. data/lib/tzinfo/data_timezone_info.rb +0 -55
  60. data/lib/tzinfo/linked_timezone_info.rb +0 -26
  61. data/lib/tzinfo/offset_rationals.rb +0 -77
  62. data/lib/tzinfo/posix_time_zone_parser.rb +0 -136
  63. data/lib/tzinfo/ruby_core_support.rb +0 -176
  64. data/lib/tzinfo/ruby_country_info.rb +0 -74
  65. data/lib/tzinfo/ruby_data_source.rb +0 -136
  66. data/lib/tzinfo/time_or_datetime.rb +0 -351
  67. data/lib/tzinfo/timezone_definition.rb +0 -36
  68. data/lib/tzinfo/timezone_index_definition.rb +0 -54
  69. data/lib/tzinfo/timezone_info.rb +0 -30
  70. data/lib/tzinfo/timezone_transition_definition.rb +0 -104
  71. data/lib/tzinfo/transition_data_timezone_info.rb +0 -274
  72. data/lib/tzinfo/transition_rule.rb +0 -325
  73. data/lib/tzinfo/zoneinfo_country_info.rb +0 -37
  74. data/lib/tzinfo/zoneinfo_data_source.rb +0 -504
  75. data/lib/tzinfo/zoneinfo_timezone_info.rb +0 -516
  76. data/test/assets/payload.rb +0 -1
  77. data/test/tc_annual_rules.rb +0 -95
  78. data/test/tc_country.rb +0 -240
  79. data/test/tc_country_index_definition.rb +0 -69
  80. data/test/tc_country_info.rb +0 -16
  81. data/test/tc_country_timezone.rb +0 -173
  82. data/test/tc_data_source.rb +0 -218
  83. data/test/tc_data_timezone.rb +0 -99
  84. data/test/tc_data_timezone_info.rb +0 -18
  85. data/test/tc_info_timezone.rb +0 -34
  86. data/test/tc_linked_timezone.rb +0 -155
  87. data/test/tc_linked_timezone_info.rb +0 -23
  88. data/test/tc_offset_rationals.rb +0 -23
  89. data/test/tc_posix_time_zone_parser.rb +0 -261
  90. data/test/tc_ruby_core_support.rb +0 -168
  91. data/test/tc_ruby_country_info.rb +0 -110
  92. data/test/tc_ruby_data_source.rb +0 -175
  93. data/test/tc_time_or_datetime.rb +0 -674
  94. data/test/tc_timezone.rb +0 -1361
  95. data/test/tc_timezone_definition.rb +0 -113
  96. data/test/tc_timezone_index_definition.rb +0 -73
  97. data/test/tc_timezone_info.rb +0 -11
  98. data/test/tc_timezone_london.rb +0 -143
  99. data/test/tc_timezone_melbourne.rb +0 -142
  100. data/test/tc_timezone_new_york.rb +0 -142
  101. data/test/tc_timezone_offset.rb +0 -126
  102. data/test/tc_timezone_period.rb +0 -555
  103. data/test/tc_timezone_proxy.rb +0 -136
  104. data/test/tc_timezone_transition.rb +0 -366
  105. data/test/tc_timezone_transition_definition.rb +0 -295
  106. data/test/tc_timezone_utc.rb +0 -27
  107. data/test/tc_transition_data_timezone_info.rb +0 -433
  108. data/test/tc_transition_rule.rb +0 -663
  109. data/test/tc_zoneinfo_country_info.rb +0 -78
  110. data/test/tc_zoneinfo_data_source.rb +0 -1226
  111. data/test/tc_zoneinfo_timezone_info.rb +0 -2149
  112. data/test/test_utils.rb +0 -214
  113. data/test/ts_all.rb +0 -7
  114. data/test/ts_all_ruby.rb +0 -5
  115. data/test/ts_all_zoneinfo.rb +0 -9
  116. data/test/tzinfo-data/tzinfo/data/definitions/America/Argentina/Buenos_Aires.rb +0 -89
  117. data/test/tzinfo-data/tzinfo/data/definitions/America/New_York.rb +0 -327
  118. data/test/tzinfo-data/tzinfo/data/definitions/Australia/Melbourne.rb +0 -230
  119. data/test/tzinfo-data/tzinfo/data/definitions/EST.rb +0 -19
  120. data/test/tzinfo-data/tzinfo/data/definitions/Etc/GMT__m__1.rb +0 -21
  121. data/test/tzinfo-data/tzinfo/data/definitions/Etc/GMT__p__1.rb +0 -21
  122. data/test/tzinfo-data/tzinfo/data/definitions/Etc/UTC.rb +0 -21
  123. data/test/tzinfo-data/tzinfo/data/definitions/Europe/Amsterdam.rb +0 -273
  124. data/test/tzinfo-data/tzinfo/data/definitions/Europe/Andorra.rb +0 -198
  125. data/test/tzinfo-data/tzinfo/data/definitions/Europe/London.rb +0 -333
  126. data/test/tzinfo-data/tzinfo/data/definitions/Europe/Paris.rb +0 -277
  127. data/test/tzinfo-data/tzinfo/data/definitions/Europe/Prague.rb +0 -235
  128. data/test/tzinfo-data/tzinfo/data/definitions/UTC.rb +0 -16
  129. data/test/tzinfo-data/tzinfo/data/indexes/countries.rb +0 -940
  130. data/test/tzinfo-data/tzinfo/data/indexes/timezones.rb +0 -609
  131. data/test/tzinfo-data/tzinfo/data/version.rb +0 -20
  132. data/test/tzinfo-data/tzinfo/data.rb +0 -8
  133. data/test/zoneinfo/America/Argentina/Buenos_Aires +0 -0
  134. data/test/zoneinfo/America/New_York +0 -0
  135. data/test/zoneinfo/Australia/Melbourne +0 -0
  136. data/test/zoneinfo/EST +0 -0
  137. data/test/zoneinfo/Etc/UTC +0 -0
  138. data/test/zoneinfo/Europe/Amsterdam +0 -0
  139. data/test/zoneinfo/Europe/Andorra +0 -0
  140. data/test/zoneinfo/Europe/London +0 -0
  141. data/test/zoneinfo/Europe/Paris +0 -0
  142. data/test/zoneinfo/Europe/Prague +0 -0
  143. data/test/zoneinfo/Factory +0 -0
  144. data/test/zoneinfo/iso3166.tab +0 -274
  145. data/test/zoneinfo/leapseconds +0 -78
  146. data/test/zoneinfo/posix/Europe/London +0 -0
  147. data/test/zoneinfo/posixrules +0 -0
  148. data/test/zoneinfo/right/Europe/London +0 -0
  149. data/test/zoneinfo/zone.tab +0 -452
  150. data/test/zoneinfo/zone1970.tab +0 -384
  151. data/tzinfo.gemspec +0 -21
@@ -1,274 +0,0 @@
1
- # ISO 3166 alpha-2 country codes
2
- #
3
- # This file is in the public domain, so clarified as of
4
- # 2009-05-17 by Arthur David Olson.
5
- #
6
- # From Paul Eggert (2015-05-02):
7
- # This file contains a table of two-letter country codes. Columns are
8
- # separated by a single tab. Lines beginning with '#' are comments.
9
- # All text uses UTF-8 encoding. The columns of the table are as follows:
10
- #
11
- # 1. ISO 3166-1 alpha-2 country code, current as of
12
- # ISO 3166-1 N976 (2018-11-06). See: Updates on ISO 3166-1
13
- # https://isotc.iso.org/livelink/livelink/Open/16944257
14
- # 2. The usual English name for the coded region,
15
- # chosen so that alphabetic sorting of subsets produces helpful lists.
16
- # This is not the same as the English name in the ISO 3166 tables.
17
- #
18
- # The table is sorted by country code.
19
- #
20
- # This table is intended as an aid for users, to help them select time
21
- # zone data appropriate for their practical needs. It is not intended
22
- # to take or endorse any position on legal or territorial claims.
23
- #
24
- #country-
25
- #code name of country, territory, area, or subdivision
26
- AD Andorra
27
- AE United Arab Emirates
28
- AF Afghanistan
29
- AG Antigua & Barbuda
30
- AI Anguilla
31
- AL Albania
32
- AM Armenia
33
- AO Angola
34
- AQ Antarctica
35
- AR Argentina
36
- AS Samoa (American)
37
- AT Austria
38
- AU Australia
39
- AW Aruba
40
- AX Åland Islands
41
- AZ Azerbaijan
42
- BA Bosnia & Herzegovina
43
- BB Barbados
44
- BD Bangladesh
45
- BE Belgium
46
- BF Burkina Faso
47
- BG Bulgaria
48
- BH Bahrain
49
- BI Burundi
50
- BJ Benin
51
- BL St Barthelemy
52
- BM Bermuda
53
- BN Brunei
54
- BO Bolivia
55
- BQ Caribbean NL
56
- BR Brazil
57
- BS Bahamas
58
- BT Bhutan
59
- BV Bouvet Island
60
- BW Botswana
61
- BY Belarus
62
- BZ Belize
63
- CA Canada
64
- CC Cocos (Keeling) Islands
65
- CD Congo (Dem. Rep.)
66
- CF Central African Rep.
67
- CG Congo (Rep.)
68
- CH Switzerland
69
- CI Côte d'Ivoire
70
- CK Cook Islands
71
- CL Chile
72
- CM Cameroon
73
- CN China
74
- CO Colombia
75
- CR Costa Rica
76
- CU Cuba
77
- CV Cape Verde
78
- CW Curaçao
79
- CX Christmas Island
80
- CY Cyprus
81
- CZ Czech Republic
82
- DE Germany
83
- DJ Djibouti
84
- DK Denmark
85
- DM Dominica
86
- DO Dominican Republic
87
- DZ Algeria
88
- EC Ecuador
89
- EE Estonia
90
- EG Egypt
91
- EH Western Sahara
92
- ER Eritrea
93
- ES Spain
94
- ET Ethiopia
95
- FI Finland
96
- FJ Fiji
97
- FK Falkland Islands
98
- FM Micronesia
99
- FO Faroe Islands
100
- FR France
101
- GA Gabon
102
- GB Britain (UK)
103
- GD Grenada
104
- GE Georgia
105
- GF French Guiana
106
- GG Guernsey
107
- GH Ghana
108
- GI Gibraltar
109
- GL Greenland
110
- GM Gambia
111
- GN Guinea
112
- GP Guadeloupe
113
- GQ Equatorial Guinea
114
- GR Greece
115
- GS South Georgia & the South Sandwich Islands
116
- GT Guatemala
117
- GU Guam
118
- GW Guinea-Bissau
119
- GY Guyana
120
- HK Hong Kong
121
- HM Heard Island & McDonald Islands
122
- HN Honduras
123
- HR Croatia
124
- HT Haiti
125
- HU Hungary
126
- ID Indonesia
127
- IE Ireland
128
- IL Israel
129
- IM Isle of Man
130
- IN India
131
- IO British Indian Ocean Territory
132
- IQ Iraq
133
- IR Iran
134
- IS Iceland
135
- IT Italy
136
- JE Jersey
137
- JM Jamaica
138
- JO Jordan
139
- JP Japan
140
- KE Kenya
141
- KG Kyrgyzstan
142
- KH Cambodia
143
- KI Kiribati
144
- KM Comoros
145
- KN St Kitts & Nevis
146
- KP Korea (North)
147
- KR Korea (South)
148
- KW Kuwait
149
- KY Cayman Islands
150
- KZ Kazakhstan
151
- LA Laos
152
- LB Lebanon
153
- LC St Lucia
154
- LI Liechtenstein
155
- LK Sri Lanka
156
- LR Liberia
157
- LS Lesotho
158
- LT Lithuania
159
- LU Luxembourg
160
- LV Latvia
161
- LY Libya
162
- MA Morocco
163
- MC Monaco
164
- MD Moldova
165
- ME Montenegro
166
- MF St Martin (French)
167
- MG Madagascar
168
- MH Marshall Islands
169
- MK North Macedonia
170
- ML Mali
171
- MM Myanmar (Burma)
172
- MN Mongolia
173
- MO Macau
174
- MP Northern Mariana Islands
175
- MQ Martinique
176
- MR Mauritania
177
- MS Montserrat
178
- MT Malta
179
- MU Mauritius
180
- MV Maldives
181
- MW Malawi
182
- MX Mexico
183
- MY Malaysia
184
- MZ Mozambique
185
- NA Namibia
186
- NC New Caledonia
187
- NE Niger
188
- NF Norfolk Island
189
- NG Nigeria
190
- NI Nicaragua
191
- NL Netherlands
192
- NO Norway
193
- NP Nepal
194
- NR Nauru
195
- NU Niue
196
- NZ New Zealand
197
- OM Oman
198
- PA Panama
199
- PE Peru
200
- PF French Polynesia
201
- PG Papua New Guinea
202
- PH Philippines
203
- PK Pakistan
204
- PL Poland
205
- PM St Pierre & Miquelon
206
- PN Pitcairn
207
- PR Puerto Rico
208
- PS Palestine
209
- PT Portugal
210
- PW Palau
211
- PY Paraguay
212
- QA Qatar
213
- RE Réunion
214
- RO Romania
215
- RS Serbia
216
- RU Russia
217
- RW Rwanda
218
- SA Saudi Arabia
219
- SB Solomon Islands
220
- SC Seychelles
221
- SD Sudan
222
- SE Sweden
223
- SG Singapore
224
- SH St Helena
225
- SI Slovenia
226
- SJ Svalbard & Jan Mayen
227
- SK Slovakia
228
- SL Sierra Leone
229
- SM San Marino
230
- SN Senegal
231
- SO Somalia
232
- SR Suriname
233
- SS South Sudan
234
- ST Sao Tome & Principe
235
- SV El Salvador
236
- SX St Maarten (Dutch)
237
- SY Syria
238
- SZ Eswatini (Swaziland)
239
- TC Turks & Caicos Is
240
- TD Chad
241
- TF French Southern & Antarctic Lands
242
- TG Togo
243
- TH Thailand
244
- TJ Tajikistan
245
- TK Tokelau
246
- TL East Timor
247
- TM Turkmenistan
248
- TN Tunisia
249
- TO Tonga
250
- TR Turkey
251
- TT Trinidad & Tobago
252
- TV Tuvalu
253
- TW Taiwan
254
- TZ Tanzania
255
- UA Ukraine
256
- UG Uganda
257
- UM US minor outlying islands
258
- US United States
259
- UY Uruguay
260
- UZ Uzbekistan
261
- VA Vatican City
262
- VC St Vincent
263
- VE Venezuela
264
- VG Virgin Islands (UK)
265
- VI Virgin Islands (US)
266
- VN Vietnam
267
- VU Vanuatu
268
- WF Wallis & Futuna
269
- WS Samoa (western)
270
- YE Yemen
271
- YT Mayotte
272
- ZA South Africa
273
- ZM Zambia
274
- ZW Zimbabwe
@@ -1,78 +0,0 @@
1
- # Allowance for leap seconds added to each time zone file.
2
-
3
- # This file is in the public domain.
4
-
5
- # This file is generated automatically from the data in the public-domain
6
- # NIST format leap-seconds.list file, which can be copied from
7
- # <ftp://ftp.nist.gov/pub/time/leap-seconds.list>
8
- # or <ftp://ftp.boulder.nist.gov/pub/time/leap-seconds.list>.
9
- # For more about leap-seconds.list, please see
10
- # The NTP Timescale and Leap Seconds
11
- # <https://www.eecis.udel.edu/~mills/leap.html>.
12
-
13
- # The rules for leap seconds are specified in Annex 1 (Time scales) of:
14
- # Standard-frequency and time-signal emissions.
15
- # International Telecommunication Union - Radiocommunication Sector
16
- # (ITU-R) Recommendation TF.460-6 (02/2002)
17
- # <https://www.itu.int/rec/R-REC-TF.460-6-200202-I/>.
18
- # The International Earth Rotation and Reference Systems Service (IERS)
19
- # periodically uses leap seconds to keep UTC to within 0.9 s of UT1
20
- # (a proxy for Earth's angle in space as measured by astronomers)
21
- # and publishes leap second data in a copyrighted file
22
- # <https://hpiers.obspm.fr/iers/bul/bulc/Leap_Second.dat>.
23
- # See: Levine J. Coordinated Universal Time and the leap second.
24
- # URSI Radio Sci Bull. 2016;89(4):30-6. doi:10.23919/URSIRSB.2016.7909995
25
- # <https://ieeexplore.ieee.org/document/7909995>.
26
-
27
- # There were no leap seconds before 1972, as no official mechanism
28
- # accounted for the discrepancy between atomic time (TAI) and the earth's
29
- # rotation. The first ("1 Jan 1972") data line in leap-seconds.list
30
- # does not denote a leap second; it denotes the start of the current definition
31
- # of UTC.
32
-
33
- # All leap-seconds are Stationary (S) at the given UTC time.
34
- # The correction (+ or -) is made at the given time, so in the unlikely
35
- # event of a negative leap second, a line would look like this:
36
- # Leap YEAR MON DAY 23:59:59 - S
37
- # Typical lines look like this:
38
- # Leap YEAR MON DAY 23:59:60 + S
39
- Leap 1972 Jun 30 23:59:60 + S
40
- Leap 1972 Dec 31 23:59:60 + S
41
- Leap 1973 Dec 31 23:59:60 + S
42
- Leap 1974 Dec 31 23:59:60 + S
43
- Leap 1975 Dec 31 23:59:60 + S
44
- Leap 1976 Dec 31 23:59:60 + S
45
- Leap 1977 Dec 31 23:59:60 + S
46
- Leap 1978 Dec 31 23:59:60 + S
47
- Leap 1979 Dec 31 23:59:60 + S
48
- Leap 1981 Jun 30 23:59:60 + S
49
- Leap 1982 Jun 30 23:59:60 + S
50
- Leap 1983 Jun 30 23:59:60 + S
51
- Leap 1985 Jun 30 23:59:60 + S
52
- Leap 1987 Dec 31 23:59:60 + S
53
- Leap 1989 Dec 31 23:59:60 + S
54
- Leap 1990 Dec 31 23:59:60 + S
55
- Leap 1992 Jun 30 23:59:60 + S
56
- Leap 1993 Jun 30 23:59:60 + S
57
- Leap 1994 Jun 30 23:59:60 + S
58
- Leap 1995 Dec 31 23:59:60 + S
59
- Leap 1997 Jun 30 23:59:60 + S
60
- Leap 1998 Dec 31 23:59:60 + S
61
- Leap 2005 Dec 31 23:59:60 + S
62
- Leap 2008 Dec 31 23:59:60 + S
63
- Leap 2012 Jun 30 23:59:60 + S
64
- Leap 2015 Jun 30 23:59:60 + S
65
- Leap 2016 Dec 31 23:59:60 + S
66
-
67
- # UTC timestamp when this leap second list expires.
68
- # Any additional leap seconds will come after this.
69
- # This Expires line is commented out for now,
70
- # so that pre-2020a zic implementations do not reject this file.
71
- #Expires 2021 Jun 28 00:00:00
72
-
73
- # POSIX timestamps for the data in this file:
74
- #updated 1467936000 (2016-07-08 00:00:00 UTC)
75
- #expires 1624838400 (2021-06-28 00:00:00 UTC)
76
-
77
- # Updated through IERS Bulletin C60
78
- # File expires on: 28 June 2021
Binary file
Binary file
Binary file