tzinfo 0.3.62 → 1.0.0
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 +7 -0
- data/CHANGES +25 -158
- data/LICENSE +1 -1
- data/README +89 -55
- data/Rakefile +87 -282
- data/lib/tzinfo/country.rb +28 -34
- data/lib/tzinfo/country_index_definition.rb +2 -7
- data/lib/tzinfo/country_info.rb +20 -44
- data/lib/tzinfo/country_timezone.rb +1 -1
- data/lib/tzinfo/data_source.rb +182 -0
- data/lib/tzinfo/data_timezone.rb +1 -3
- data/lib/tzinfo/data_timezone_info.rb +11 -190
- data/lib/tzinfo/info_timezone.rb +1 -3
- data/lib/tzinfo/linked_timezone.rb +1 -4
- data/lib/tzinfo/linked_timezone_info.rb +9 -5
- data/lib/tzinfo/offset_rationals.rb +2 -4
- data/lib/tzinfo/ruby_core_support.rb +152 -82
- data/lib/tzinfo/ruby_country_info.rb +78 -0
- data/lib/tzinfo/ruby_data_source.rb +153 -0
- data/lib/tzinfo/time_or_datetime.rb +83 -52
- data/lib/tzinfo/timezone.rb +27 -69
- data/lib/tzinfo/timezone_definition.rb +4 -7
- data/lib/tzinfo/timezone_index_definition.rb +1 -6
- data/lib/tzinfo/timezone_info.rb +8 -4
- data/lib/tzinfo/timezone_offset_info.rb +1 -3
- data/lib/tzinfo/timezone_period.rb +31 -6
- data/lib/tzinfo/timezone_transition_info.rb +42 -12
- data/lib/tzinfo/transition_data_timezone_info.rb +223 -0
- data/lib/tzinfo/zoneinfo_country_info.rb +50 -0
- data/lib/tzinfo/zoneinfo_data_source.rb +297 -0
- data/lib/tzinfo/zoneinfo_timezone_info.rb +226 -0
- data/lib/tzinfo.rb +9 -7
- data/test/tc_country.rb +65 -9
- data/test/tc_country_index_definition.rb +27 -6
- data/test/tc_country_info.rb +23 -57
- data/test/tc_country_timezone.rb +23 -3
- data/test/tc_data_source.rb +194 -0
- data/test/tc_data_timezone.rb +23 -3
- data/test/tc_data_timezone_info.rb +30 -272
- data/test/tc_info_timezone.rb +23 -3
- data/test/tc_linked_timezone.rb +23 -4
- data/test/tc_linked_timezone_info.rb +30 -3
- data/test/tc_offset_rationals.rb +23 -3
- data/test/tc_ruby_core_support.rb +117 -31
- data/test/tc_ruby_country_info.rb +102 -0
- data/test/tc_ruby_data_source.rb +145 -0
- data/test/tc_time_or_datetime.rb +222 -19
- data/test/tc_timezone.rb +187 -57
- data/test/tc_timezone_definition.rb +26 -6
- data/test/tc_timezone_index_definition.rb +23 -3
- data/test/tc_timezone_info.rb +23 -3
- data/test/tc_timezone_london.rb +89 -56
- data/test/tc_timezone_melbourne.rb +88 -62
- data/test/tc_timezone_new_york.rb +73 -47
- data/test/tc_timezone_offset_info.rb +36 -4
- data/test/tc_timezone_period.rb +60 -22
- data/test/tc_timezone_proxy.rb +24 -4
- data/test/tc_timezone_transition_info.rb +305 -28
- data/test/tc_timezone_utc.rb +24 -4
- data/test/tc_transition_data_timezone_info.rb +345 -0
- data/test/tc_zoneinfo_country_info.rb +86 -0
- data/test/tc_zoneinfo_data_source.rb +601 -0
- data/test/tc_zoneinfo_timezone_info.rb +663 -0
- data/test/test_utils.rb +116 -21
- data/test/ts_all.rb +24 -4
- data/test/ts_all_ruby.rb +27 -0
- data/test/ts_all_zoneinfo.rb +29 -0
- data/test/tzinfo-data/tzinfo/data/definitions/America/Argentina/Buenos_Aires.rb +89 -0
- data/test/tzinfo-data/tzinfo/data/definitions/America/New_York.rb +313 -0
- data/test/tzinfo-data/tzinfo/data/definitions/Australia/Melbourne.rb +216 -0
- data/test/tzinfo-data/tzinfo/data/definitions/EST.rb +19 -0
- data/test/tzinfo-data/tzinfo/data/definitions/Etc/GMT__m__1.rb +21 -0
- data/test/tzinfo-data/tzinfo/data/definitions/Etc/GMT__p__1.rb +21 -0
- data/test/tzinfo-data/tzinfo/data/definitions/Etc/UTC.rb +21 -0
- data/test/tzinfo-data/tzinfo/data/definitions/Europe/Amsterdam.rb +259 -0
- data/test/tzinfo-data/tzinfo/data/definitions/Europe/Andorra.rb +184 -0
- data/test/tzinfo-data/tzinfo/data/definitions/Europe/London.rb +319 -0
- data/test/tzinfo-data/tzinfo/data/definitions/Europe/Paris.rb +263 -0
- data/test/tzinfo-data/tzinfo/data/definitions/Europe/Prague.rb +218 -0
- data/test/tzinfo-data/tzinfo/data/definitions/UTC.rb +16 -0
- data/test/tzinfo-data/tzinfo/data/indexes/countries.rb +929 -0
- data/test/tzinfo-data/tzinfo/data/indexes/timezones.rb +599 -0
- data/test/tzinfo-data/tzinfo/data/version.rb +36 -0
- data/test/tzinfo-data/tzinfo/data.rb +23 -0
- data/test/zoneinfo/America/Argentina/Buenos_Aires +0 -0
- data/test/zoneinfo/America/New_York +0 -0
- data/test/zoneinfo/Australia/Melbourne +0 -0
- data/test/zoneinfo/EST +0 -0
- data/test/zoneinfo/Etc/UTC +0 -0
- data/test/zoneinfo/Europe/Amsterdam +0 -0
- data/test/zoneinfo/Europe/Andorra +0 -0
- data/test/zoneinfo/Europe/London +0 -0
- data/test/zoneinfo/Europe/Paris +0 -0
- data/test/zoneinfo/Europe/Prague +0 -0
- data/test/zoneinfo/Factory +0 -0
- data/test/zoneinfo/UTC +0 -0
- data/test/zoneinfo/iso3166.tab +276 -0
- data/test/zoneinfo/localtime +0 -0
- data/test/zoneinfo/posix/Europe/London +0 -0
- data/test/zoneinfo/posixrules +0 -0
- data/test/zoneinfo/right/Europe/London +0 -0
- data/test/zoneinfo/zone.tab +444 -0
- metadata +134 -716
- data/.yardopts +0 -8
- data/lib/tzinfo/definitions/Africa/Abidjan.rb +0 -18
- data/lib/tzinfo/definitions/Africa/Accra.rb +0 -13
- data/lib/tzinfo/definitions/Africa/Addis_Ababa.rb +0 -13
- data/lib/tzinfo/definitions/Africa/Algiers.rb +0 -55
- data/lib/tzinfo/definitions/Africa/Asmara.rb +0 -13
- data/lib/tzinfo/definitions/Africa/Asmera.rb +0 -13
- data/lib/tzinfo/definitions/Africa/Bamako.rb +0 -13
- data/lib/tzinfo/definitions/Africa/Bangui.rb +0 -13
- data/lib/tzinfo/definitions/Africa/Banjul.rb +0 -13
- data/lib/tzinfo/definitions/Africa/Bissau.rb +0 -20
- data/lib/tzinfo/definitions/Africa/Blantyre.rb +0 -13
- data/lib/tzinfo/definitions/Africa/Brazzaville.rb +0 -13
- data/lib/tzinfo/definitions/Africa/Bujumbura.rb +0 -13
- data/lib/tzinfo/definitions/Africa/Cairo.rb +0 -247
- data/lib/tzinfo/definitions/Africa/Casablanca.rb +0 -189
- data/lib/tzinfo/definitions/Africa/Ceuta.rb +0 -218
- data/lib/tzinfo/definitions/Africa/Conakry.rb +0 -13
- data/lib/tzinfo/definitions/Africa/Dakar.rb +0 -13
- data/lib/tzinfo/definitions/Africa/Dar_es_Salaam.rb +0 -13
- data/lib/tzinfo/definitions/Africa/Djibouti.rb +0 -13
- data/lib/tzinfo/definitions/Africa/Douala.rb +0 -13
- data/lib/tzinfo/definitions/Africa/El_Aaiun.rb +0 -179
- data/lib/tzinfo/definitions/Africa/Freetown.rb +0 -13
- data/lib/tzinfo/definitions/Africa/Gaborone.rb +0 -13
- data/lib/tzinfo/definitions/Africa/Harare.rb +0 -13
- data/lib/tzinfo/definitions/Africa/Johannesburg.rb +0 -25
- data/lib/tzinfo/definitions/Africa/Juba.rb +0 -54
- data/lib/tzinfo/definitions/Africa/Kampala.rb +0 -13
- data/lib/tzinfo/definitions/Africa/Khartoum.rb +0 -54
- data/lib/tzinfo/definitions/Africa/Kigali.rb +0 -13
- data/lib/tzinfo/definitions/Africa/Kinshasa.rb +0 -13
- data/lib/tzinfo/definitions/Africa/Lagos.rb +0 -23
- data/lib/tzinfo/definitions/Africa/Libreville.rb +0 -13
- data/lib/tzinfo/definitions/Africa/Lome.rb +0 -13
- data/lib/tzinfo/definitions/Africa/Luanda.rb +0 -13
- data/lib/tzinfo/definitions/Africa/Lubumbashi.rb +0 -13
- data/lib/tzinfo/definitions/Africa/Lusaka.rb +0 -13
- data/lib/tzinfo/definitions/Africa/Malabo.rb +0 -13
- data/lib/tzinfo/definitions/Africa/Maputo.rb +0 -18
- data/lib/tzinfo/definitions/Africa/Maseru.rb +0 -13
- data/lib/tzinfo/definitions/Africa/Mbabane.rb +0 -13
- data/lib/tzinfo/definitions/Africa/Mogadishu.rb +0 -13
- data/lib/tzinfo/definitions/Africa/Monrovia.rb +0 -22
- data/lib/tzinfo/definitions/Africa/Nairobi.rb +0 -24
- data/lib/tzinfo/definitions/Africa/Ndjamena.rb +0 -21
- data/lib/tzinfo/definitions/Africa/Niamey.rb +0 -13
- data/lib/tzinfo/definitions/Africa/Nouakchott.rb +0 -13
- data/lib/tzinfo/definitions/Africa/Ouagadougou.rb +0 -13
- data/lib/tzinfo/definitions/Africa/Porto__m__Novo.rb +0 -13
- data/lib/tzinfo/definitions/Africa/Sao_Tome.rb +0 -23
- data/lib/tzinfo/definitions/Africa/Timbuktu.rb +0 -13
- data/lib/tzinfo/definitions/Africa/Tripoli.rb +0 -51
- data/lib/tzinfo/definitions/Africa/Tunis.rb +0 -53
- data/lib/tzinfo/definitions/Africa/Windhoek.rb +0 -74
- data/lib/tzinfo/definitions/America/Adak.rb +0 -242
- data/lib/tzinfo/definitions/America/Anchorage.rb +0 -242
- data/lib/tzinfo/definitions/America/Anguilla.rb +0 -13
- data/lib/tzinfo/definitions/America/Antigua.rb +0 -13
- data/lib/tzinfo/definitions/America/Araguaina.rb +0 -69
- data/lib/tzinfo/definitions/America/Argentina/Buenos_Aires.rb +0 -84
- data/lib/tzinfo/definitions/America/Argentina/Catamarca.rb +0 -84
- data/lib/tzinfo/definitions/America/Argentina/ComodRivadavia.rb +0 -15
- data/lib/tzinfo/definitions/America/Argentina/Cordoba.rb +0 -84
- data/lib/tzinfo/definitions/America/Argentina/Jujuy.rb +0 -82
- data/lib/tzinfo/definitions/America/Argentina/La_Rioja.rb +0 -85
- data/lib/tzinfo/definitions/America/Argentina/Mendoza.rb +0 -84
- data/lib/tzinfo/definitions/America/Argentina/Rio_Gallegos.rb +0 -84
- data/lib/tzinfo/definitions/America/Argentina/Salta.rb +0 -82
- data/lib/tzinfo/definitions/America/Argentina/San_Juan.rb +0 -85
- data/lib/tzinfo/definitions/America/Argentina/San_Luis.rb +0 -85
- data/lib/tzinfo/definitions/America/Argentina/Tucuman.rb +0 -86
- data/lib/tzinfo/definitions/America/Argentina/Ushuaia.rb +0 -84
- data/lib/tzinfo/definitions/America/Aruba.rb +0 -13
- data/lib/tzinfo/definitions/America/Asuncion.rb +0 -220
- data/lib/tzinfo/definitions/America/Atikokan.rb +0 -13
- data/lib/tzinfo/definitions/America/Atka.rb +0 -13
- data/lib/tzinfo/definitions/America/Bahia.rb +0 -79
- data/lib/tzinfo/definitions/America/Bahia_Banderas.rb +0 -84
- data/lib/tzinfo/definitions/America/Barbados.rb +0 -34
- data/lib/tzinfo/definitions/America/Belem.rb +0 -47
- data/lib/tzinfo/definitions/America/Belize.rb +0 -119
- data/lib/tzinfo/definitions/America/Blanc__m__Sablon.rb +0 -13
- data/lib/tzinfo/definitions/America/Boa_Vista.rb +0 -51
- data/lib/tzinfo/definitions/America/Bogota.rb +0 -23
- data/lib/tzinfo/definitions/America/Boise.rb +0 -245
- data/lib/tzinfo/definitions/America/Buenos_Aires.rb +0 -13
- data/lib/tzinfo/definitions/America/Cambridge_Bay.rb +0 -232
- data/lib/tzinfo/definitions/America/Campo_Grande.rb +0 -109
- data/lib/tzinfo/definitions/America/Cancun.rb +0 -62
- data/lib/tzinfo/definitions/America/Caracas.rb +0 -24
- data/lib/tzinfo/definitions/America/Catamarca.rb +0 -13
- data/lib/tzinfo/definitions/America/Cayenne.rb +0 -20
- data/lib/tzinfo/definitions/America/Cayman.rb +0 -13
- data/lib/tzinfo/definitions/America/Chicago.rb +0 -329
- data/lib/tzinfo/definitions/America/Chihuahua.rb +0 -80
- data/lib/tzinfo/definitions/America/Ciudad_Juarez.rb +0 -183
- data/lib/tzinfo/definitions/America/Coral_Harbour.rb +0 -13
- data/lib/tzinfo/definitions/America/Cordoba.rb +0 -13
- data/lib/tzinfo/definitions/America/Costa_Rica.rb +0 -29
- data/lib/tzinfo/definitions/America/Creston.rb +0 -13
- data/lib/tzinfo/definitions/America/Cuiaba.rb +0 -107
- data/lib/tzinfo/definitions/America/Curacao.rb +0 -13
- data/lib/tzinfo/definitions/America/Danmarkshavn.rb +0 -53
- data/lib/tzinfo/definitions/America/Dawson.rb +0 -117
- data/lib/tzinfo/definitions/America/Dawson_Creek.rb +0 -79
- data/lib/tzinfo/definitions/America/Denver.rb +0 -250
- data/lib/tzinfo/definitions/America/Detroit.rb +0 -234
- data/lib/tzinfo/definitions/America/Dominica.rb +0 -13
- data/lib/tzinfo/definitions/America/Edmonton.rb +0 -242
- data/lib/tzinfo/definitions/America/Eirunepe.rb +0 -52
- data/lib/tzinfo/definitions/America/El_Salvador.rb +0 -23
- data/lib/tzinfo/definitions/America/Ensenada.rb +0 -13
- data/lib/tzinfo/definitions/America/Fort_Nelson.rb +0 -164
- data/lib/tzinfo/definitions/America/Fort_Wayne.rb +0 -13
- data/lib/tzinfo/definitions/America/Fortaleza.rb +0 -57
- data/lib/tzinfo/definitions/America/Glace_Bay.rb +0 -232
- data/lib/tzinfo/definitions/America/Godthab.rb +0 -13
- data/lib/tzinfo/definitions/America/Goose_Bay.rb +0 -301
- data/lib/tzinfo/definitions/America/Grand_Turk.rb +0 -207
- data/lib/tzinfo/definitions/America/Grenada.rb +0 -13
- data/lib/tzinfo/definitions/America/Guadeloupe.rb +0 -13
- data/lib/tzinfo/definitions/America/Guatemala.rb +0 -27
- data/lib/tzinfo/definitions/America/Guayaquil.rb +0 -23
- data/lib/tzinfo/definitions/America/Guyana.rb +0 -23
- data/lib/tzinfo/definitions/America/Halifax.rb +0 -320
- data/lib/tzinfo/definitions/America/Havana.rb +0 -247
- data/lib/tzinfo/definitions/America/Hermosillo.rb +0 -35
- data/lib/tzinfo/definitions/America/Indiana/Indianapolis.rb +0 -195
- data/lib/tzinfo/definitions/America/Indiana/Knox.rb +0 -249
- data/lib/tzinfo/definitions/America/Indiana/Marengo.rb +0 -199
- data/lib/tzinfo/definitions/America/Indiana/Petersburg.rb +0 -212
- data/lib/tzinfo/definitions/America/Indiana/Tell_City.rb +0 -194
- data/lib/tzinfo/definitions/America/Indiana/Vevay.rb +0 -177
- data/lib/tzinfo/definitions/America/Indiana/Vincennes.rb +0 -197
- data/lib/tzinfo/definitions/America/Indiana/Winamac.rb +0 -203
- data/lib/tzinfo/definitions/America/Indianapolis.rb +0 -13
- data/lib/tzinfo/definitions/America/Inuvik.rb +0 -225
- data/lib/tzinfo/definitions/America/Iqaluit.rb +0 -229
- data/lib/tzinfo/definitions/America/Jamaica.rb +0 -41
- data/lib/tzinfo/definitions/America/Jujuy.rb +0 -13
- data/lib/tzinfo/definitions/America/Juneau.rb +0 -241
- data/lib/tzinfo/definitions/America/Kentucky/Louisville.rb +0 -274
- data/lib/tzinfo/definitions/America/Kentucky/Monticello.rb +0 -244
- data/lib/tzinfo/definitions/America/Knox_IN.rb +0 -13
- data/lib/tzinfo/definitions/America/Kralendijk.rb +0 -13
- data/lib/tzinfo/definitions/America/La_Paz.rb +0 -22
- data/lib/tzinfo/definitions/America/Lima.rb +0 -35
- data/lib/tzinfo/definitions/America/Los_Angeles.rb +0 -278
- data/lib/tzinfo/definitions/America/Louisville.rb +0 -13
- data/lib/tzinfo/definitions/America/Lower_Princes.rb +0 -13
- data/lib/tzinfo/definitions/America/Maceio.rb +0 -59
- data/lib/tzinfo/definitions/America/Managua.rb +0 -36
- data/lib/tzinfo/definitions/America/Manaus.rb +0 -49
- data/lib/tzinfo/definitions/America/Marigot.rb +0 -13
- data/lib/tzinfo/definitions/America/Martinique.rb +0 -23
- data/lib/tzinfo/definitions/America/Matamoros.rb +0 -177
- data/lib/tzinfo/definitions/America/Mazatlan.rb +0 -83
- data/lib/tzinfo/definitions/America/Mendoza.rb +0 -13
- data/lib/tzinfo/definitions/America/Menominee.rb +0 -236
- data/lib/tzinfo/definitions/America/Merida.rb +0 -76
- data/lib/tzinfo/definitions/America/Metlakatla.rb +0 -176
- data/lib/tzinfo/definitions/America/Mexico_City.rb +0 -89
- data/lib/tzinfo/definitions/America/Miquelon.rb +0 -195
- data/lib/tzinfo/definitions/America/Moncton.rb +0 -300
- data/lib/tzinfo/definitions/America/Monterrey.rb +0 -75
- data/lib/tzinfo/definitions/America/Montevideo.rb +0 -110
- data/lib/tzinfo/definitions/America/Montreal.rb +0 -13
- data/lib/tzinfo/definitions/America/Montserrat.rb +0 -13
- data/lib/tzinfo/definitions/America/Nassau.rb +0 -13
- data/lib/tzinfo/definitions/America/New_York.rb +0 -328
- data/lib/tzinfo/definitions/America/Nipigon.rb +0 -13
- data/lib/tzinfo/definitions/America/Nome.rb +0 -242
- data/lib/tzinfo/definitions/America/Noronha.rb +0 -57
- data/lib/tzinfo/definitions/America/North_Dakota/Beulah.rb +0 -246
- data/lib/tzinfo/definitions/America/North_Dakota/Center.rb +0 -246
- data/lib/tzinfo/definitions/America/North_Dakota/New_Salem.rb +0 -246
- data/lib/tzinfo/definitions/America/Nuuk.rb +0 -209
- data/lib/tzinfo/definitions/America/Ojinaga.rb +0 -182
- data/lib/tzinfo/definitions/America/Panama.rb +0 -20
- data/lib/tzinfo/definitions/America/Pangnirtung.rb +0 -13
- data/lib/tzinfo/definitions/America/Paramaribo.rb +0 -24
- data/lib/tzinfo/definitions/America/Phoenix.rb +0 -30
- data/lib/tzinfo/definitions/America/Port__m__au__m__Prince.rb +0 -177
- data/lib/tzinfo/definitions/America/Port_of_Spain.rb +0 -13
- data/lib/tzinfo/definitions/America/Porto_Acre.rb +0 -13
- data/lib/tzinfo/definitions/America/Porto_Velho.rb +0 -47
- data/lib/tzinfo/definitions/America/Puerto_Rico.rb +0 -23
- data/lib/tzinfo/definitions/America/Punta_Arenas.rb +0 -139
- data/lib/tzinfo/definitions/America/Rainy_River.rb +0 -13
- data/lib/tzinfo/definitions/America/Rankin_Inlet.rb +0 -224
- data/lib/tzinfo/definitions/America/Recife.rb +0 -57
- data/lib/tzinfo/definitions/America/Regina.rb +0 -74
- data/lib/tzinfo/definitions/America/Resolute.rb +0 -224
- data/lib/tzinfo/definitions/America/Rio_Branco.rb +0 -50
- data/lib/tzinfo/definitions/America/Rosario.rb +0 -13
- data/lib/tzinfo/definitions/America/Santa_Isabel.rb +0 -13
- data/lib/tzinfo/definitions/America/Santarem.rb +0 -49
- data/lib/tzinfo/definitions/America/Santiago.rb +0 -251
- data/lib/tzinfo/definitions/America/Santo_Domingo.rb +0 -38
- data/lib/tzinfo/definitions/America/Sao_Paulo.rb +0 -109
- data/lib/tzinfo/definitions/America/Scoresbysund.rb +0 -209
- data/lib/tzinfo/definitions/America/Shiprock.rb +0 -13
- data/lib/tzinfo/definitions/America/Sitka.rb +0 -240
- data/lib/tzinfo/definitions/America/St_Barthelemy.rb +0 -13
- data/lib/tzinfo/definitions/America/St_Johns.rb +0 -334
- data/lib/tzinfo/definitions/America/St_Kitts.rb +0 -13
- data/lib/tzinfo/definitions/America/St_Lucia.rb +0 -13
- data/lib/tzinfo/definitions/America/St_Thomas.rb +0 -13
- data/lib/tzinfo/definitions/America/St_Vincent.rb +0 -13
- data/lib/tzinfo/definitions/America/Swift_Current.rb +0 -44
- data/lib/tzinfo/definitions/America/Tegucigalpa.rb +0 -25
- data/lib/tzinfo/definitions/America/Thule.rb +0 -185
- data/lib/tzinfo/definitions/America/Thunder_Bay.rb +0 -13
- data/lib/tzinfo/definitions/America/Tijuana.rb +0 -242
- data/lib/tzinfo/definitions/America/Toronto.rb +0 -325
- data/lib/tzinfo/definitions/America/Tortola.rb +0 -13
- data/lib/tzinfo/definitions/America/Vancouver.rb +0 -282
- data/lib/tzinfo/definitions/America/Virgin.rb +0 -13
- data/lib/tzinfo/definitions/America/Whitehorse.rb +0 -117
- data/lib/tzinfo/definitions/America/Winnipeg.rb +0 -278
- data/lib/tzinfo/definitions/America/Yakutat.rb +0 -239
- data/lib/tzinfo/definitions/America/Yellowknife.rb +0 -13
- data/lib/tzinfo/definitions/Antarctica/Casey.rb +0 -30
- data/lib/tzinfo/definitions/Antarctica/Davis.rb +0 -25
- data/lib/tzinfo/definitions/Antarctica/DumontDUrville.rb +0 -13
- data/lib/tzinfo/definitions/Antarctica/Macquarie.rb +0 -233
- data/lib/tzinfo/definitions/Antarctica/Mawson.rb +0 -20
- data/lib/tzinfo/definitions/Antarctica/McMurdo.rb +0 -13
- data/lib/tzinfo/definitions/Antarctica/Palmer.rb +0 -102
- data/lib/tzinfo/definitions/Antarctica/Rothera.rb +0 -18
- data/lib/tzinfo/definitions/Antarctica/South_Pole.rb +0 -13
- data/lib/tzinfo/definitions/Antarctica/Syowa.rb +0 -13
- data/lib/tzinfo/definitions/Antarctica/Troll.rb +0 -157
- data/lib/tzinfo/definitions/Antarctica/Vostok.rb +0 -13
- data/lib/tzinfo/definitions/Arctic/Longyearbyen.rb +0 -13
- data/lib/tzinfo/definitions/Asia/Aden.rb +0 -13
- data/lib/tzinfo/definitions/Asia/Almaty.rb +0 -71
- data/lib/tzinfo/definitions/Asia/Amman.rb +0 -106
- data/lib/tzinfo/definitions/Asia/Anadyr.rb +0 -86
- data/lib/tzinfo/definitions/Asia/Aqtau.rb +0 -71
- data/lib/tzinfo/definitions/Asia/Aqtobe.rb +0 -72
- data/lib/tzinfo/definitions/Asia/Ashgabat.rb +0 -45
- data/lib/tzinfo/definitions/Asia/Ashkhabad.rb +0 -13
- data/lib/tzinfo/definitions/Asia/Atyrau.rb +0 -72
- data/lib/tzinfo/definitions/Asia/Baghdad.rb +0 -73
- data/lib/tzinfo/definitions/Asia/Bahrain.rb +0 -13
- data/lib/tzinfo/definitions/Asia/Baku.rb +0 -86
- data/lib/tzinfo/definitions/Asia/Bangkok.rb +0 -20
- data/lib/tzinfo/definitions/Asia/Barnaul.rb +0 -87
- data/lib/tzinfo/definitions/Asia/Beirut.rb +0 -231
- data/lib/tzinfo/definitions/Asia/Bishkek.rb +0 -72
- data/lib/tzinfo/definitions/Asia/Brunei.rb +0 -13
- data/lib/tzinfo/definitions/Asia/Calcutta.rb +0 -13
- data/lib/tzinfo/definitions/Asia/Chita.rb +0 -87
- data/lib/tzinfo/definitions/Asia/Choibalsan.rb +0 -72
- data/lib/tzinfo/definitions/Asia/Chongqing.rb +0 -13
- data/lib/tzinfo/definitions/Asia/Chungking.rb +0 -13
- data/lib/tzinfo/definitions/Asia/Colombo.rb +0 -30
- data/lib/tzinfo/definitions/Asia/Dacca.rb +0 -13
- data/lib/tzinfo/definitions/Asia/Damascus.rb +0 -140
- data/lib/tzinfo/definitions/Asia/Dhaka.rb +0 -28
- data/lib/tzinfo/definitions/Asia/Dili.rb +0 -22
- data/lib/tzinfo/definitions/Asia/Dubai.rb +0 -18
- data/lib/tzinfo/definitions/Asia/Dushanbe.rb +0 -44
- data/lib/tzinfo/definitions/Asia/Famagusta.rb +0 -217
- data/lib/tzinfo/definitions/Asia/Gaza.rb +0 -274
- data/lib/tzinfo/definitions/Asia/Harbin.rb +0 -13
- data/lib/tzinfo/definitions/Asia/Hebron.rb +0 -276
- data/lib/tzinfo/definitions/Asia/Ho_Chi_Minh.rb +0 -29
- data/lib/tzinfo/definitions/Asia/Hong_Kong.rb +0 -89
- data/lib/tzinfo/definitions/Asia/Hovd.rb +0 -69
- data/lib/tzinfo/definitions/Asia/Irkutsk.rb +0 -88
- data/lib/tzinfo/definitions/Asia/Istanbul.rb +0 -13
- data/lib/tzinfo/definitions/Asia/Jakarta.rb +0 -30
- data/lib/tzinfo/definitions/Asia/Jayapura.rb +0 -22
- data/lib/tzinfo/definitions/Asia/Jerusalem.rb +0 -241
- data/lib/tzinfo/definitions/Asia/Kabul.rb +0 -20
- data/lib/tzinfo/definitions/Asia/Kamchatka.rb +0 -84
- data/lib/tzinfo/definitions/Asia/Karachi.rb +0 -32
- data/lib/tzinfo/definitions/Asia/Kashgar.rb +0 -13
- data/lib/tzinfo/definitions/Asia/Kathmandu.rb +0 -20
- data/lib/tzinfo/definitions/Asia/Katmandu.rb +0 -13
- data/lib/tzinfo/definitions/Asia/Khandyga.rb +0 -90
- data/lib/tzinfo/definitions/Asia/Kolkata.rb +0 -27
- data/lib/tzinfo/definitions/Asia/Krasnoyarsk.rb +0 -86
- data/lib/tzinfo/definitions/Asia/Kuala_Lumpur.rb +0 -13
- data/lib/tzinfo/definitions/Asia/Kuching.rb +0 -38
- data/lib/tzinfo/definitions/Asia/Kuwait.rb +0 -13
- data/lib/tzinfo/definitions/Asia/Macao.rb +0 -13
- data/lib/tzinfo/definitions/Asia/Macau.rb +0 -91
- data/lib/tzinfo/definitions/Asia/Magadan.rb +0 -87
- data/lib/tzinfo/definitions/Asia/Makassar.rb +0 -24
- data/lib/tzinfo/definitions/Asia/Manila.rb +0 -30
- data/lib/tzinfo/definitions/Asia/Muscat.rb +0 -13
- data/lib/tzinfo/definitions/Asia/Nicosia.rb +0 -217
- data/lib/tzinfo/definitions/Asia/Novokuznetsk.rb +0 -84
- data/lib/tzinfo/definitions/Asia/Novosibirsk.rb +0 -87
- data/lib/tzinfo/definitions/Asia/Omsk.rb +0 -86
- data/lib/tzinfo/definitions/Asia/Oral.rb +0 -73
- data/lib/tzinfo/definitions/Asia/Phnom_Penh.rb +0 -13
- data/lib/tzinfo/definitions/Asia/Pontianak.rb +0 -30
- data/lib/tzinfo/definitions/Asia/Pyongyang.rb +0 -24
- data/lib/tzinfo/definitions/Asia/Qatar.rb +0 -20
- data/lib/tzinfo/definitions/Asia/Qostanay.rb +0 -72
- data/lib/tzinfo/definitions/Asia/Qyzylorda.rb +0 -73
- data/lib/tzinfo/definitions/Asia/Rangoon.rb +0 -13
- data/lib/tzinfo/definitions/Asia/Riyadh.rb +0 -18
- data/lib/tzinfo/definitions/Asia/Saigon.rb +0 -13
- data/lib/tzinfo/definitions/Asia/Sakhalin.rb +0 -87
- data/lib/tzinfo/definitions/Asia/Samarkand.rb +0 -44
- data/lib/tzinfo/definitions/Asia/Seoul.rb +0 -50
- data/lib/tzinfo/definitions/Asia/Shanghai.rb +0 -47
- data/lib/tzinfo/definitions/Asia/Singapore.rb +0 -31
- data/lib/tzinfo/definitions/Asia/Srednekolymsk.rb +0 -86
- data/lib/tzinfo/definitions/Asia/Taipei.rb +0 -60
- data/lib/tzinfo/definitions/Asia/Tashkent.rb +0 -44
- data/lib/tzinfo/definitions/Asia/Tbilisi.rb +0 -73
- data/lib/tzinfo/definitions/Asia/Tehran.rb +0 -92
- data/lib/tzinfo/definitions/Asia/Tel_Aviv.rb +0 -13
- data/lib/tzinfo/definitions/Asia/Thimbu.rb +0 -13
- data/lib/tzinfo/definitions/Asia/Thimphu.rb +0 -20
- data/lib/tzinfo/definitions/Asia/Tokyo.rb +0 -27
- data/lib/tzinfo/definitions/Asia/Tomsk.rb +0 -87
- data/lib/tzinfo/definitions/Asia/Ujung_Pandang.rb +0 -13
- data/lib/tzinfo/definitions/Asia/Ulaanbaatar.rb +0 -69
- data/lib/tzinfo/definitions/Asia/Ulan_Bator.rb +0 -13
- data/lib/tzinfo/definitions/Asia/Urumqi.rb +0 -18
- data/lib/tzinfo/definitions/Asia/Ust__m__Nera.rb +0 -89
- data/lib/tzinfo/definitions/Asia/Vientiane.rb +0 -13
- data/lib/tzinfo/definitions/Asia/Vladivostok.rb +0 -86
- data/lib/tzinfo/definitions/Asia/Yakutsk.rb +0 -86
- data/lib/tzinfo/definitions/Asia/Yangon.rb +0 -23
- data/lib/tzinfo/definitions/Asia/Yekaterinburg.rb +0 -88
- data/lib/tzinfo/definitions/Asia/Yerevan.rb +0 -82
- data/lib/tzinfo/definitions/Atlantic/Azores.rb +0 -318
- data/lib/tzinfo/definitions/Atlantic/Bermuda.rb +0 -248
- data/lib/tzinfo/definitions/Atlantic/Canary.rb +0 -209
- data/lib/tzinfo/definitions/Atlantic/Cape_Verde.rb +0 -23
- data/lib/tzinfo/definitions/Atlantic/Faeroe.rb +0 -13
- data/lib/tzinfo/definitions/Atlantic/Faroe.rb +0 -205
- data/lib/tzinfo/definitions/Atlantic/Jan_Mayen.rb +0 -13
- data/lib/tzinfo/definitions/Atlantic/Madeira.rb +0 -317
- data/lib/tzinfo/definitions/Atlantic/Reykjavik.rb +0 -13
- data/lib/tzinfo/definitions/Atlantic/South_Georgia.rb +0 -18
- data/lib/tzinfo/definitions/Atlantic/St_Helena.rb +0 -13
- data/lib/tzinfo/definitions/Atlantic/Stanley.rb +0 -91
- data/lib/tzinfo/definitions/Australia/ACT.rb +0 -13
- data/lib/tzinfo/definitions/Australia/Adelaide.rb +0 -233
- data/lib/tzinfo/definitions/Australia/Brisbane.rb +0 -35
- data/lib/tzinfo/definitions/Australia/Broken_Hill.rb +0 -235
- data/lib/tzinfo/definitions/Australia/Canberra.rb +0 -13
- data/lib/tzinfo/definitions/Australia/Currie.rb +0 -13
- data/lib/tzinfo/definitions/Australia/Darwin.rb +0 -29
- data/lib/tzinfo/definitions/Australia/Eucla.rb +0 -37
- data/lib/tzinfo/definitions/Australia/Hobart.rb +0 -243
- data/lib/tzinfo/definitions/Australia/LHI.rb +0 -13
- data/lib/tzinfo/definitions/Australia/Lindeman.rb +0 -39
- data/lib/tzinfo/definitions/Australia/Lord_Howe.rb +0 -206
- data/lib/tzinfo/definitions/Australia/Melbourne.rb +0 -231
- data/lib/tzinfo/definitions/Australia/NSW.rb +0 -13
- data/lib/tzinfo/definitions/Australia/North.rb +0 -13
- data/lib/tzinfo/definitions/Australia/Perth.rb +0 -37
- data/lib/tzinfo/definitions/Australia/Queensland.rb +0 -13
- data/lib/tzinfo/definitions/Australia/South.rb +0 -13
- data/lib/tzinfo/definitions/Australia/Sydney.rb +0 -231
- data/lib/tzinfo/definitions/Australia/Tasmania.rb +0 -13
- data/lib/tzinfo/definitions/Australia/Victoria.rb +0 -13
- data/lib/tzinfo/definitions/Australia/West.rb +0 -13
- data/lib/tzinfo/definitions/Australia/Yancowinna.rb +0 -13
- data/lib/tzinfo/definitions/Brazil/Acre.rb +0 -13
- data/lib/tzinfo/definitions/Brazil/DeNoronha.rb +0 -13
- data/lib/tzinfo/definitions/Brazil/East.rb +0 -13
- data/lib/tzinfo/definitions/Brazil/West.rb +0 -13
- data/lib/tzinfo/definitions/CET.rb +0 -223
- data/lib/tzinfo/definitions/CST6CDT.rb +0 -238
- data/lib/tzinfo/definitions/Canada/Atlantic.rb +0 -13
- data/lib/tzinfo/definitions/Canada/Central.rb +0 -13
- data/lib/tzinfo/definitions/Canada/Eastern.rb +0 -13
- data/lib/tzinfo/definitions/Canada/Mountain.rb +0 -13
- data/lib/tzinfo/definitions/Canada/Newfoundland.rb +0 -13
- data/lib/tzinfo/definitions/Canada/Pacific.rb +0 -13
- data/lib/tzinfo/definitions/Canada/Saskatchewan.rb +0 -13
- data/lib/tzinfo/definitions/Canada/Yukon.rb +0 -13
- data/lib/tzinfo/definitions/Chile/Continental.rb +0 -13
- data/lib/tzinfo/definitions/Chile/EasterIsland.rb +0 -13
- data/lib/tzinfo/definitions/Cuba.rb +0 -11
- data/lib/tzinfo/definitions/EET.rb +0 -209
- data/lib/tzinfo/definitions/EST.rb +0 -14
- data/lib/tzinfo/definitions/EST5EDT.rb +0 -238
- data/lib/tzinfo/definitions/Egypt.rb +0 -11
- data/lib/tzinfo/definitions/Eire.rb +0 -11
- data/lib/tzinfo/definitions/Etc/GMT.rb +0 -16
- data/lib/tzinfo/definitions/Etc/GMT0.rb +0 -13
- data/lib/tzinfo/definitions/Etc/GMT__m__0.rb +0 -13
- data/lib/tzinfo/definitions/Etc/GMT__m__1.rb +0 -16
- data/lib/tzinfo/definitions/Etc/GMT__m__10.rb +0 -16
- data/lib/tzinfo/definitions/Etc/GMT__m__11.rb +0 -16
- data/lib/tzinfo/definitions/Etc/GMT__m__12.rb +0 -16
- data/lib/tzinfo/definitions/Etc/GMT__m__13.rb +0 -16
- data/lib/tzinfo/definitions/Etc/GMT__m__14.rb +0 -16
- data/lib/tzinfo/definitions/Etc/GMT__m__2.rb +0 -16
- data/lib/tzinfo/definitions/Etc/GMT__m__3.rb +0 -16
- data/lib/tzinfo/definitions/Etc/GMT__m__4.rb +0 -16
- data/lib/tzinfo/definitions/Etc/GMT__m__5.rb +0 -16
- data/lib/tzinfo/definitions/Etc/GMT__m__6.rb +0 -16
- data/lib/tzinfo/definitions/Etc/GMT__m__7.rb +0 -16
- data/lib/tzinfo/definitions/Etc/GMT__m__8.rb +0 -16
- data/lib/tzinfo/definitions/Etc/GMT__m__9.rb +0 -16
- data/lib/tzinfo/definitions/Etc/GMT__p__0.rb +0 -13
- data/lib/tzinfo/definitions/Etc/GMT__p__1.rb +0 -16
- data/lib/tzinfo/definitions/Etc/GMT__p__10.rb +0 -16
- data/lib/tzinfo/definitions/Etc/GMT__p__11.rb +0 -16
- data/lib/tzinfo/definitions/Etc/GMT__p__12.rb +0 -16
- data/lib/tzinfo/definitions/Etc/GMT__p__2.rb +0 -16
- data/lib/tzinfo/definitions/Etc/GMT__p__3.rb +0 -16
- data/lib/tzinfo/definitions/Etc/GMT__p__4.rb +0 -16
- data/lib/tzinfo/definitions/Etc/GMT__p__5.rb +0 -16
- data/lib/tzinfo/definitions/Etc/GMT__p__6.rb +0 -16
- data/lib/tzinfo/definitions/Etc/GMT__p__7.rb +0 -16
- data/lib/tzinfo/definitions/Etc/GMT__p__8.rb +0 -16
- data/lib/tzinfo/definitions/Etc/GMT__p__9.rb +0 -16
- data/lib/tzinfo/definitions/Etc/Greenwich.rb +0 -13
- data/lib/tzinfo/definitions/Etc/UCT.rb +0 -13
- data/lib/tzinfo/definitions/Etc/UTC.rb +0 -16
- data/lib/tzinfo/definitions/Etc/Universal.rb +0 -13
- data/lib/tzinfo/definitions/Etc/Zulu.rb +0 -13
- data/lib/tzinfo/definitions/Europe/Amsterdam.rb +0 -13
- data/lib/tzinfo/definitions/Europe/Andorra.rb +0 -199
- data/lib/tzinfo/definitions/Europe/Astrakhan.rb +0 -84
- data/lib/tzinfo/definitions/Europe/Athens.rb +0 -231
- data/lib/tzinfo/definitions/Europe/Belfast.rb +0 -13
- data/lib/tzinfo/definitions/Europe/Belgrade.rb +0 -209
- data/lib/tzinfo/definitions/Europe/Berlin.rb +0 -234
- data/lib/tzinfo/definitions/Europe/Bratislava.rb +0 -13
- data/lib/tzinfo/definitions/Europe/Brussels.rb +0 -278
- data/lib/tzinfo/definitions/Europe/Bucharest.rb +0 -227
- data/lib/tzinfo/definitions/Europe/Budapest.rb +0 -241
- data/lib/tzinfo/definitions/Europe/Busingen.rb +0 -13
- data/lib/tzinfo/definitions/Europe/Chisinau.rb +0 -237
- data/lib/tzinfo/definitions/Europe/Copenhagen.rb +0 -13
- data/lib/tzinfo/definitions/Europe/Dublin.rb +0 -322
- data/lib/tzinfo/definitions/Europe/Gibraltar.rb +0 -291
- data/lib/tzinfo/definitions/Europe/Guernsey.rb +0 -13
- data/lib/tzinfo/definitions/Europe/Helsinki.rb +0 -209
- data/lib/tzinfo/definitions/Europe/Isle_of_Man.rb +0 -13
- data/lib/tzinfo/definitions/Europe/Istanbul.rb +0 -136
- data/lib/tzinfo/definitions/Europe/Jersey.rb +0 -13
- data/lib/tzinfo/definitions/Europe/Kaliningrad.rb +0 -103
- data/lib/tzinfo/definitions/Europe/Kiev.rb +0 -13
- data/lib/tzinfo/definitions/Europe/Kirov.rb +0 -85
- data/lib/tzinfo/definitions/Europe/Kyiv.rb +0 -216
- data/lib/tzinfo/definitions/Europe/Lisbon.rb +0 -316
- data/lib/tzinfo/definitions/Europe/Ljubljana.rb +0 -13
- data/lib/tzinfo/definitions/Europe/London.rb +0 -334
- data/lib/tzinfo/definitions/Europe/Luxembourg.rb +0 -13
- data/lib/tzinfo/definitions/Europe/Madrid.rb +0 -255
- data/lib/tzinfo/definitions/Europe/Malta.rb +0 -259
- data/lib/tzinfo/definitions/Europe/Mariehamn.rb +0 -13
- data/lib/tzinfo/definitions/Europe/Minsk.rb +0 -92
- data/lib/tzinfo/definitions/Europe/Monaco.rb +0 -13
- data/lib/tzinfo/definitions/Europe/Moscow.rb +0 -104
- data/lib/tzinfo/definitions/Europe/Nicosia.rb +0 -13
- data/lib/tzinfo/definitions/Europe/Oslo.rb +0 -13
- data/lib/tzinfo/definitions/Europe/Paris.rb +0 -278
- data/lib/tzinfo/definitions/Europe/Podgorica.rb +0 -13
- data/lib/tzinfo/definitions/Europe/Prague.rb +0 -236
- data/lib/tzinfo/definitions/Europe/Riga.rb +0 -222
- data/lib/tzinfo/definitions/Europe/Rome.rb +0 -261
- data/lib/tzinfo/definitions/Europe/Samara.rb +0 -85
- data/lib/tzinfo/definitions/Europe/San_Marino.rb +0 -13
- data/lib/tzinfo/definitions/Europe/Sarajevo.rb +0 -13
- data/lib/tzinfo/definitions/Europe/Saratov.rb +0 -84
- data/lib/tzinfo/definitions/Europe/Simferopol.rb +0 -99
- data/lib/tzinfo/definitions/Europe/Skopje.rb +0 -13
- data/lib/tzinfo/definitions/Europe/Sofia.rb +0 -219
- data/lib/tzinfo/definitions/Europe/Stockholm.rb +0 -13
- data/lib/tzinfo/definitions/Europe/Tallinn.rb +0 -218
- data/lib/tzinfo/definitions/Europe/Tirane.rb +0 -223
- data/lib/tzinfo/definitions/Europe/Tiraspol.rb +0 -13
- data/lib/tzinfo/definitions/Europe/Ulyanovsk.rb +0 -88
- data/lib/tzinfo/definitions/Europe/Uzhgorod.rb +0 -13
- data/lib/tzinfo/definitions/Europe/Vaduz.rb +0 -13
- data/lib/tzinfo/definitions/Europe/Vatican.rb +0 -13
- data/lib/tzinfo/definitions/Europe/Vienna.rb +0 -229
- data/lib/tzinfo/definitions/Europe/Vilnius.rb +0 -216
- data/lib/tzinfo/definitions/Europe/Volgograd.rb +0 -87
- data/lib/tzinfo/definitions/Europe/Warsaw.rb +0 -258
- data/lib/tzinfo/definitions/Europe/Zagreb.rb +0 -13
- data/lib/tzinfo/definitions/Europe/Zaporozhye.rb +0 -13
- data/lib/tzinfo/definitions/Europe/Zurich.rb +0 -211
- data/lib/tzinfo/definitions/Factory.rb +0 -14
- data/lib/tzinfo/definitions/GB.rb +0 -11
- data/lib/tzinfo/definitions/GB__m__Eire.rb +0 -11
- data/lib/tzinfo/definitions/GMT.rb +0 -11
- data/lib/tzinfo/definitions/GMT0.rb +0 -11
- data/lib/tzinfo/definitions/GMT__m__0.rb +0 -11
- data/lib/tzinfo/definitions/GMT__p__0.rb +0 -11
- data/lib/tzinfo/definitions/Greenwich.rb +0 -11
- data/lib/tzinfo/definitions/HST.rb +0 -14
- data/lib/tzinfo/definitions/Hongkong.rb +0 -11
- data/lib/tzinfo/definitions/Iceland.rb +0 -11
- data/lib/tzinfo/definitions/Indian/Antananarivo.rb +0 -13
- data/lib/tzinfo/definitions/Indian/Chagos.rb +0 -20
- data/lib/tzinfo/definitions/Indian/Christmas.rb +0 -13
- data/lib/tzinfo/definitions/Indian/Cocos.rb +0 -13
- data/lib/tzinfo/definitions/Indian/Comoro.rb +0 -13
- data/lib/tzinfo/definitions/Indian/Kerguelen.rb +0 -13
- data/lib/tzinfo/definitions/Indian/Mahe.rb +0 -13
- data/lib/tzinfo/definitions/Indian/Maldives.rb +0 -20
- data/lib/tzinfo/definitions/Indian/Mauritius.rb +0 -23
- data/lib/tzinfo/definitions/Indian/Mayotte.rb +0 -13
- data/lib/tzinfo/definitions/Indian/Reunion.rb +0 -13
- data/lib/tzinfo/definitions/Iran.rb +0 -11
- data/lib/tzinfo/definitions/Israel.rb +0 -11
- data/lib/tzinfo/definitions/Jamaica.rb +0 -11
- data/lib/tzinfo/definitions/Japan.rb +0 -11
- data/lib/tzinfo/definitions/Kwajalein.rb +0 -11
- data/lib/tzinfo/definitions/Libya.rb +0 -11
- data/lib/tzinfo/definitions/MET.rb +0 -223
- data/lib/tzinfo/definitions/MST.rb +0 -14
- data/lib/tzinfo/definitions/MST7MDT.rb +0 -238
- data/lib/tzinfo/definitions/Mexico/BajaNorte.rb +0 -13
- data/lib/tzinfo/definitions/Mexico/BajaSur.rb +0 -13
- data/lib/tzinfo/definitions/Mexico/General.rb +0 -13
- data/lib/tzinfo/definitions/NZ.rb +0 -11
- data/lib/tzinfo/definitions/NZ__m__CHAT.rb +0 -11
- data/lib/tzinfo/definitions/Navajo.rb +0 -11
- data/lib/tzinfo/definitions/PRC.rb +0 -11
- data/lib/tzinfo/definitions/PST8PDT.rb +0 -238
- data/lib/tzinfo/definitions/Pacific/Apia.rb +0 -48
- data/lib/tzinfo/definitions/Pacific/Auckland.rb +0 -248
- data/lib/tzinfo/definitions/Pacific/Bougainville.rb +0 -25
- data/lib/tzinfo/definitions/Pacific/Chatham.rb +0 -219
- data/lib/tzinfo/definitions/Pacific/Chuuk.rb +0 -13
- data/lib/tzinfo/definitions/Pacific/Easter.rb +0 -231
- data/lib/tzinfo/definitions/Pacific/Efate.rb +0 -41
- data/lib/tzinfo/definitions/Pacific/Enderbury.rb +0 -13
- data/lib/tzinfo/definitions/Pacific/Fakaofo.rb +0 -20
- data/lib/tzinfo/definitions/Pacific/Fiji.rb +0 -47
- data/lib/tzinfo/definitions/Pacific/Funafuti.rb +0 -13
- data/lib/tzinfo/definitions/Pacific/Galapagos.rb +0 -23
- data/lib/tzinfo/definitions/Pacific/Gambier.rb +0 -18
- data/lib/tzinfo/definitions/Pacific/Guadalcanal.rb +0 -18
- data/lib/tzinfo/definitions/Pacific/Guam.rb +0 -42
- data/lib/tzinfo/definitions/Pacific/Honolulu.rb +0 -28
- data/lib/tzinfo/definitions/Pacific/Johnston.rb +0 -13
- data/lib/tzinfo/definitions/Pacific/Kanton.rb +0 -22
- data/lib/tzinfo/definitions/Pacific/Kiritimati.rb +0 -22
- data/lib/tzinfo/definitions/Pacific/Kosrae.rb +0 -30
- data/lib/tzinfo/definitions/Pacific/Kwajalein.rb +0 -27
- data/lib/tzinfo/definitions/Pacific/Majuro.rb +0 -13
- data/lib/tzinfo/definitions/Pacific/Marquesas.rb +0 -18
- data/lib/tzinfo/definitions/Pacific/Midway.rb +0 -13
- data/lib/tzinfo/definitions/Pacific/Nauru.rb +0 -23
- data/lib/tzinfo/definitions/Pacific/Niue.rb +0 -20
- data/lib/tzinfo/definitions/Pacific/Norfolk.rb +0 -134
- data/lib/tzinfo/definitions/Pacific/Noumea.rb +0 -25
- data/lib/tzinfo/definitions/Pacific/Pago_Pago.rb +0 -20
- data/lib/tzinfo/definitions/Pacific/Palau.rb +0 -20
- data/lib/tzinfo/definitions/Pacific/Pitcairn.rb +0 -20
- data/lib/tzinfo/definitions/Pacific/Pohnpei.rb +0 -13
- data/lib/tzinfo/definitions/Pacific/Ponape.rb +0 -13
- data/lib/tzinfo/definitions/Pacific/Port_Moresby.rb +0 -20
- data/lib/tzinfo/definitions/Pacific/Rarotonga.rb +0 -48
- data/lib/tzinfo/definitions/Pacific/Saipan.rb +0 -13
- data/lib/tzinfo/definitions/Pacific/Samoa.rb +0 -13
- data/lib/tzinfo/definitions/Pacific/Tahiti.rb +0 -18
- data/lib/tzinfo/definitions/Pacific/Tarawa.rb +0 -18
- data/lib/tzinfo/definitions/Pacific/Tongatapu.rb +0 -29
- data/lib/tzinfo/definitions/Pacific/Truk.rb +0 -13
- data/lib/tzinfo/definitions/Pacific/Wake.rb +0 -13
- data/lib/tzinfo/definitions/Pacific/Wallis.rb +0 -13
- data/lib/tzinfo/definitions/Pacific/Yap.rb +0 -13
- data/lib/tzinfo/definitions/Poland.rb +0 -11
- data/lib/tzinfo/definitions/Portugal.rb +0 -11
- data/lib/tzinfo/definitions/ROC.rb +0 -11
- data/lib/tzinfo/definitions/ROK.rb +0 -11
- data/lib/tzinfo/definitions/Singapore.rb +0 -11
- data/lib/tzinfo/definitions/Turkey.rb +0 -11
- data/lib/tzinfo/definitions/UCT.rb +0 -11
- data/lib/tzinfo/definitions/US/Alaska.rb +0 -13
- data/lib/tzinfo/definitions/US/Aleutian.rb +0 -13
- data/lib/tzinfo/definitions/US/Arizona.rb +0 -13
- data/lib/tzinfo/definitions/US/Central.rb +0 -13
- data/lib/tzinfo/definitions/US/East__m__Indiana.rb +0 -13
- data/lib/tzinfo/definitions/US/Eastern.rb +0 -13
- data/lib/tzinfo/definitions/US/Hawaii.rb +0 -13
- data/lib/tzinfo/definitions/US/Indiana__m__Starke.rb +0 -13
- data/lib/tzinfo/definitions/US/Michigan.rb +0 -13
- data/lib/tzinfo/definitions/US/Mountain.rb +0 -13
- data/lib/tzinfo/definitions/US/Pacific.rb +0 -13
- data/lib/tzinfo/definitions/US/Samoa.rb +0 -13
- data/lib/tzinfo/definitions/UTC.rb +0 -11
- data/lib/tzinfo/definitions/Universal.rb +0 -11
- data/lib/tzinfo/definitions/WET.rb +0 -209
- data/lib/tzinfo/definitions/W__m__SU.rb +0 -11
- data/lib/tzinfo/definitions/Zulu.rb +0 -11
- data/lib/tzinfo/indexes/countries.rb +0 -924
- data/lib/tzinfo/indexes/timezones.rb +0 -607
- data/lib/tzinfo/tzdataparser.rb +0 -1287
- data/test/in_load_path/payload.rb +0 -1
- data/tzinfo.gemspec +0 -19
@@ -0,0 +1,223 @@
|
|
1
|
+
#--
|
2
|
+
# Copyright (c) 2006-2013 Philip Ross
|
3
|
+
#
|
4
|
+
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
5
|
+
# of this software and associated documentation files (the "Software"), to deal
|
6
|
+
# in the Software without restriction, including without limitation the rights
|
7
|
+
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
8
|
+
# copies of the Software, and to permit persons to whom the Software is
|
9
|
+
# furnished to do so, subject to the following conditions:
|
10
|
+
#
|
11
|
+
# The above copyright notice and this permission notice shall be included in all
|
12
|
+
# copies or substantial portions of the Software.
|
13
|
+
#
|
14
|
+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
15
|
+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
16
|
+
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
17
|
+
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
18
|
+
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
19
|
+
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
20
|
+
# THE SOFTWARE.
|
21
|
+
#++
|
22
|
+
|
23
|
+
module TZInfo
|
24
|
+
# Raised if no offsets have been defined when calling period_for_utc or
|
25
|
+
# periods_for_local. Indicates an error in the timezone data.
|
26
|
+
class NoOffsetsDefined < StandardError
|
27
|
+
end
|
28
|
+
|
29
|
+
# Represents a data timezone defined by a set of offsets and a set
|
30
|
+
# of transitions
|
31
|
+
class TransitionDataTimezoneInfo < DataTimezoneInfo #:nodoc:
|
32
|
+
|
33
|
+
# Constructs a new TransitionDataTimezoneInfo with its identifier.
|
34
|
+
def initialize(identifier)
|
35
|
+
super(identifier)
|
36
|
+
@offsets = {}
|
37
|
+
@transitions = []
|
38
|
+
@previous_offset = nil
|
39
|
+
@transitions_index = nil
|
40
|
+
end
|
41
|
+
|
42
|
+
# Defines a offset. The id uniquely identifies this offset within the
|
43
|
+
# timezone. utc_offset and std_offset define the offset in seconds of
|
44
|
+
# standard time from UTC and daylight savings from standard time
|
45
|
+
# respectively. abbreviation describes the timezone offset (e.g. GMT, BST,
|
46
|
+
# EST or EDT).
|
47
|
+
#
|
48
|
+
# The first offset to be defined is treated as the offset that applies
|
49
|
+
# until the first transition. This will usually be in Local Mean Time (LMT).
|
50
|
+
#
|
51
|
+
# ArgumentError will be raised if the id is already defined.
|
52
|
+
def offset(id, utc_offset, std_offset, abbreviation)
|
53
|
+
raise ArgumentError, 'Offset already defined' if @offsets.has_key?(id)
|
54
|
+
|
55
|
+
offset = TimezoneOffsetInfo.new(utc_offset, std_offset, abbreviation)
|
56
|
+
@offsets[id] = offset
|
57
|
+
@previous_offset = offset unless @previous_offset
|
58
|
+
end
|
59
|
+
|
60
|
+
# Defines a transition. Transitions must be defined in chronological order.
|
61
|
+
# ArgumentError will be raised if a transition is added out of order.
|
62
|
+
# offset_id refers to an id defined with offset. ArgumentError will be
|
63
|
+
# raised if the offset_id cannot be found. numerator_or_time and
|
64
|
+
# denomiator specify the time the transition occurs as. See
|
65
|
+
# TimezoneTransitionInfo for more detail about specifying times.
|
66
|
+
def transition(year, month, offset_id, numerator_or_timestamp, denominator_or_numerator = nil, denominator = nil)
|
67
|
+
offset = @offsets[offset_id]
|
68
|
+
raise ArgumentError, 'Offset not found' unless offset
|
69
|
+
|
70
|
+
if @transitions_index
|
71
|
+
if year < @last_year || (year == @last_year && month < @last_month)
|
72
|
+
raise ArgumentError, 'Transitions must be increasing date order'
|
73
|
+
end
|
74
|
+
|
75
|
+
# Record the position of the first transition with this index.
|
76
|
+
index = transition_index(year, month)
|
77
|
+
@transitions_index[index] ||= @transitions.length
|
78
|
+
|
79
|
+
# Fill in any gaps
|
80
|
+
(index - 1).downto(0) do |i|
|
81
|
+
break if @transitions_index[i]
|
82
|
+
@transitions_index[i] = @transitions.length
|
83
|
+
end
|
84
|
+
else
|
85
|
+
@transitions_index = [@transitions.length]
|
86
|
+
@start_year = year
|
87
|
+
@start_month = month
|
88
|
+
end
|
89
|
+
|
90
|
+
@transitions << TimezoneTransitionInfo.new(offset, @previous_offset,
|
91
|
+
numerator_or_timestamp, denominator_or_numerator, denominator)
|
92
|
+
@last_year = year
|
93
|
+
@last_month = month
|
94
|
+
@previous_offset = offset
|
95
|
+
end
|
96
|
+
|
97
|
+
# Returns the TimezonePeriod for the given UTC time.
|
98
|
+
# Raises NoOffsetsDefined if no offsets have been defined.
|
99
|
+
def period_for_utc(utc)
|
100
|
+
unless @transitions.empty?
|
101
|
+
utc = TimeOrDateTime.wrap(utc)
|
102
|
+
index = transition_index(utc.year, utc.mon)
|
103
|
+
|
104
|
+
start_transition = nil
|
105
|
+
start = transition_before_end(index)
|
106
|
+
if start
|
107
|
+
start.downto(0) do |i|
|
108
|
+
if @transitions[i].at <= utc
|
109
|
+
start_transition = @transitions[i]
|
110
|
+
break
|
111
|
+
end
|
112
|
+
end
|
113
|
+
end
|
114
|
+
|
115
|
+
end_transition = nil
|
116
|
+
start = transition_after_start(index)
|
117
|
+
if start
|
118
|
+
start.upto(@transitions.length - 1) do |i|
|
119
|
+
if @transitions[i].at > utc
|
120
|
+
end_transition = @transitions[i]
|
121
|
+
break
|
122
|
+
end
|
123
|
+
end
|
124
|
+
end
|
125
|
+
|
126
|
+
if start_transition || end_transition
|
127
|
+
TimezonePeriod.new(start_transition, end_transition)
|
128
|
+
else
|
129
|
+
# Won't happen since there are transitions. Must always find one
|
130
|
+
# transition that is either >= or < the specified time.
|
131
|
+
raise 'No transitions found in search'
|
132
|
+
end
|
133
|
+
else
|
134
|
+
raise NoOffsetsDefined, 'No offsets have been defined' unless @previous_offset
|
135
|
+
TimezonePeriod.new(nil, nil, @previous_offset)
|
136
|
+
end
|
137
|
+
end
|
138
|
+
|
139
|
+
# Returns the set of TimezonePeriods for the given local time as an array.
|
140
|
+
# Results returned are ordered by increasing UTC start date.
|
141
|
+
# Returns an empty array if no periods are found for the given time.
|
142
|
+
# Raises NoOffsetsDefined if no offsets have been defined.
|
143
|
+
def periods_for_local(local)
|
144
|
+
unless @transitions.empty?
|
145
|
+
local = TimeOrDateTime.wrap(local)
|
146
|
+
index = transition_index(local.year, local.mon)
|
147
|
+
|
148
|
+
result = []
|
149
|
+
|
150
|
+
start_index = transition_after_start(index - 1)
|
151
|
+
if start_index && @transitions[start_index].local_end > local
|
152
|
+
if start_index > 0
|
153
|
+
if @transitions[start_index - 1].local_start <= local
|
154
|
+
result << TimezonePeriod.new(@transitions[start_index - 1], @transitions[start_index])
|
155
|
+
end
|
156
|
+
else
|
157
|
+
result << TimezonePeriod.new(nil, @transitions[start_index])
|
158
|
+
end
|
159
|
+
end
|
160
|
+
|
161
|
+
end_index = transition_before_end(index + 1)
|
162
|
+
|
163
|
+
if end_index
|
164
|
+
start_index = end_index unless start_index
|
165
|
+
|
166
|
+
start_index.upto(transition_before_end(index + 1)) do |i|
|
167
|
+
if @transitions[i].local_start <= local
|
168
|
+
if i + 1 < @transitions.length
|
169
|
+
if @transitions[i + 1].local_end > local
|
170
|
+
result << TimezonePeriod.new(@transitions[i], @transitions[i + 1])
|
171
|
+
end
|
172
|
+
else
|
173
|
+
result << TimezonePeriod.new(@transitions[i], nil)
|
174
|
+
end
|
175
|
+
end
|
176
|
+
end
|
177
|
+
end
|
178
|
+
|
179
|
+
result
|
180
|
+
else
|
181
|
+
raise NoOffsetsDefined, 'No offsets have been defined' unless @previous_offset
|
182
|
+
[TimezonePeriod.new(nil, nil, @previous_offset)]
|
183
|
+
end
|
184
|
+
end
|
185
|
+
|
186
|
+
private
|
187
|
+
# Returns the index into the @transitions_index array for a given year
|
188
|
+
# and month.
|
189
|
+
def transition_index(year, month)
|
190
|
+
index = (year - @start_year) * 2
|
191
|
+
index += 1 if month > 6
|
192
|
+
index -= 1 if @start_month > 6
|
193
|
+
index
|
194
|
+
end
|
195
|
+
|
196
|
+
# Returns the index into @transitions of the first transition that occurs
|
197
|
+
# on or after the start of the given index into @transitions_index.
|
198
|
+
# Returns nil if there are no such transitions.
|
199
|
+
def transition_after_start(index)
|
200
|
+
if index >= @transitions_index.length
|
201
|
+
nil
|
202
|
+
else
|
203
|
+
index = 0 if index < 0
|
204
|
+
@transitions_index[index]
|
205
|
+
end
|
206
|
+
end
|
207
|
+
|
208
|
+
# Returns the index into @transitions of the first transition that occurs
|
209
|
+
# before the end of the given index into @transitions_index.
|
210
|
+
# Returns nil if there are no such transitions.
|
211
|
+
def transition_before_end(index)
|
212
|
+
index = index + 1
|
213
|
+
|
214
|
+
if index <= 0
|
215
|
+
nil
|
216
|
+
elsif index >= @transitions_index.length
|
217
|
+
@transitions.length - 1
|
218
|
+
else
|
219
|
+
@transitions_index[index] - 1
|
220
|
+
end
|
221
|
+
end
|
222
|
+
end
|
223
|
+
end
|
@@ -0,0 +1,50 @@
|
|
1
|
+
#--
|
2
|
+
# Copyright (c) 2013 Philip Ross
|
3
|
+
#
|
4
|
+
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
5
|
+
# of this software and associated documentation files (the "Software"), to deal
|
6
|
+
# in the Software without restriction, including without limitation the rights
|
7
|
+
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
8
|
+
# copies of the Software, and to permit persons to whom the Software is
|
9
|
+
# furnished to do so, subject to the following conditions:
|
10
|
+
#
|
11
|
+
# The above copyright notice and this permission notice shall be included in all
|
12
|
+
# copies or substantial portions of the Software.
|
13
|
+
#
|
14
|
+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
15
|
+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
16
|
+
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
17
|
+
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
18
|
+
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
19
|
+
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
20
|
+
# THE SOFTWARE.
|
21
|
+
#++
|
22
|
+
|
23
|
+
module TZInfo
|
24
|
+
# Represents information about a country returned by ZoneinfoDataSource.
|
25
|
+
class ZoneinfoCountryInfo < CountryInfo #:nodoc:
|
26
|
+
# Constructs a new CountryInfo with an ISO 3166 country code, name and
|
27
|
+
# an array of CountryTimezones.
|
28
|
+
def initialize(code, name, zones)
|
29
|
+
super(code, name)
|
30
|
+
@zones = zones.dup.freeze
|
31
|
+
@zone_identifiers = nil
|
32
|
+
end
|
33
|
+
|
34
|
+
# Returns a frozen array of all the zone identifiers for the country ordered
|
35
|
+
# geographically, most populous first.
|
36
|
+
def zone_identifiers
|
37
|
+
unless @zone_identifiers
|
38
|
+
@zone_identifiers = zones.collect {|zone| zone.identifier}.freeze
|
39
|
+
end
|
40
|
+
|
41
|
+
@zone_identifiers
|
42
|
+
end
|
43
|
+
|
44
|
+
# Returns a frozen array of all the timezones for the for the country
|
45
|
+
# ordered geographically, most populous first.
|
46
|
+
def zones
|
47
|
+
@zones
|
48
|
+
end
|
49
|
+
end
|
50
|
+
end
|
@@ -0,0 +1,297 @@
|
|
1
|
+
#--
|
2
|
+
# Copyright (c) 2012-2013 Philip Ross
|
3
|
+
#
|
4
|
+
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
5
|
+
# of this software and associated documentation files (the "Software"), to deal
|
6
|
+
# in the Software without restriction, including without limitation the rights
|
7
|
+
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
8
|
+
# copies of the Software, and to permit persons to whom the Software is
|
9
|
+
# furnished to do so, subject to the following conditions:
|
10
|
+
#
|
11
|
+
# The above copyright notice and this permission notice shall be included in all
|
12
|
+
# copies or substantial portions of the Software.
|
13
|
+
#
|
14
|
+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
15
|
+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
16
|
+
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
17
|
+
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
18
|
+
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
19
|
+
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
20
|
+
# THE SOFTWARE.
|
21
|
+
#++
|
22
|
+
|
23
|
+
module TZInfo
|
24
|
+
# An InvalidZoneinfoDirectory exception is raised if the DataSource is
|
25
|
+
# set to a specific zoneinfo path, which is not a valid zoneinfo directory
|
26
|
+
# (i.e. a directory containing index files named iso3166.tab and zone.tab
|
27
|
+
# as well as other timezone files).
|
28
|
+
class InvalidZoneinfoDirectory < StandardError
|
29
|
+
end
|
30
|
+
|
31
|
+
# A ZoneinfoDirectoryNotFound exception is raised if no valid zoneinfo
|
32
|
+
# directory could be found when checking the paths listed in
|
33
|
+
# ZoneinfoDataSource.search_path. A valid zoneinfo directory is one that
|
34
|
+
# contains index files named iso3166.tab and zone.tab as well as other
|
35
|
+
# timezone files.
|
36
|
+
class ZoneinfoDirectoryNotFound < StandardError
|
37
|
+
end
|
38
|
+
|
39
|
+
# A DataSource that loads data from a 'zoneinfo' directory containing
|
40
|
+
# compiled "TZif" version 2 (or earlier) files in addition to zones.tab
|
41
|
+
# and iso3166.tab index files.
|
42
|
+
#
|
43
|
+
# To have TZInfo load the system zoneinfo files, call TZInfo::DataSource.set
|
44
|
+
# as follows:
|
45
|
+
#
|
46
|
+
# TZInfo::DataSource.set(:zoneinfo)
|
47
|
+
#
|
48
|
+
# To load zoneinfo files from a particular directory, pass the directory to
|
49
|
+
# TZInfo::DataSource.set:
|
50
|
+
#
|
51
|
+
# TZInfo::DataSource.set(:zoneinfo, directory)
|
52
|
+
class ZoneinfoDataSource < DataSource
|
53
|
+
# The default value of ZoneInfoDataSource.search_path.
|
54
|
+
DEFAULT_SEARCH_PATH = ['/usr/share/zoneinfo', '/usr/share/lib/zoneinfo', '/etc/zoneinfo'].freeze
|
55
|
+
|
56
|
+
# Paths to be checked to find the system zoneinfo directory.
|
57
|
+
@@search_path = DEFAULT_SEARCH_PATH.dup
|
58
|
+
|
59
|
+
# An Array of directories that will be checked to find the system zoneinfo
|
60
|
+
# directory.
|
61
|
+
#
|
62
|
+
# Directories are checked in the order they appear in the Array.
|
63
|
+
#
|
64
|
+
# The default value is ['/usr/share/zoneinfo', '/usr/share/lib/zoneinfo', '/etc/zoneinfo'].
|
65
|
+
def self.search_path
|
66
|
+
@@search_path
|
67
|
+
end
|
68
|
+
|
69
|
+
# Sets the directories to be checked when locating the system zoneinfo
|
70
|
+
# directory.
|
71
|
+
#
|
72
|
+
# Can be set to an Array of directories or a String containing directories
|
73
|
+
# separated with File::PATH_SEPARATOR.
|
74
|
+
#
|
75
|
+
# Directories are checked in the order they appear in the Array or String.
|
76
|
+
#
|
77
|
+
# Set to nil to revert to the default paths.
|
78
|
+
def self.search_path=(search_path)
|
79
|
+
if search_path
|
80
|
+
if search_path.kind_of?(String)
|
81
|
+
@@search_path = search_path.split(File::PATH_SEPARATOR)
|
82
|
+
else
|
83
|
+
@@search_path = search_path.collect {|p| p.to_s}
|
84
|
+
end
|
85
|
+
else
|
86
|
+
@@search_path = DEFAULT_SEARCH_PATH.dup
|
87
|
+
end
|
88
|
+
end
|
89
|
+
|
90
|
+
# The zoneinfo directory being used.
|
91
|
+
attr_reader :zoneinfo_dir
|
92
|
+
|
93
|
+
# Creates a new ZoneinfoDataSource.
|
94
|
+
#
|
95
|
+
# If zoneinfo_dir is specified, it will be checked and used as the source
|
96
|
+
# of zoneinfo files. If the directory does not contain zone.tab and
|
97
|
+
# iso3166.tab files, InvalidZoneinfoDirectory will be raised.
|
98
|
+
#
|
99
|
+
# If zoneinfo_dir is not specified or nil, the paths referenced in
|
100
|
+
# search_path are searched in order to find a valid zoneinfo directory
|
101
|
+
# (one that contains files named zone.tab and iso3166.tab). If no valid
|
102
|
+
# zoneinfo directory is found ZoneinfoDirectoryNotFound will be raised.
|
103
|
+
def initialize(zoneinfo_dir = nil)
|
104
|
+
if zoneinfo_dir
|
105
|
+
unless valid_zoneinfo_dir?(zoneinfo_dir)
|
106
|
+
raise InvalidZoneinfoDirectory, "#{zoneinfo_dir} is not a directory or doesn't contain iso3166.tab and zone.tab files."
|
107
|
+
end
|
108
|
+
@zoneinfo_dir = zoneinfo_dir
|
109
|
+
else
|
110
|
+
@zoneinfo_dir = self.class.search_path.detect do |path|
|
111
|
+
valid_zoneinfo_dir?(path)
|
112
|
+
end
|
113
|
+
|
114
|
+
unless @zoneinfo_dir
|
115
|
+
raise ZoneinfoDirectoryNotFound, "None of the paths included in TZInfo::ZoneinfoDataSource.search_path are valid zoneinfo directories."
|
116
|
+
end
|
117
|
+
end
|
118
|
+
|
119
|
+
@zoneinfo_dir = File.expand_path(@zoneinfo_dir).freeze
|
120
|
+
@zoneinfo_prefix = (@zoneinfo_dir + File::SEPARATOR).freeze
|
121
|
+
end
|
122
|
+
|
123
|
+
# Returns a TimezoneInfo instance for a given identifier.
|
124
|
+
# Raises InvalidTimezoneIdentifier if the timezone is not found or the
|
125
|
+
# identifier is invalid.
|
126
|
+
def load_timezone_info(identifier)
|
127
|
+
load_timezone_index
|
128
|
+
|
129
|
+
begin
|
130
|
+
if @timezone_index.include?(identifier)
|
131
|
+
identifier.untaint
|
132
|
+
path = File.join(@zoneinfo_dir, identifier)
|
133
|
+
|
134
|
+
begin
|
135
|
+
ZoneinfoTimezoneInfo.new(identifier, path)
|
136
|
+
rescue InvalidZoneinfoFile => e
|
137
|
+
raise InvalidTimezoneIdentifier, e.message
|
138
|
+
end
|
139
|
+
else
|
140
|
+
raise InvalidTimezoneIdentifier, 'Invalid identifier'
|
141
|
+
end
|
142
|
+
rescue Errno::ENOENT, Errno::ENAMETOOLONG, Errno::ENOTDIR
|
143
|
+
raise InvalidTimezoneIdentifier, 'Invalid identifier'
|
144
|
+
rescue Errno::EACCES => e
|
145
|
+
raise InvalidTimezoneIdentifier, e.message
|
146
|
+
end
|
147
|
+
end
|
148
|
+
|
149
|
+
# Returns an array of all the available timezone identifiers.
|
150
|
+
def timezone_identifiers
|
151
|
+
load_timezone_index
|
152
|
+
@timezone_index
|
153
|
+
end
|
154
|
+
|
155
|
+
# Returns an array of all the available timezone identifiers for
|
156
|
+
# data timezones (i.e. those that actually contain definitions).
|
157
|
+
#
|
158
|
+
# For ZoneinfoDataSource, this will always be identical to
|
159
|
+
# timezone_identifers.
|
160
|
+
def data_timezone_identifiers
|
161
|
+
load_timezone_index
|
162
|
+
@timezone_index
|
163
|
+
end
|
164
|
+
|
165
|
+
# Returns an array of all the available timezone identifiers that
|
166
|
+
# are links to other timezones.
|
167
|
+
#
|
168
|
+
# For ZoneinfoDataSource, this will always be an empty array.
|
169
|
+
def linked_timezone_identifiers
|
170
|
+
[].freeze
|
171
|
+
end
|
172
|
+
|
173
|
+
# Returns a CountryInfo instance for the given ISO 3166-1 alpha-2
|
174
|
+
# country code. Raises InvalidCountryCode if the country could not be found
|
175
|
+
# or the code is invalid.
|
176
|
+
def load_country_info(code)
|
177
|
+
load_country_index
|
178
|
+
info = @country_index[code]
|
179
|
+
raise InvalidCountryCode.new, 'Invalid country code' unless info
|
180
|
+
info
|
181
|
+
end
|
182
|
+
|
183
|
+
# Returns an array of all the available ISO 3166-1 alpha-2
|
184
|
+
# country codes.
|
185
|
+
def country_codes
|
186
|
+
load_country_index
|
187
|
+
@country_index.keys.freeze
|
188
|
+
end
|
189
|
+
|
190
|
+
# Returns the name and information about this DataSource.
|
191
|
+
def to_s
|
192
|
+
"Zoneinfo DataSource: #{@zoneinfo_dir}"
|
193
|
+
end
|
194
|
+
|
195
|
+
# Returns internal object state as a programmer-readable string.
|
196
|
+
def inspect
|
197
|
+
"#<#{self.class}: #{@zoneinfo_dir}>"
|
198
|
+
end
|
199
|
+
|
200
|
+
private
|
201
|
+
|
202
|
+
# Tests whether a path represents a valid zoneinfo directory (i.e.
|
203
|
+
# is a directory and contains zone.tab and iso3166.tab files).
|
204
|
+
def valid_zoneinfo_dir?(path)
|
205
|
+
File.directory?(path) && File.file?(File.join(path, 'zone.tab')) && File.file?(File.join(path, 'iso3166.tab'))
|
206
|
+
end
|
207
|
+
|
208
|
+
# Unless called before, scans @zoneinfo_dir looking for all the data
|
209
|
+
# and linked zones.
|
210
|
+
def load_timezone_index
|
211
|
+
unless @timezone_index
|
212
|
+
index = []
|
213
|
+
|
214
|
+
enum_timezones(nil, ['localtime', 'posix', 'posixrules', 'right', 'Factory']) do |identifier|
|
215
|
+
index << identifier
|
216
|
+
end
|
217
|
+
|
218
|
+
@timezone_index = index.sort.freeze
|
219
|
+
end
|
220
|
+
end
|
221
|
+
|
222
|
+
# Recursively scans a directory of timezones, populating data_identifiers
|
223
|
+
# and linked_timezones.
|
224
|
+
def enum_timezones(dir, exclude = [], &block)
|
225
|
+
Dir.foreach(dir ? File.join(@zoneinfo_dir, dir) : @zoneinfo_dir) do |entry|
|
226
|
+
unless entry =~ /\./ || exclude.include?(entry)
|
227
|
+
entry.untaint
|
228
|
+
path = dir ? File.join(dir, entry) : entry
|
229
|
+
full_path = File.join(@zoneinfo_dir, path)
|
230
|
+
|
231
|
+
if File.directory?(full_path)
|
232
|
+
enum_timezones(path, [], &block)
|
233
|
+
elsif File.file?(full_path)
|
234
|
+
yield path
|
235
|
+
end
|
236
|
+
end
|
237
|
+
end
|
238
|
+
end
|
239
|
+
|
240
|
+
# Unless called before, uses the iso3166.tab and zone.tab files to build
|
241
|
+
# an index of the available countries and their timezones.
|
242
|
+
def load_country_index
|
243
|
+
unless @country_index
|
244
|
+
zones = {}
|
245
|
+
|
246
|
+
File.open(File.join(@zoneinfo_dir, 'zone.tab')) do |file|
|
247
|
+
file.each_line do |line|
|
248
|
+
line.chomp!
|
249
|
+
|
250
|
+
if line =~ /\A([A-Z]{2})\t(?:([+\-])(\d{2})(\d{2})([+\-])(\d{3})(\d{2})|([+\-])(\d{2})(\d{2})(\d{2})([+\-])(\d{3})(\d{2})(\d{2}))\t([^\t]+)(?:\t([^\t]+))?\z/
|
251
|
+
code = $1
|
252
|
+
|
253
|
+
if $2
|
254
|
+
latitude = dms_to_rational($2, $3, $4)
|
255
|
+
longitude = dms_to_rational($5, $6, $7)
|
256
|
+
else
|
257
|
+
latitude = dms_to_rational($8, $9, $10, $11)
|
258
|
+
longitude = dms_to_rational($12, $13, $14, $15)
|
259
|
+
end
|
260
|
+
|
261
|
+
zone_identifier = $16
|
262
|
+
description = $17
|
263
|
+
|
264
|
+
(zones[code] ||= []) <<
|
265
|
+
CountryTimezone.new(zone_identifier, latitude.numerator, latitude.denominator,
|
266
|
+
longitude.numerator, longitude.denominator, description)
|
267
|
+
end
|
268
|
+
end
|
269
|
+
end
|
270
|
+
|
271
|
+
countries = {}
|
272
|
+
|
273
|
+
File.open(File.join(@zoneinfo_dir, 'iso3166.tab')) do |file|
|
274
|
+
file.each_line do |line|
|
275
|
+
line.chomp!
|
276
|
+
|
277
|
+
if line =~ /\A([A-Z]{2})\t(.+)\z/
|
278
|
+
code = $1
|
279
|
+
name = $2
|
280
|
+
countries[code] = ZoneinfoCountryInfo.new(code, name, zones[code] || [])
|
281
|
+
end
|
282
|
+
end
|
283
|
+
end
|
284
|
+
|
285
|
+
@country_index = countries
|
286
|
+
end
|
287
|
+
end
|
288
|
+
|
289
|
+
# Converts degrees, miunutes and seconds to a Rational
|
290
|
+
def dms_to_rational(sign, degrees, minutes, seconds = nil)
|
291
|
+
result = degrees.to_i + Rational(minutes.to_i, 60)
|
292
|
+
result += Rational(seconds.to_i, 3600) if seconds
|
293
|
+
result = -result if sign == '-'
|
294
|
+
result
|
295
|
+
end
|
296
|
+
end
|
297
|
+
end
|