tzinfo 0.2.2 → 0.3.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.
- data/CHANGES +222 -172
- data/README +21 -4
- data/Rakefile +27 -12
- data/lib/tzinfo.rb +5 -2
- data/lib/tzinfo/country.rb +100 -90
- data/lib/tzinfo/country_index_definition.rb +50 -0
- data/lib/tzinfo/country_info.rb +82 -0
- data/lib/tzinfo/country_timezone.rb +103 -0
- data/lib/tzinfo/data_timezone.rb +47 -0
- data/lib/tzinfo/data_timezone_info.rb +226 -0
- data/lib/tzinfo/definitions/Africa/Abidjan.rb +16 -11
- data/lib/tzinfo/definitions/Africa/Accra.rb +31 -25
- data/lib/tzinfo/definitions/Africa/Addis_Ababa.rb +18 -12
- data/lib/tzinfo/definitions/Africa/Algiers.rb +53 -44
- data/lib/tzinfo/definitions/Africa/Asmera.rb +20 -13
- data/lib/tzinfo/definitions/Africa/Bamako.rb +19 -13
- data/lib/tzinfo/definitions/Africa/Bangui.rb +16 -11
- data/lib/tzinfo/definitions/Africa/Banjul.rb +20 -13
- data/lib/tzinfo/definitions/Africa/Bissau.rb +18 -12
- data/lib/tzinfo/definitions/Africa/Blantyre.rb +16 -11
- data/lib/tzinfo/definitions/Africa/Brazzaville.rb +16 -11
- data/lib/tzinfo/definitions/Africa/Bujumbura.rb +16 -11
- data/lib/tzinfo/definitions/Africa/Cairo.rb +217 -211
- data/lib/tzinfo/definitions/Africa/Casablanca.rb +36 -29
- data/lib/tzinfo/definitions/Africa/Ceuta.rb +170 -162
- data/lib/tzinfo/definitions/Africa/Conakry.rb +19 -13
- data/lib/tzinfo/definitions/Africa/Dakar.rb +18 -12
- data/lib/tzinfo/definitions/Africa/Dar_es_Salaam.rb +19 -13
- data/lib/tzinfo/definitions/Africa/Djibouti.rb +16 -11
- data/lib/tzinfo/definitions/Africa/Douala.rb +16 -11
- data/lib/tzinfo/definitions/Africa/El_Aaiun.rb +18 -12
- data/lib/tzinfo/definitions/Africa/Freetown.rb +51 -41
- data/lib/tzinfo/definitions/Africa/Gaborone.rb +19 -13
- data/lib/tzinfo/definitions/Africa/Harare.rb +16 -11
- data/lib/tzinfo/definitions/Africa/Johannesburg.rb +23 -16
- data/lib/tzinfo/definitions/Africa/Kampala.rb +21 -14
- data/lib/tzinfo/definitions/Africa/Khartoum.rb +51 -44
- data/lib/tzinfo/definitions/Africa/Kigali.rb +16 -11
- data/lib/tzinfo/definitions/Africa/Kinshasa.rb +16 -11
- data/lib/tzinfo/definitions/Africa/Lagos.rb +16 -11
- data/lib/tzinfo/definitions/Africa/Libreville.rb +16 -11
- data/lib/tzinfo/definitions/Africa/Lome.rb +16 -11
- data/lib/tzinfo/definitions/Africa/Luanda.rb +18 -12
- data/lib/tzinfo/definitions/Africa/Lubumbashi.rb +16 -11
- data/lib/tzinfo/definitions/Africa/Lusaka.rb +16 -11
- data/lib/tzinfo/definitions/Africa/Malabo.rb +18 -12
- data/lib/tzinfo/definitions/Africa/Maputo.rb +16 -11
- data/lib/tzinfo/definitions/Africa/Maseru.rb +19 -13
- data/lib/tzinfo/definitions/Africa/Mbabane.rb +16 -11
- data/lib/tzinfo/definitions/Africa/Mogadishu.rb +19 -13
- data/lib/tzinfo/definitions/Africa/Monrovia.rb +20 -13
- data/lib/tzinfo/definitions/Africa/Nairobi.rb +21 -14
- data/lib/tzinfo/definitions/Africa/Ndjamena.rb +19 -13
- data/lib/tzinfo/definitions/Africa/Niamey.rb +20 -13
- data/lib/tzinfo/definitions/Africa/Nouakchott.rb +19 -13
- data/lib/tzinfo/definitions/Africa/Ouagadougou.rb +16 -11
- data/lib/tzinfo/definitions/Africa/Porto__m__Novo.rb +18 -12
- data/lib/tzinfo/definitions/Africa/Sao_Tome.rb +18 -12
- data/lib/tzinfo/definitions/Africa/Timbuktu.rb +11 -10
- data/lib/tzinfo/definitions/Africa/Tripoli.rb +46 -39
- data/lib/tzinfo/definitions/Africa/Tunis.rb +135 -128
- data/lib/tzinfo/definitions/Africa/Windhoek.rb +138 -128
- data/lib/tzinfo/definitions/America/Adak.rb +194 -181
- data/lib/tzinfo/definitions/America/Anchorage.rb +194 -181
- data/lib/tzinfo/definitions/America/Anguilla.rb +16 -11
- data/lib/tzinfo/definitions/America/Antigua.rb +18 -12
- data/lib/tzinfo/definitions/America/Araguaina.rb +65 -59
- data/lib/tzinfo/definitions/America/Argentina/Buenos_Aires.rb +78 -69
- data/lib/tzinfo/definitions/America/Argentina/Catamarca.rb +81 -71
- data/lib/tzinfo/definitions/America/Argentina/ComodRivadavia.rb +13 -12
- data/lib/tzinfo/definitions/America/Argentina/Cordoba.rb +79 -69
- data/lib/tzinfo/definitions/America/Argentina/Jujuy.rb +80 -69
- data/lib/tzinfo/definitions/America/Argentina/La_Rioja.rb +82 -72
- data/lib/tzinfo/definitions/America/Argentina/Mendoza.rb +82 -71
- data/lib/tzinfo/definitions/America/Argentina/Rio_Gallegos.rb +81 -71
- data/lib/tzinfo/definitions/America/Argentina/San_Juan.rb +82 -72
- data/lib/tzinfo/definitions/America/Argentina/Tucuman.rb +81 -71
- data/lib/tzinfo/definitions/America/Argentina/Ushuaia.rb +81 -71
- data/lib/tzinfo/definitions/America/Aruba.rb +18 -12
- data/lib/tzinfo/definitions/America/Asuncion.rb +172 -164
- data/lib/tzinfo/definitions/America/Atka.rb +11 -10
- data/lib/tzinfo/definitions/America/Bahia.rb +75 -69
- data/lib/tzinfo/definitions/America/Barbados.rb +27 -20
- data/lib/tzinfo/definitions/America/Belem.rb +45 -39
- data/lib/tzinfo/definitions/America/Belize.rb +72 -65
- data/lib/tzinfo/definitions/America/Boa_Vista.rb +49 -43
- data/lib/tzinfo/definitions/America/Bogota.rb +21 -14
- data/lib/tzinfo/definitions/America/Boise.rb +197 -187
- data/lib/tzinfo/definitions/America/Buenos_Aires.rb +11 -10
- data/lib/tzinfo/definitions/America/Cambridge_Bay.rb +175 -163
- data/lib/tzinfo/definitions/America/Campo_Grande.rb +169 -163
- data/lib/tzinfo/definitions/America/Cancun.rb +131 -123
- data/lib/tzinfo/definitions/America/Caracas.rb +20 -13
- data/lib/tzinfo/definitions/America/Catamarca.rb +11 -10
- data/lib/tzinfo/definitions/America/Cayenne.rb +18 -12
- data/lib/tzinfo/definitions/America/Cayman.rb +18 -12
- data/lib/tzinfo/definitions/America/Chicago.rb +281 -272
- data/lib/tzinfo/definitions/America/Chihuahua.rb +134 -126
- data/lib/tzinfo/definitions/America/Coral_Harbour.rb +26 -18
- data/lib/tzinfo/definitions/America/Cordoba.rb +11 -10
- data/lib/tzinfo/definitions/America/Costa_Rica.rb +27 -20
- data/lib/tzinfo/definitions/America/Cuiaba.rb +167 -161
- data/lib/tzinfo/definitions/America/Curacao.rb +18 -12
- data/lib/tzinfo/definitions/America/Danmarkshavn.rb +51 -44
- data/lib/tzinfo/definitions/America/Dawson.rb +174 -163
- data/lib/tzinfo/definitions/America/Dawson_Creek.rb +77 -68
- data/lib/tzinfo/definitions/America/Denver.rb +202 -194
- data/lib/tzinfo/definitions/America/Detroit.rb +184 -175
- data/lib/tzinfo/definitions/America/Dominica.rb +16 -11
- data/lib/tzinfo/definitions/America/Edmonton.rb +198 -190
- data/lib/tzinfo/definitions/America/Eirunepe.rb +47 -41
- data/lib/tzinfo/definitions/America/El_Salvador.rb +21 -15
- data/lib/tzinfo/definitions/America/Ensenada.rb +11 -10
- data/lib/tzinfo/definitions/America/Fort_Wayne.rb +11 -10
- data/lib/tzinfo/definitions/America/Fortaleza.rb +55 -49
- data/lib/tzinfo/definitions/America/Glace_Bay.rb +184 -176
- data/lib/tzinfo/definitions/America/Godthab.rb +159 -153
- data/lib/tzinfo/definitions/America/Goose_Bay.rb +253 -240
- data/lib/tzinfo/definitions/America/Grand_Turk.rb +163 -156
- data/lib/tzinfo/definitions/America/Grenada.rb +16 -11
- data/lib/tzinfo/definitions/America/Guadeloupe.rb +16 -11
- data/lib/tzinfo/definitions/America/Guatemala.rb +25 -19
- data/lib/tzinfo/definitions/America/Guayaquil.rb +18 -12
- data/lib/tzinfo/definitions/America/Guyana.rb +22 -14
- data/lib/tzinfo/definitions/America/Halifax.rb +272 -264
- data/lib/tzinfo/definitions/America/Havana.rb +199 -192
- data/lib/tzinfo/definitions/America/Hermosillo.rb +33 -25
- data/lib/tzinfo/definitions/America/Indiana/Indianapolis.rb +147 -137
- data/lib/tzinfo/definitions/America/Indiana/Knox.rb +201 -192
- data/lib/tzinfo/definitions/America/Indiana/Marengo.rb +151 -141
- data/lib/tzinfo/definitions/America/Indiana/Petersburg.rb +163 -154
- data/lib/tzinfo/definitions/America/Indiana/Vevay.rb +129 -119
- data/lib/tzinfo/definitions/America/Indiana/Vincennes.rb +149 -139
- data/lib/tzinfo/definitions/America/Indianapolis.rb +11 -10
- data/lib/tzinfo/definitions/America/Inuvik.rb +174 -163
- data/lib/tzinfo/definitions/America/Iqaluit.rb +173 -162
- data/lib/tzinfo/definitions/America/Jamaica.rb +39 -32
- data/lib/tzinfo/definitions/America/Jujuy.rb +11 -10
- data/lib/tzinfo/definitions/America/Juneau.rb +192 -180
- data/lib/tzinfo/definitions/America/Kentucky/Louisville.rb +226 -216
- data/lib/tzinfo/definitions/America/Kentucky/Monticello.rb +196 -186
- data/lib/tzinfo/definitions/America/Knox_IN.rb +11 -10
- data/lib/tzinfo/definitions/America/La_Paz.rb +20 -13
- data/lib/tzinfo/definitions/America/Lima.rb +33 -26
- data/lib/tzinfo/definitions/America/Los_Angeles.rb +230 -222
- data/lib/tzinfo/definitions/America/Louisville.rb +11 -10
- data/lib/tzinfo/definitions/America/Maceio.rb +57 -51
- data/lib/tzinfo/definitions/America/Managua.rb +34 -26
- data/lib/tzinfo/definitions/America/Manaus.rb +47 -41
- data/lib/tzinfo/definitions/America/Martinique.rb +21 -14
- data/lib/tzinfo/definitions/America/Mazatlan.rb +137 -129
- data/lib/tzinfo/definitions/America/Mendoza.rb +11 -10
- data/lib/tzinfo/definitions/America/Menominee.rb +188 -179
- data/lib/tzinfo/definitions/America/Merida.rb +130 -123
- data/lib/tzinfo/definitions/America/Mexico_City.rb +142 -134
- data/lib/tzinfo/definitions/America/Miquelon.rb +147 -140
- data/lib/tzinfo/definitions/America/Moncton.rb +252 -243
- data/lib/tzinfo/definitions/America/Monterrey.rb +129 -123
- data/lib/tzinfo/definitions/America/Montevideo.rb +89 -79
- data/lib/tzinfo/definitions/America/Montreal.rb +277 -269
- data/lib/tzinfo/definitions/America/Montserrat.rb +16 -11
- data/lib/tzinfo/definitions/America/Nassau.rb +191 -185
- data/lib/tzinfo/definitions/America/New_York.rb +280 -272
- data/lib/tzinfo/definitions/America/Nipigon.rb +179 -171
- data/lib/tzinfo/definitions/America/Nome.rb +194 -181
- data/lib/tzinfo/definitions/America/Noronha.rb +55 -49
- data/lib/tzinfo/definitions/America/North_Dakota/Center.rb +198 -188
- data/lib/tzinfo/definitions/America/North_Dakota/New_Salem.rb +198 -188
- data/lib/tzinfo/definitions/America/Panama.rb +18 -12
- data/lib/tzinfo/definitions/America/Pangnirtung.rb +175 -162
- data/lib/tzinfo/definitions/America/Paramaribo.rb +24 -15
- data/lib/tzinfo/definitions/America/Phoenix.rb +28 -21
- data/lib/tzinfo/definitions/America/Port__m__au__m__Prince.rb +141 -134
- data/lib/tzinfo/definitions/America/Port_of_Spain.rb +16 -11
- data/lib/tzinfo/definitions/America/Porto_Acre.rb +11 -10
- data/lib/tzinfo/definitions/America/Porto_Velho.rb +45 -39
- data/lib/tzinfo/definitions/America/Puerto_Rico.rb +21 -14
- data/lib/tzinfo/definitions/America/Rainy_River.rb +179 -171
- data/lib/tzinfo/definitions/America/Rankin_Inlet.rb +172 -162
- data/lib/tzinfo/definitions/America/Recife.rb +55 -49
- data/lib/tzinfo/definitions/America/Regina.rb +72 -63
- data/lib/tzinfo/definitions/America/Rio_Branco.rb +45 -39
- data/lib/tzinfo/definitions/America/Rosario.rb +11 -10
- data/lib/tzinfo/definitions/America/Santiago.rb +202 -193
- data/lib/tzinfo/definitions/America/Santo_Domingo.rb +36 -27
- data/lib/tzinfo/definitions/America/Sao_Paulo.rb +169 -163
- data/lib/tzinfo/definitions/America/Scoresbysund.rb +161 -153
- data/lib/tzinfo/definitions/America/Shiprock.rb +11 -10
- data/lib/tzinfo/definitions/America/St_Johns.rb +286 -275
- data/lib/tzinfo/definitions/America/St_Kitts.rb +16 -11
- data/lib/tzinfo/definitions/America/St_Lucia.rb +18 -12
- data/lib/tzinfo/definitions/America/St_Thomas.rb +16 -11
- data/lib/tzinfo/definitions/America/St_Vincent.rb +18 -12
- data/lib/tzinfo/definitions/America/Swift_Current.rb +42 -33
- data/lib/tzinfo/definitions/America/Tegucigalpa.rb +23 -17
- data/lib/tzinfo/definitions/America/Thule.rb +137 -131
- data/lib/tzinfo/definitions/America/Thunder_Bay.rb +184 -175
- data/lib/tzinfo/definitions/America/Tijuana.rb +194 -185
- data/lib/tzinfo/definitions/America/Toronto.rb +277 -269
- data/lib/tzinfo/definitions/America/Tortola.rb +16 -11
- data/lib/tzinfo/definitions/America/Vancouver.rb +234 -226
- data/lib/tzinfo/definitions/America/Virgin.rb +11 -10
- data/lib/tzinfo/definitions/America/Whitehorse.rb +174 -163
- data/lib/tzinfo/definitions/America/Winnipeg.rb +230 -222
- data/lib/tzinfo/definitions/America/Yakutat.rb +191 -180
- data/lib/tzinfo/definitions/America/Yellowknife.rb +171 -162
- data/lib/tzinfo/definitions/Antarctica/Casey.rb +16 -11
- data/lib/tzinfo/definitions/Antarctica/Davis.rb +18 -13
- data/lib/tzinfo/definitions/Antarctica/DumontDUrville.rb +19 -13
- data/lib/tzinfo/definitions/Antarctica/Mawson.rb +16 -11
- data/lib/tzinfo/definitions/Antarctica/McMurdo.rb +169 -163
- data/lib/tzinfo/definitions/Antarctica/Palmer.rb +176 -166
- data/lib/tzinfo/definitions/Antarctica/Rothera.rb +16 -11
- data/lib/tzinfo/definitions/Antarctica/South_Pole.rb +11 -10
- data/lib/tzinfo/definitions/Antarctica/Syowa.rb +16 -11
- data/lib/tzinfo/definitions/Antarctica/Vostok.rb +16 -11
- data/lib/tzinfo/definitions/Arctic/Longyearbyen.rb +11 -10
- data/lib/tzinfo/definitions/Asia/Aden.rb +16 -11
- data/lib/tzinfo/definitions/Asia/Almaty.rb +65 -58
- data/lib/tzinfo/definitions/Asia/Amman.rb +161 -155
- data/lib/tzinfo/definitions/Asia/Anadyr.rb +163 -153
- data/lib/tzinfo/definitions/Asia/Aqtau.rb +73 -60
- data/lib/tzinfo/definitions/Asia/Aqtobe.rb +69 -59
- data/lib/tzinfo/definitions/Asia/Ashgabat.rb +46 -36
- data/lib/tzinfo/definitions/Asia/Ashkhabad.rb +11 -10
- data/lib/tzinfo/definitions/Asia/Baghdad.rb +157 -150
- data/lib/tzinfo/definitions/Asia/Bahrain.rb +18 -12
- data/lib/tzinfo/definitions/Asia/Baku.rb +159 -147
- data/lib/tzinfo/definitions/Asia/Bangkok.rb +18 -12
- data/lib/tzinfo/definitions/Asia/Beirut.rb +183 -177
- data/lib/tzinfo/definitions/Asia/Bishkek.rb +73 -62
- data/lib/tzinfo/definitions/Asia/Brunei.rb +18 -12
- data/lib/tzinfo/definitions/Asia/Calcutta.rb +23 -15
- data/lib/tzinfo/definitions/Asia/Choibalsan.rb +152 -144
- data/lib/tzinfo/definitions/Asia/Chongqing.rb +31 -24
- data/lib/tzinfo/definitions/Asia/Chungking.rb +11 -10
- data/lib/tzinfo/definitions/Asia/Colombo.rb +28 -18
- data/lib/tzinfo/definitions/Asia/Dacca.rb +11 -10
- data/lib/tzinfo/definitions/Asia/Damascus.rb +193 -187
- data/lib/tzinfo/definitions/Asia/Dhaka.rb +25 -16
- data/lib/tzinfo/definitions/Asia/Dili.rb +23 -15
- data/lib/tzinfo/definitions/Asia/Dubai.rb +16 -11
- data/lib/tzinfo/definitions/Asia/Dushanbe.rb +43 -34
- data/lib/tzinfo/definitions/Asia/Gaza.rb +189 -180
- data/lib/tzinfo/definitions/Asia/Harbin.rb +35 -27
- data/lib/tzinfo/definitions/Asia/Hong_Kong.rb +85 -79
- data/lib/tzinfo/definitions/Asia/Hovd.rb +151 -144
- data/lib/tzinfo/definitions/Asia/Irkutsk.rb +163 -154
- data/lib/tzinfo/definitions/Asia/Istanbul.rb +11 -10
- data/lib/tzinfo/definitions/Asia/Jakarta.rb +28 -18
- data/lib/tzinfo/definitions/Asia/Jayapura.rb +19 -13
- data/lib/tzinfo/definitions/Asia/Jerusalem.rb +161 -153
- data/lib/tzinfo/definitions/Asia/Kabul.rb +18 -12
- data/lib/tzinfo/definitions/Asia/Kamchatka.rb +161 -153
- data/lib/tzinfo/definitions/Asia/Karachi.rb +26 -17
- data/lib/tzinfo/definitions/Asia/Kashgar.rb +33 -25
- data/lib/tzinfo/definitions/Asia/Katmandu.rb +18 -12
- data/lib/tzinfo/definitions/Asia/Krasnoyarsk.rb +161 -153
- data/lib/tzinfo/definitions/Asia/Kuala_Lumpur.rb +29 -18
- data/lib/tzinfo/definitions/Asia/Kuching.rb +38 -29
- data/lib/tzinfo/definitions/Asia/Kuwait.rb +16 -11
- data/lib/tzinfo/definitions/Asia/Macao.rb +11 -10
- data/lib/tzinfo/definitions/Asia/Macau.rb +59 -52
- data/lib/tzinfo/definitions/Asia/Magadan.rb +161 -153
- data/lib/tzinfo/definitions/Asia/Makassar.rb +21 -14
- data/lib/tzinfo/definitions/Asia/Manila.rb +28 -20
- data/lib/tzinfo/definitions/Asia/Muscat.rb +16 -11
- data/lib/tzinfo/definitions/Asia/Nicosia.rb +169 -163
- data/lib/tzinfo/definitions/Asia/Novosibirsk.rb +162 -154
- data/lib/tzinfo/definitions/Asia/Omsk.rb +161 -153
- data/lib/tzinfo/definitions/Asia/Oral.rb +72 -60
- data/lib/tzinfo/definitions/Asia/Phnom_Penh.rb +21 -14
- data/lib/tzinfo/definitions/Asia/Pontianak.rb +28 -18
- data/lib/tzinfo/definitions/Asia/Pyongyang.rb +23 -16
- data/lib/tzinfo/definitions/Asia/Qatar.rb +18 -12
- data/lib/tzinfo/definitions/Asia/Qyzylorda.rb +71 -60
- data/lib/tzinfo/definitions/Asia/Rangoon.rb +22 -14
- data/lib/tzinfo/definitions/Asia/Riyadh.rb +16 -11
- data/lib/tzinfo/definitions/Asia/Riyadh87.rb +590 -346
- data/lib/tzinfo/definitions/Asia/Riyadh88.rb +580 -347
- data/lib/tzinfo/definitions/Asia/Riyadh89.rb +580 -347
- data/lib/tzinfo/definitions/Asia/Saigon.rb +21 -14
- data/lib/tzinfo/definitions/Asia/Sakhalin.rb +164 -154
- data/lib/tzinfo/definitions/Asia/Samarkand.rb +45 -35
- data/lib/tzinfo/definitions/Asia/Seoul.rb +32 -23
- data/lib/tzinfo/definitions/Asia/Shanghai.rb +33 -27
- data/lib/tzinfo/definitions/Asia/Singapore.rb +31 -19
- data/lib/tzinfo/definitions/Asia/Taipei.rb +57 -51
- data/lib/tzinfo/definitions/Asia/Tashkent.rb +45 -35
- data/lib/tzinfo/definitions/Asia/Tbilisi.rb +76 -63
- data/lib/tzinfo/definitions/Asia/Tehran.rb +59 -50
- data/lib/tzinfo/definitions/Asia/Tel_Aviv.rb +11 -10
- data/lib/tzinfo/definitions/Asia/Thimbu.rb +11 -10
- data/lib/tzinfo/definitions/Asia/Thimphu.rb +18 -12
- data/lib/tzinfo/definitions/Asia/Tokyo.rb +28 -21
- data/lib/tzinfo/definitions/Asia/Ujung_Pandang.rb +11 -10
- data/lib/tzinfo/definitions/Asia/Ulaanbaatar.rb +151 -144
- data/lib/tzinfo/definitions/Asia/Ulan_Bator.rb +11 -10
- data/lib/tzinfo/definitions/Asia/Urumqi.rb +31 -24
- data/lib/tzinfo/definitions/Asia/Vientiane.rb +21 -14
- data/lib/tzinfo/definitions/Asia/Vladivostok.rb +162 -153
- data/lib/tzinfo/definitions/Asia/Yakutsk.rb +161 -153
- data/lib/tzinfo/definitions/Asia/Yekaterinburg.rb +163 -153
- data/lib/tzinfo/definitions/Asia/Yerevan.rb +163 -151
- data/lib/tzinfo/definitions/Atlantic/Azores.rb +268 -257
- data/lib/tzinfo/definitions/Atlantic/Bermuda.rb +171 -165
- data/lib/tzinfo/definitions/Atlantic/Canary.rb +161 -154
- data/lib/tzinfo/definitions/Atlantic/Cape_Verde.rb +21 -14
- data/lib/tzinfo/definitions/Atlantic/Faeroe.rb +157 -151
- data/lib/tzinfo/definitions/Atlantic/Jan_Mayen.rb +11 -10
- data/lib/tzinfo/definitions/Atlantic/Madeira.rb +267 -257
- data/lib/tzinfo/definitions/Atlantic/Reykjavik.rb +83 -75
- data/lib/tzinfo/definitions/Atlantic/South_Georgia.rb +16 -11
- data/lib/tzinfo/definitions/Atlantic/St_Helena.rb +18 -12
- data/lib/tzinfo/definitions/Atlantic/Stanley.rb +168 -159
- data/lib/tzinfo/definitions/Australia/ACT.rb +11 -10
- data/lib/tzinfo/definitions/Australia/Adelaide.rb +185 -178
- data/lib/tzinfo/definitions/Australia/Brisbane.rb +33 -27
- data/lib/tzinfo/definitions/Australia/Broken_Hill.rb +187 -179
- data/lib/tzinfo/definitions/Australia/Canberra.rb +11 -10
- data/lib/tzinfo/definitions/Australia/Currie.rb +183 -177
- data/lib/tzinfo/definitions/Australia/Darwin.rb +27 -20
- data/lib/tzinfo/definitions/Australia/Hobart.rb +191 -185
- data/lib/tzinfo/definitions/Australia/LHI.rb +11 -10
- data/lib/tzinfo/definitions/Australia/Lindeman.rb +37 -31
- data/lib/tzinfo/definitions/Australia/Lord_Howe.rb +158 -150
- data/lib/tzinfo/definitions/Australia/Melbourne.rb +183 -177
- data/lib/tzinfo/definitions/Australia/NSW.rb +11 -10
- data/lib/tzinfo/definitions/Australia/North.rb +11 -10
- data/lib/tzinfo/definitions/Australia/Perth.rb +29 -23
- data/lib/tzinfo/definitions/Australia/Queensland.rb +11 -10
- data/lib/tzinfo/definitions/Australia/South.rb +11 -10
- data/lib/tzinfo/definitions/Australia/Sydney.rb +183 -177
- data/lib/tzinfo/definitions/Australia/Tasmania.rb +11 -10
- data/lib/tzinfo/definitions/Australia/Victoria.rb +11 -10
- data/lib/tzinfo/definitions/Australia/West.rb +11 -10
- data/lib/tzinfo/definitions/Australia/Yancowinna.rb +11 -10
- data/lib/tzinfo/definitions/Brazil/Acre.rb +11 -10
- data/lib/tzinfo/definitions/Brazil/DeNoronha.rb +11 -10
- data/lib/tzinfo/definitions/Brazil/East.rb +11 -10
- data/lib/tzinfo/definitions/Brazil/West.rb +11 -10
- data/lib/tzinfo/definitions/CET.rb +173 -168
- data/lib/tzinfo/definitions/CST6CDT.rb +190 -183
- data/lib/tzinfo/definitions/Canada/Atlantic.rb +11 -10
- data/lib/tzinfo/definitions/Canada/Central.rb +11 -10
- data/lib/tzinfo/definitions/Canada/East__m__Saskatchewan.rb +11 -10
- data/lib/tzinfo/definitions/Canada/Eastern.rb +11 -10
- data/lib/tzinfo/definitions/Canada/Mountain.rb +11 -10
- data/lib/tzinfo/definitions/Canada/Newfoundland.rb +11 -10
- data/lib/tzinfo/definitions/Canada/Pacific.rb +11 -10
- data/lib/tzinfo/definitions/Canada/Saskatchewan.rb +11 -10
- data/lib/tzinfo/definitions/Canada/Yukon.rb +11 -10
- data/lib/tzinfo/definitions/Chile/Continental.rb +11 -10
- data/lib/tzinfo/definitions/Chile/EasterIsland.rb +11 -10
- data/lib/tzinfo/definitions/Cuba.rb +9 -8
- data/lib/tzinfo/definitions/EET.rb +161 -156
- data/lib/tzinfo/definitions/EST.rb +12 -8
- data/lib/tzinfo/definitions/EST5EDT.rb +190 -183
- data/lib/tzinfo/definitions/Egypt.rb +9 -8
- data/lib/tzinfo/definitions/Eire.rb +9 -8
- data/lib/tzinfo/definitions/Etc/GMT.rb +14 -10
- data/lib/tzinfo/definitions/Etc/GMT0.rb +11 -10
- data/lib/tzinfo/definitions/Etc/GMT__m__0.rb +11 -10
- data/lib/tzinfo/definitions/Etc/GMT__m__1.rb +14 -10
- data/lib/tzinfo/definitions/Etc/GMT__m__10.rb +14 -10
- data/lib/tzinfo/definitions/Etc/GMT__m__11.rb +14 -10
- data/lib/tzinfo/definitions/Etc/GMT__m__12.rb +14 -10
- data/lib/tzinfo/definitions/Etc/GMT__m__13.rb +14 -10
- data/lib/tzinfo/definitions/Etc/GMT__m__14.rb +14 -10
- data/lib/tzinfo/definitions/Etc/GMT__m__2.rb +14 -10
- data/lib/tzinfo/definitions/Etc/GMT__m__3.rb +14 -10
- data/lib/tzinfo/definitions/Etc/GMT__m__4.rb +14 -10
- data/lib/tzinfo/definitions/Etc/GMT__m__5.rb +14 -10
- data/lib/tzinfo/definitions/Etc/GMT__m__6.rb +14 -10
- data/lib/tzinfo/definitions/Etc/GMT__m__7.rb +14 -10
- data/lib/tzinfo/definitions/Etc/GMT__m__8.rb +14 -10
- data/lib/tzinfo/definitions/Etc/GMT__m__9.rb +14 -10
- data/lib/tzinfo/definitions/Etc/GMT__p__0.rb +11 -10
- data/lib/tzinfo/definitions/Etc/GMT__p__1.rb +14 -10
- data/lib/tzinfo/definitions/Etc/GMT__p__10.rb +14 -10
- data/lib/tzinfo/definitions/Etc/GMT__p__11.rb +14 -10
- data/lib/tzinfo/definitions/Etc/GMT__p__12.rb +14 -10
- data/lib/tzinfo/definitions/Etc/GMT__p__2.rb +14 -10
- data/lib/tzinfo/definitions/Etc/GMT__p__3.rb +14 -10
- data/lib/tzinfo/definitions/Etc/GMT__p__4.rb +14 -10
- data/lib/tzinfo/definitions/Etc/GMT__p__5.rb +14 -10
- data/lib/tzinfo/definitions/Etc/GMT__p__6.rb +14 -10
- data/lib/tzinfo/definitions/Etc/GMT__p__7.rb +14 -10
- data/lib/tzinfo/definitions/Etc/GMT__p__8.rb +14 -10
- data/lib/tzinfo/definitions/Etc/GMT__p__9.rb +14 -10
- data/lib/tzinfo/definitions/Etc/Greenwich.rb +11 -10
- data/lib/tzinfo/definitions/Etc/UCT.rb +14 -10
- data/lib/tzinfo/definitions/Etc/UTC.rb +14 -10
- data/lib/tzinfo/definitions/Etc/Universal.rb +11 -10
- data/lib/tzinfo/definitions/Etc/Zulu.rb +11 -10
- data/lib/tzinfo/definitions/Europe/Amsterdam.rb +226 -216
- data/lib/tzinfo/definitions/Europe/Andorra.rb +151 -144
- data/lib/tzinfo/definitions/Europe/Athens.rb +183 -174
- data/lib/tzinfo/definitions/Europe/Belfast.rb +11 -10
- data/lib/tzinfo/definitions/Europe/Belgrade.rb +161 -155
- data/lib/tzinfo/definitions/Europe/Berlin.rb +186 -179
- data/lib/tzinfo/definitions/Europe/Bratislava.rb +11 -10
- data/lib/tzinfo/definitions/Europe/Brussels.rb +230 -221
- data/lib/tzinfo/definitions/Europe/Bucharest.rb +179 -172
- data/lib/tzinfo/definitions/Europe/Budapest.rb +195 -189
- data/lib/tzinfo/definitions/Europe/Chisinau.rb +187 -175
- data/lib/tzinfo/definitions/Europe/Copenhagen.rb +177 -170
- data/lib/tzinfo/definitions/Europe/Dublin.rb +274 -263
- data/lib/tzinfo/definitions/Europe/Gibraltar.rb +243 -234
- data/lib/tzinfo/definitions/Europe/Helsinki.rb +161 -154
- data/lib/tzinfo/definitions/Europe/Istanbul.rb +216 -207
- data/lib/tzinfo/definitions/Europe/Kaliningrad.rb +179 -167
- data/lib/tzinfo/definitions/Europe/Kiev.rb +166 -155
- data/lib/tzinfo/definitions/Europe/Lisbon.rb +266 -257
- data/lib/tzinfo/definitions/Europe/Ljubljana.rb +11 -10
- data/lib/tzinfo/definitions/Europe/London.rb +286 -277
- data/lib/tzinfo/definitions/Europe/Luxembourg.rb +229 -219
- data/lib/tzinfo/definitions/Europe/Madrid.rb +209 -200
- data/lib/tzinfo/definitions/Europe/Malta.rb +211 -205
- data/lib/tzinfo/definitions/Europe/Mariehamn.rb +11 -10
- data/lib/tzinfo/definitions/Europe/Minsk.rb +168 -157
- data/lib/tzinfo/definitions/Europe/Monaco.rb +231 -221
- data/lib/tzinfo/definitions/Europe/Moscow.rb +179 -166
- data/lib/tzinfo/definitions/Europe/Nicosia.rb +11 -10
- data/lib/tzinfo/definitions/Europe/Oslo.rb +183 -177
- data/lib/tzinfo/definitions/Europe/Paris.rb +230 -220
- data/lib/tzinfo/definitions/Europe/Prague.rb +185 -178
- data/lib/tzinfo/definitions/Europe/Riga.rb +174 -162
- data/lib/tzinfo/definitions/Europe/Rome.rb +213 -206
- data/lib/tzinfo/definitions/Europe/Samara.rb +164 -153
- data/lib/tzinfo/definitions/Europe/San_Marino.rb +11 -10
- data/lib/tzinfo/definitions/Europe/Sarajevo.rb +11 -10
- data/lib/tzinfo/definitions/Europe/Simferopol.rb +168 -157
- data/lib/tzinfo/definitions/Europe/Skopje.rb +11 -10
- data/lib/tzinfo/definitions/Europe/Sofia.rb +171 -162
- data/lib/tzinfo/definitions/Europe/Stockholm.rb +163 -156
- data/lib/tzinfo/definitions/Europe/Tallinn.rb +170 -159
- data/lib/tzinfo/definitions/Europe/Tirane.rb +175 -169
- data/lib/tzinfo/definitions/Europe/Tiraspol.rb +11 -10
- data/lib/tzinfo/definitions/Europe/Uzhgorod.rb +166 -156
- data/lib/tzinfo/definitions/Europe/Vaduz.rb +157 -151
- data/lib/tzinfo/definitions/Europe/Vatican.rb +11 -10
- data/lib/tzinfo/definitions/Europe/Vienna.rb +181 -175
- data/lib/tzinfo/definitions/Europe/Vilnius.rb +168 -156
- data/lib/tzinfo/definitions/Europe/Warsaw.rb +210 -201
- data/lib/tzinfo/definitions/Europe/Zagreb.rb +11 -10
- data/lib/tzinfo/definitions/Europe/Zaporozhye.rb +169 -158
- data/lib/tzinfo/definitions/Europe/Zurich.rb +165 -158
- data/lib/tzinfo/definitions/GB.rb +9 -8
- data/lib/tzinfo/definitions/GB__m__Eire.rb +9 -8
- data/lib/tzinfo/definitions/GMT.rb +9 -8
- data/lib/tzinfo/definitions/GMT0.rb +9 -8
- data/lib/tzinfo/definitions/GMT__m__0.rb +9 -8
- data/lib/tzinfo/definitions/GMT__p__0.rb +9 -8
- data/lib/tzinfo/definitions/Greenwich.rb +9 -8
- data/lib/tzinfo/definitions/HST.rb +12 -8
- data/lib/tzinfo/definitions/Hongkong.rb +9 -8
- data/lib/tzinfo/definitions/Iceland.rb +9 -8
- data/lib/tzinfo/definitions/Indian/Antananarivo.rb +19 -13
- data/lib/tzinfo/definitions/Indian/Chagos.rb +18 -12
- data/lib/tzinfo/definitions/Indian/Christmas.rb +16 -11
- data/lib/tzinfo/definitions/Indian/Cocos.rb +16 -11
- data/lib/tzinfo/definitions/Indian/Comoro.rb +16 -11
- data/lib/tzinfo/definitions/Indian/Kerguelen.rb +16 -11
- data/lib/tzinfo/definitions/Indian/Mahe.rb +16 -11
- data/lib/tzinfo/definitions/Indian/Maldives.rb +18 -12
- data/lib/tzinfo/definitions/Indian/Mauritius.rb +16 -11
- data/lib/tzinfo/definitions/Indian/Mayotte.rb +16 -11
- data/lib/tzinfo/definitions/Indian/Reunion.rb +16 -11
- data/lib/tzinfo/definitions/Iran.rb +9 -8
- data/lib/tzinfo/definitions/Israel.rb +9 -8
- data/lib/tzinfo/definitions/Jamaica.rb +9 -8
- data/lib/tzinfo/definitions/Japan.rb +9 -8
- data/lib/tzinfo/definitions/Kwajalein.rb +9 -8
- data/lib/tzinfo/definitions/Libya.rb +9 -8
- data/lib/tzinfo/definitions/MET.rb +173 -168
- data/lib/tzinfo/definitions/MST.rb +12 -8
- data/lib/tzinfo/definitions/MST7MDT.rb +190 -183
- data/lib/tzinfo/definitions/Mexico/BajaNorte.rb +11 -10
- data/lib/tzinfo/definitions/Mexico/BajaSur.rb +11 -10
- data/lib/tzinfo/definitions/Mexico/General.rb +11 -10
- data/lib/tzinfo/definitions/Mideast/Riyadh87.rb +11 -10
- data/lib/tzinfo/definitions/Mideast/Riyadh88.rb +11 -10
- data/lib/tzinfo/definitions/Mideast/Riyadh89.rb +11 -10
- data/lib/tzinfo/definitions/NZ.rb +9 -8
- data/lib/tzinfo/definitions/NZ__m__CHAT.rb +9 -8
- data/lib/tzinfo/definitions/Navajo.rb +9 -8
- data/lib/tzinfo/definitions/PRC.rb +9 -8
- data/lib/tzinfo/definitions/PST8PDT.rb +190 -183
- data/lib/tzinfo/definitions/Pacific/Apia.rb +20 -13
- data/lib/tzinfo/definitions/Pacific/Auckland.rb +200 -190
- data/lib/tzinfo/definitions/Pacific/Chatham.rb +169 -163
- data/lib/tzinfo/definitions/Pacific/Easter.rb +189 -180
- data/lib/tzinfo/definitions/Pacific/Efate.rb +37 -31
- data/lib/tzinfo/definitions/Pacific/Enderbury.rb +20 -13
- data/lib/tzinfo/definitions/Pacific/Fakaofo.rb +16 -11
- data/lib/tzinfo/definitions/Pacific/Fiji.rb +21 -15
- data/lib/tzinfo/definitions/Pacific/Funafuti.rb +16 -11
- data/lib/tzinfo/definitions/Pacific/Galapagos.rb +18 -12
- data/lib/tzinfo/definitions/Pacific/Gambier.rb +16 -11
- data/lib/tzinfo/definitions/Pacific/Guadalcanal.rb +16 -11
- data/lib/tzinfo/definitions/Pacific/Guam.rb +20 -13
- data/lib/tzinfo/definitions/Pacific/Honolulu.rb +26 -17
- data/lib/tzinfo/definitions/Pacific/Johnston.rb +14 -10
- data/lib/tzinfo/definitions/Pacific/Kiritimati.rb +20 -13
- data/lib/tzinfo/definitions/Pacific/Kosrae.rb +19 -13
- data/lib/tzinfo/definitions/Pacific/Kwajalein.rb +20 -13
- data/lib/tzinfo/definitions/Pacific/Majuro.rb +18 -12
- data/lib/tzinfo/definitions/Pacific/Marquesas.rb +16 -11
- data/lib/tzinfo/definitions/Pacific/Midway.rb +23 -15
- data/lib/tzinfo/definitions/Pacific/Nauru.rb +21 -14
- data/lib/tzinfo/definitions/Pacific/Niue.rb +20 -13
- data/lib/tzinfo/definitions/Pacific/Norfolk.rb +18 -12
- data/lib/tzinfo/definitions/Pacific/Noumea.rb +23 -17
- data/lib/tzinfo/definitions/Pacific/Pago_Pago.rb +24 -15
- data/lib/tzinfo/definitions/Pacific/Palau.rb +16 -11
- data/lib/tzinfo/definitions/Pacific/Pitcairn.rb +18 -12
- data/lib/tzinfo/definitions/Pacific/Ponape.rb +16 -11
- data/lib/tzinfo/definitions/Pacific/Port_Moresby.rb +18 -12
- data/lib/tzinfo/definitions/Pacific/Rarotonga.rb +44 -37
- data/lib/tzinfo/definitions/Pacific/Saipan.rb +22 -14
- data/lib/tzinfo/definitions/Pacific/Samoa.rb +11 -10
- data/lib/tzinfo/definitions/Pacific/Tahiti.rb +16 -11
- data/lib/tzinfo/definitions/Pacific/Tarawa.rb +16 -11
- data/lib/tzinfo/definitions/Pacific/Tongatapu.rb +25 -18
- data/lib/tzinfo/definitions/Pacific/Truk.rb +16 -11
- data/lib/tzinfo/definitions/Pacific/Wake.rb +16 -11
- data/lib/tzinfo/definitions/Pacific/Wallis.rb +16 -11
- data/lib/tzinfo/definitions/Pacific/Yap.rb +11 -10
- data/lib/tzinfo/definitions/Poland.rb +9 -8
- data/lib/tzinfo/definitions/Portugal.rb +9 -8
- data/lib/tzinfo/definitions/ROC.rb +9 -8
- data/lib/tzinfo/definitions/ROK.rb +9 -8
- data/lib/tzinfo/definitions/Singapore.rb +9 -8
- data/lib/tzinfo/definitions/Turkey.rb +9 -8
- data/lib/tzinfo/definitions/UCT.rb +9 -8
- data/lib/tzinfo/definitions/US/Alaska.rb +11 -10
- data/lib/tzinfo/definitions/US/Aleutian.rb +11 -10
- data/lib/tzinfo/definitions/US/Arizona.rb +11 -10
- data/lib/tzinfo/definitions/US/Central.rb +11 -10
- data/lib/tzinfo/definitions/US/East__m__Indiana.rb +11 -10
- data/lib/tzinfo/definitions/US/Eastern.rb +11 -10
- data/lib/tzinfo/definitions/US/Hawaii.rb +11 -10
- data/lib/tzinfo/definitions/US/Indiana__m__Starke.rb +11 -10
- data/lib/tzinfo/definitions/US/Michigan.rb +11 -10
- data/lib/tzinfo/definitions/US/Mountain.rb +11 -10
- data/lib/tzinfo/definitions/US/Pacific.rb +11 -10
- data/lib/tzinfo/definitions/US/Pacific__m__New.rb +11 -10
- data/lib/tzinfo/definitions/US/Samoa.rb +11 -10
- data/lib/tzinfo/definitions/UTC.rb +9 -8
- data/lib/tzinfo/definitions/Universal.rb +9 -8
- data/lib/tzinfo/definitions/WET.rb +161 -156
- data/lib/tzinfo/definitions/W__m__SU.rb +9 -8
- data/lib/tzinfo/definitions/Zulu.rb +9 -8
- data/lib/tzinfo/indexes/countries.rb +875 -0
- data/lib/tzinfo/indexes/timezones.rb +554 -0
- data/lib/tzinfo/info_timezone.rb +52 -0
- data/lib/tzinfo/linked_timezone.rb +51 -0
- data/lib/tzinfo/linked_timezone_info.rb +44 -0
- data/lib/tzinfo/time_or_datetime.rb +33 -22
- data/lib/tzinfo/timezone.rb +162 -112
- data/lib/tzinfo/timezone_definition.rb +56 -0
- data/lib/tzinfo/timezone_index_definition.rb +72 -0
- data/lib/tzinfo/timezone_info.rb +40 -0
- data/lib/tzinfo/timezone_offset_info.rb +94 -0
- data/lib/tzinfo/timezone_period.rb +110 -53
- data/lib/tzinfo/timezone_proxy.rb +85 -0
- data/lib/tzinfo/timezone_transition_info.rb +127 -0
- data/lib/tzinfo/tzdataparser.rb +261 -203
- data/test/tc_country.rb +63 -38
- data/test/tc_country_index_definition.rb +71 -0
- data/test/tc_country_info.rb +72 -0
- data/test/tc_country_timezone.rb +121 -0
- data/test/tc_data_timezone.rb +69 -0
- data/test/tc_data_timezone_info.rb +282 -0
- data/test/tc_info_timezone.rb +37 -0
- data/test/tc_linked_timezone.rb +97 -0
- data/test/tc_linked_timezone_info.rb +18 -0
- data/test/tc_time_or_datetime.rb +30 -0
- data/test/tc_timezone.rb +536 -319
- data/test/tc_timezone_definition.rb +115 -0
- data/test/tc_timezone_index_definition.rb +75 -0
- data/test/tc_timezone_info.rb +13 -0
- data/test/tc_timezone_offset_info.rb +116 -0
- data/test/tc_timezone_period.rb +298 -78
- data/test/tc_timezone_proxy.rb +23 -13
- data/test/tc_timezone_transition_info.rb +194 -0
- metadata +38 -249
- data/lib/tzinfo/countries/AD.rb +0 -12
- data/lib/tzinfo/countries/AE.rb +0 -12
- data/lib/tzinfo/countries/AF.rb +0 -12
- data/lib/tzinfo/countries/AG.rb +0 -12
- data/lib/tzinfo/countries/AI.rb +0 -12
- data/lib/tzinfo/countries/AL.rb +0 -12
- data/lib/tzinfo/countries/AM.rb +0 -12
- data/lib/tzinfo/countries/AN.rb +0 -12
- data/lib/tzinfo/countries/AO.rb +0 -12
- data/lib/tzinfo/countries/AQ.rb +0 -21
- data/lib/tzinfo/countries/AR.rb +0 -21
- data/lib/tzinfo/countries/AS.rb +0 -12
- data/lib/tzinfo/countries/AT.rb +0 -12
- data/lib/tzinfo/countries/AU.rb +0 -22
- data/lib/tzinfo/countries/AW.rb +0 -12
- data/lib/tzinfo/countries/AX.rb +0 -12
- data/lib/tzinfo/countries/AZ.rb +0 -12
- data/lib/tzinfo/countries/BA.rb +0 -12
- data/lib/tzinfo/countries/BB.rb +0 -12
- data/lib/tzinfo/countries/BD.rb +0 -12
- data/lib/tzinfo/countries/BE.rb +0 -12
- data/lib/tzinfo/countries/BF.rb +0 -12
- data/lib/tzinfo/countries/BG.rb +0 -12
- data/lib/tzinfo/countries/BH.rb +0 -12
- data/lib/tzinfo/countries/BI.rb +0 -12
- data/lib/tzinfo/countries/BJ.rb +0 -12
- data/lib/tzinfo/countries/BM.rb +0 -12
- data/lib/tzinfo/countries/BN.rb +0 -12
- data/lib/tzinfo/countries/BO.rb +0 -12
- data/lib/tzinfo/countries/BR.rb +0 -26
- data/lib/tzinfo/countries/BS.rb +0 -12
- data/lib/tzinfo/countries/BT.rb +0 -12
- data/lib/tzinfo/countries/BV.rb +0 -11
- data/lib/tzinfo/countries/BW.rb +0 -12
- data/lib/tzinfo/countries/BY.rb +0 -12
- data/lib/tzinfo/countries/BZ.rb +0 -12
- data/lib/tzinfo/countries/CA.rb +0 -36
- data/lib/tzinfo/countries/CC.rb +0 -12
- data/lib/tzinfo/countries/CD.rb +0 -13
- data/lib/tzinfo/countries/CF.rb +0 -12
- data/lib/tzinfo/countries/CG.rb +0 -12
- data/lib/tzinfo/countries/CH.rb +0 -12
- data/lib/tzinfo/countries/CI.rb +0 -12
- data/lib/tzinfo/countries/CK.rb +0 -12
- data/lib/tzinfo/countries/CL.rb +0 -13
- data/lib/tzinfo/countries/CM.rb +0 -12
- data/lib/tzinfo/countries/CN.rb +0 -16
- data/lib/tzinfo/countries/CO.rb +0 -12
- data/lib/tzinfo/countries/CR.rb +0 -12
- data/lib/tzinfo/countries/CS.rb +0 -12
- data/lib/tzinfo/countries/CU.rb +0 -12
- data/lib/tzinfo/countries/CV.rb +0 -12
- data/lib/tzinfo/countries/CX.rb +0 -12
- data/lib/tzinfo/countries/CY.rb +0 -12
- data/lib/tzinfo/countries/CZ.rb +0 -12
- data/lib/tzinfo/countries/DE.rb +0 -12
- data/lib/tzinfo/countries/DJ.rb +0 -12
- data/lib/tzinfo/countries/DK.rb +0 -12
- data/lib/tzinfo/countries/DM.rb +0 -12
- data/lib/tzinfo/countries/DO.rb +0 -12
- data/lib/tzinfo/countries/DZ.rb +0 -12
- data/lib/tzinfo/countries/EC.rb +0 -13
- data/lib/tzinfo/countries/EE.rb +0 -12
- data/lib/tzinfo/countries/EG.rb +0 -12
- data/lib/tzinfo/countries/EH.rb +0 -12
- data/lib/tzinfo/countries/ER.rb +0 -12
- data/lib/tzinfo/countries/ES.rb +0 -14
- data/lib/tzinfo/countries/ET.rb +0 -12
- data/lib/tzinfo/countries/FI.rb +0 -12
- data/lib/tzinfo/countries/FJ.rb +0 -12
- data/lib/tzinfo/countries/FK.rb +0 -12
- data/lib/tzinfo/countries/FM.rb +0 -14
- data/lib/tzinfo/countries/FO.rb +0 -12
- data/lib/tzinfo/countries/FR.rb +0 -12
- data/lib/tzinfo/countries/GA.rb +0 -12
- data/lib/tzinfo/countries/GB.rb +0 -12
- data/lib/tzinfo/countries/GD.rb +0 -12
- data/lib/tzinfo/countries/GE.rb +0 -12
- data/lib/tzinfo/countries/GF.rb +0 -12
- data/lib/tzinfo/countries/GH.rb +0 -12
- data/lib/tzinfo/countries/GI.rb +0 -12
- data/lib/tzinfo/countries/GL.rb +0 -15
- data/lib/tzinfo/countries/GM.rb +0 -12
- data/lib/tzinfo/countries/GN.rb +0 -12
- data/lib/tzinfo/countries/GP.rb +0 -12
- data/lib/tzinfo/countries/GQ.rb +0 -12
- data/lib/tzinfo/countries/GR.rb +0 -12
- data/lib/tzinfo/countries/GS.rb +0 -12
- data/lib/tzinfo/countries/GT.rb +0 -12
- data/lib/tzinfo/countries/GU.rb +0 -12
- data/lib/tzinfo/countries/GW.rb +0 -12
- data/lib/tzinfo/countries/GY.rb +0 -12
- data/lib/tzinfo/countries/HK.rb +0 -12
- data/lib/tzinfo/countries/HM.rb +0 -11
- data/lib/tzinfo/countries/HN.rb +0 -12
- data/lib/tzinfo/countries/HR.rb +0 -12
- data/lib/tzinfo/countries/HT.rb +0 -12
- data/lib/tzinfo/countries/HU.rb +0 -12
- data/lib/tzinfo/countries/ID.rb +0 -15
- data/lib/tzinfo/countries/IE.rb +0 -12
- data/lib/tzinfo/countries/IL.rb +0 -12
- data/lib/tzinfo/countries/IN.rb +0 -12
- data/lib/tzinfo/countries/IO.rb +0 -12
- data/lib/tzinfo/countries/IQ.rb +0 -12
- data/lib/tzinfo/countries/IR.rb +0 -12
- data/lib/tzinfo/countries/IS.rb +0 -12
- data/lib/tzinfo/countries/IT.rb +0 -12
- data/lib/tzinfo/countries/Index.rb +0 -253
- data/lib/tzinfo/countries/JM.rb +0 -12
- data/lib/tzinfo/countries/JO.rb +0 -12
- data/lib/tzinfo/countries/JP.rb +0 -12
- data/lib/tzinfo/countries/KE.rb +0 -12
- data/lib/tzinfo/countries/KG.rb +0 -12
- data/lib/tzinfo/countries/KH.rb +0 -12
- data/lib/tzinfo/countries/KI.rb +0 -14
- data/lib/tzinfo/countries/KM.rb +0 -12
- data/lib/tzinfo/countries/KN.rb +0 -12
- data/lib/tzinfo/countries/KP.rb +0 -12
- data/lib/tzinfo/countries/KR.rb +0 -12
- data/lib/tzinfo/countries/KW.rb +0 -12
- data/lib/tzinfo/countries/KY.rb +0 -12
- data/lib/tzinfo/countries/KZ.rb +0 -16
- data/lib/tzinfo/countries/LA.rb +0 -12
- data/lib/tzinfo/countries/LB.rb +0 -12
- data/lib/tzinfo/countries/LC.rb +0 -12
- data/lib/tzinfo/countries/LI.rb +0 -12
- data/lib/tzinfo/countries/LK.rb +0 -12
- data/lib/tzinfo/countries/LR.rb +0 -12
- data/lib/tzinfo/countries/LS.rb +0 -12
- data/lib/tzinfo/countries/LT.rb +0 -12
- data/lib/tzinfo/countries/LU.rb +0 -12
- data/lib/tzinfo/countries/LV.rb +0 -12
- data/lib/tzinfo/countries/LY.rb +0 -12
- data/lib/tzinfo/countries/MA.rb +0 -12
- data/lib/tzinfo/countries/MC.rb +0 -12
- data/lib/tzinfo/countries/MD.rb +0 -12
- data/lib/tzinfo/countries/MG.rb +0 -12
- data/lib/tzinfo/countries/MH.rb +0 -13
- data/lib/tzinfo/countries/MK.rb +0 -12
- data/lib/tzinfo/countries/ML.rb +0 -12
- data/lib/tzinfo/countries/MM.rb +0 -12
- data/lib/tzinfo/countries/MN.rb +0 -14
- data/lib/tzinfo/countries/MO.rb +0 -12
- data/lib/tzinfo/countries/MP.rb +0 -12
- data/lib/tzinfo/countries/MQ.rb +0 -12
- data/lib/tzinfo/countries/MR.rb +0 -12
- data/lib/tzinfo/countries/MS.rb +0 -12
- data/lib/tzinfo/countries/MT.rb +0 -12
- data/lib/tzinfo/countries/MU.rb +0 -12
- data/lib/tzinfo/countries/MV.rb +0 -12
- data/lib/tzinfo/countries/MW.rb +0 -12
- data/lib/tzinfo/countries/MX.rb +0 -19
- data/lib/tzinfo/countries/MY.rb +0 -13
- data/lib/tzinfo/countries/MZ.rb +0 -12
- data/lib/tzinfo/countries/NA.rb +0 -12
- data/lib/tzinfo/countries/NC.rb +0 -12
- data/lib/tzinfo/countries/NE.rb +0 -12
- data/lib/tzinfo/countries/NF.rb +0 -12
- data/lib/tzinfo/countries/NG.rb +0 -12
- data/lib/tzinfo/countries/NI.rb +0 -12
- data/lib/tzinfo/countries/NL.rb +0 -12
- data/lib/tzinfo/countries/NO.rb +0 -12
- data/lib/tzinfo/countries/NP.rb +0 -12
- data/lib/tzinfo/countries/NR.rb +0 -12
- data/lib/tzinfo/countries/NU.rb +0 -12
- data/lib/tzinfo/countries/NZ.rb +0 -13
- data/lib/tzinfo/countries/OM.rb +0 -12
- data/lib/tzinfo/countries/PA.rb +0 -12
- data/lib/tzinfo/countries/PE.rb +0 -12
- data/lib/tzinfo/countries/PF.rb +0 -14
- data/lib/tzinfo/countries/PG.rb +0 -12
- data/lib/tzinfo/countries/PH.rb +0 -12
- data/lib/tzinfo/countries/PK.rb +0 -12
- data/lib/tzinfo/countries/PL.rb +0 -12
- data/lib/tzinfo/countries/PM.rb +0 -12
- data/lib/tzinfo/countries/PN.rb +0 -12
- data/lib/tzinfo/countries/PR.rb +0 -12
- data/lib/tzinfo/countries/PS.rb +0 -12
- data/lib/tzinfo/countries/PT.rb +0 -14
- data/lib/tzinfo/countries/PW.rb +0 -12
- data/lib/tzinfo/countries/PY.rb +0 -12
- data/lib/tzinfo/countries/QA.rb +0 -12
- data/lib/tzinfo/countries/RE.rb +0 -12
- data/lib/tzinfo/countries/RO.rb +0 -12
- data/lib/tzinfo/countries/RU.rb +0 -25
- data/lib/tzinfo/countries/RW.rb +0 -12
- data/lib/tzinfo/countries/SA.rb +0 -12
- data/lib/tzinfo/countries/SB.rb +0 -12
- data/lib/tzinfo/countries/SC.rb +0 -12
- data/lib/tzinfo/countries/SD.rb +0 -12
- data/lib/tzinfo/countries/SE.rb +0 -12
- data/lib/tzinfo/countries/SG.rb +0 -12
- data/lib/tzinfo/countries/SH.rb +0 -12
- data/lib/tzinfo/countries/SI.rb +0 -12
- data/lib/tzinfo/countries/SJ.rb +0 -13
- data/lib/tzinfo/countries/SK.rb +0 -12
- data/lib/tzinfo/countries/SL.rb +0 -12
- data/lib/tzinfo/countries/SM.rb +0 -12
- data/lib/tzinfo/countries/SN.rb +0 -12
- data/lib/tzinfo/countries/SO.rb +0 -12
- data/lib/tzinfo/countries/SR.rb +0 -12
- data/lib/tzinfo/countries/ST.rb +0 -12
- data/lib/tzinfo/countries/SV.rb +0 -12
- data/lib/tzinfo/countries/SY.rb +0 -12
- data/lib/tzinfo/countries/SZ.rb +0 -12
- data/lib/tzinfo/countries/TC.rb +0 -12
- data/lib/tzinfo/countries/TD.rb +0 -12
- data/lib/tzinfo/countries/TF.rb +0 -12
- data/lib/tzinfo/countries/TG.rb +0 -12
- data/lib/tzinfo/countries/TH.rb +0 -12
- data/lib/tzinfo/countries/TJ.rb +0 -12
- data/lib/tzinfo/countries/TK.rb +0 -12
- data/lib/tzinfo/countries/TL.rb +0 -12
- data/lib/tzinfo/countries/TM.rb +0 -12
- data/lib/tzinfo/countries/TN.rb +0 -12
- data/lib/tzinfo/countries/TO.rb +0 -12
- data/lib/tzinfo/countries/TR.rb +0 -12
- data/lib/tzinfo/countries/TT.rb +0 -12
- data/lib/tzinfo/countries/TV.rb +0 -12
- data/lib/tzinfo/countries/TW.rb +0 -12
- data/lib/tzinfo/countries/TZ.rb +0 -12
- data/lib/tzinfo/countries/UA.rb +0 -15
- data/lib/tzinfo/countries/UG.rb +0 -12
- data/lib/tzinfo/countries/UM.rb +0 -14
- data/lib/tzinfo/countries/US.rb +0 -36
- data/lib/tzinfo/countries/UY.rb +0 -12
- data/lib/tzinfo/countries/UZ.rb +0 -13
- data/lib/tzinfo/countries/VA.rb +0 -12
- data/lib/tzinfo/countries/VC.rb +0 -12
- data/lib/tzinfo/countries/VE.rb +0 -12
- data/lib/tzinfo/countries/VG.rb +0 -12
- data/lib/tzinfo/countries/VI.rb +0 -12
- data/lib/tzinfo/countries/VN.rb +0 -12
- data/lib/tzinfo/countries/VU.rb +0 -12
- data/lib/tzinfo/countries/WF.rb +0 -12
- data/lib/tzinfo/countries/WS.rb +0 -12
- data/lib/tzinfo/countries/YE.rb +0 -12
- data/lib/tzinfo/countries/YT.rb +0 -12
- data/lib/tzinfo/countries/ZA.rb +0 -12
- data/lib/tzinfo/countries/ZM.rb +0 -12
- data/lib/tzinfo/countries/ZW.rb +0 -12
- data/lib/tzinfo/timezone_period_list.rb +0 -234
- data/test/tc_timezone_period_list.rb +0 -310
@@ -0,0 +1,115 @@
|
|
1
|
+
$:.unshift File.join(File.dirname(__FILE__), "..", "lib")
|
2
|
+
require 'test/unit'
|
3
|
+
require 'tzinfo/timezone_definition'
|
4
|
+
|
5
|
+
include TZInfo
|
6
|
+
|
7
|
+
class TCTimezoneDefinition < Test::Unit::TestCase
|
8
|
+
|
9
|
+
module DataTest
|
10
|
+
include TimezoneDefinition
|
11
|
+
|
12
|
+
timezone 'Test/Data/Zone' do |tz|
|
13
|
+
tz.offset :o0, -75, 0, :LMT
|
14
|
+
tz.offset :o1, 0, 0, :GMT
|
15
|
+
|
16
|
+
tz.transition 1847, 12, :o1, 2760187969, 1152
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
20
|
+
module LinkedTest
|
21
|
+
include TimezoneDefinition
|
22
|
+
|
23
|
+
linked_timezone 'Test/Linked/Zone', 'Test/Linked_To/Zone'
|
24
|
+
end
|
25
|
+
|
26
|
+
module DoubleDataTest
|
27
|
+
include TimezoneDefinition
|
28
|
+
|
29
|
+
timezone 'Test/Data/Zone1' do |tz|
|
30
|
+
tz.offset :o0, -75, 0, :LMT
|
31
|
+
tz.offset :o1, 0, 0, :GMT
|
32
|
+
|
33
|
+
tz.transition 1847, 12, :o1, 2760187969, 1152
|
34
|
+
end
|
35
|
+
|
36
|
+
timezone 'Test/Data/Zone2' do |tz|
|
37
|
+
tz.offset :o0, 75, 0, :LMT
|
38
|
+
tz.offset :o1, 0, 0, :GMT
|
39
|
+
|
40
|
+
tz.transition 1847, 12, :o1, 2760187969, 1152
|
41
|
+
end
|
42
|
+
end
|
43
|
+
|
44
|
+
module DoubleLinkedTest
|
45
|
+
include TimezoneDefinition
|
46
|
+
|
47
|
+
linked_timezone 'Test/Linked/Zone1', 'Test/Linked_To/Zone1'
|
48
|
+
linked_timezone 'Test/Linked/Zone2', 'Test/Linked_To/Zone2'
|
49
|
+
end
|
50
|
+
|
51
|
+
module DataLinkedTest
|
52
|
+
include TimezoneDefinition
|
53
|
+
|
54
|
+
timezone 'Test/Data/Zone1' do |tz|
|
55
|
+
tz.offset :o0, -75, 0, :LMT
|
56
|
+
tz.offset :o1, 0, 0, :GMT
|
57
|
+
|
58
|
+
tz.transition 1847, 12, :o1, 2760187969, 1152
|
59
|
+
end
|
60
|
+
|
61
|
+
linked_timezone 'Test/Linked/Zone2', 'Test/Linked_To/Zone2'
|
62
|
+
end
|
63
|
+
|
64
|
+
module LinkedDataTest
|
65
|
+
include TimezoneDefinition
|
66
|
+
|
67
|
+
linked_timezone 'Test/Linked/Zone1', 'Test/Linked_To/Zone1'
|
68
|
+
|
69
|
+
timezone 'Test/Data/Zone2' do |tz|
|
70
|
+
tz.offset :o0, -75, 0, :LMT
|
71
|
+
tz.offset :o1, 0, 0, :GMT
|
72
|
+
|
73
|
+
tz.transition 1847, 12, :o1, 2760187969, 1152
|
74
|
+
end
|
75
|
+
end
|
76
|
+
|
77
|
+
def test_data
|
78
|
+
assert_kind_of(DataTimezoneInfo, DataTest.get)
|
79
|
+
assert_equal('Test/Data/Zone', DataTest.get.identifier)
|
80
|
+
assert_equal(:LMT, DataTest.get.period_for_utc(DateTime.new(1847,12,1,0,1,14)).abbreviation)
|
81
|
+
assert_equal(:GMT, DataTest.get.period_for_utc(DateTime.new(1847,12,1,0,1,15)).abbreviation)
|
82
|
+
end
|
83
|
+
|
84
|
+
def test_linked
|
85
|
+
assert_kind_of(LinkedTimezoneInfo, LinkedTest.get)
|
86
|
+
assert_equal('Test/Linked/Zone', LinkedTest.get.identifier)
|
87
|
+
assert_equal('Test/Linked_To/Zone', LinkedTest.get.link_to_identifier)
|
88
|
+
end
|
89
|
+
|
90
|
+
def test_double_data
|
91
|
+
assert_kind_of(DataTimezoneInfo, DoubleDataTest.get)
|
92
|
+
assert_equal('Test/Data/Zone2', DoubleDataTest.get.identifier)
|
93
|
+
assert_equal(:LMT, DoubleDataTest.get.period_for_utc(DateTime.new(1847,12,1,0,1,14)).abbreviation)
|
94
|
+
assert_equal(:GMT, DoubleDataTest.get.period_for_utc(DateTime.new(1847,12,1,0,1,15)).abbreviation)
|
95
|
+
end
|
96
|
+
|
97
|
+
def test_double_linked
|
98
|
+
assert_kind_of(LinkedTimezoneInfo, DoubleLinkedTest.get)
|
99
|
+
assert_equal('Test/Linked/Zone2', DoubleLinkedTest.get.identifier)
|
100
|
+
assert_equal('Test/Linked_To/Zone2', DoubleLinkedTest.get.link_to_identifier)
|
101
|
+
end
|
102
|
+
|
103
|
+
def test_data_linked
|
104
|
+
assert_kind_of(LinkedTimezoneInfo, DataLinkedTest.get)
|
105
|
+
assert_equal('Test/Linked/Zone2', DataLinkedTest.get.identifier)
|
106
|
+
assert_equal('Test/Linked_To/Zone2', DataLinkedTest.get.link_to_identifier)
|
107
|
+
end
|
108
|
+
|
109
|
+
def test_linked_data
|
110
|
+
assert_kind_of(DataTimezoneInfo, LinkedDataTest.get)
|
111
|
+
assert_equal('Test/Data/Zone2', LinkedDataTest.get.identifier)
|
112
|
+
assert_equal(:LMT, LinkedDataTest.get.period_for_utc(DateTime.new(1847,12,1,0,1,14)).abbreviation)
|
113
|
+
assert_equal(:GMT, LinkedDataTest.get.period_for_utc(DateTime.new(1847,12,1,0,1,15)).abbreviation)
|
114
|
+
end
|
115
|
+
end
|
@@ -0,0 +1,75 @@
|
|
1
|
+
$:.unshift File.join(File.dirname(__FILE__), "..", "lib")
|
2
|
+
require 'test/unit'
|
3
|
+
require 'tzinfo/timezone_index_definition'
|
4
|
+
|
5
|
+
include TZInfo
|
6
|
+
|
7
|
+
class TCTimezoneIndexDefinition < Test::Unit::TestCase
|
8
|
+
|
9
|
+
module TimezonesTest1
|
10
|
+
include TimezoneIndexDefinition
|
11
|
+
|
12
|
+
timezone 'Test/One'
|
13
|
+
timezone 'Test/Two'
|
14
|
+
linked_timezone 'Test/Three'
|
15
|
+
timezone 'Another/Zone'
|
16
|
+
linked_timezone 'And/Yet/Another'
|
17
|
+
end
|
18
|
+
|
19
|
+
module TimezonesTest2
|
20
|
+
include TimezoneIndexDefinition
|
21
|
+
|
22
|
+
timezone 'Test/A/One'
|
23
|
+
timezone 'Test/A/Two'
|
24
|
+
timezone 'Test/A/Three'
|
25
|
+
end
|
26
|
+
|
27
|
+
module TimezonesTest3
|
28
|
+
include TimezoneIndexDefinition
|
29
|
+
|
30
|
+
linked_timezone 'Test/B/One'
|
31
|
+
linked_timezone 'Test/B/Two'
|
32
|
+
linked_timezone 'Test/B/Three'
|
33
|
+
end
|
34
|
+
|
35
|
+
module TimezonesTest4
|
36
|
+
include TimezoneIndexDefinition
|
37
|
+
|
38
|
+
end
|
39
|
+
|
40
|
+
def test_timezones
|
41
|
+
assert_equal(['Test/One', 'Test/Two', 'Test/Three', 'Another/Zone', 'And/Yet/Another'], TimezonesTest1.timezones)
|
42
|
+
assert_equal(['Test/A/One', 'Test/A/Two', 'Test/A/Three'], TimezonesTest2.timezones)
|
43
|
+
assert_equal(['Test/B/One', 'Test/B/Two', 'Test/B/Three'], TimezonesTest3.timezones)
|
44
|
+
assert_equal([], TimezonesTest4.timezones)
|
45
|
+
|
46
|
+
assert_equal(true, TimezonesTest1.timezones.frozen?)
|
47
|
+
assert_equal(true, TimezonesTest2.timezones.frozen?)
|
48
|
+
assert_equal(true, TimezonesTest3.timezones.frozen?)
|
49
|
+
assert_equal(true, TimezonesTest4.timezones.frozen?)
|
50
|
+
end
|
51
|
+
|
52
|
+
def test_data_timezones
|
53
|
+
assert_equal(['Test/One', 'Test/Two', 'Another/Zone'], TimezonesTest1.data_timezones)
|
54
|
+
assert_equal(['Test/A/One', 'Test/A/Two', 'Test/A/Three'], TimezonesTest2.data_timezones)
|
55
|
+
assert_equal([], TimezonesTest3.data_timezones)
|
56
|
+
assert_equal([], TimezonesTest4.data_timezones)
|
57
|
+
|
58
|
+
assert_equal(true, TimezonesTest1.data_timezones.frozen?)
|
59
|
+
assert_equal(true, TimezonesTest2.data_timezones.frozen?)
|
60
|
+
assert_equal(true, TimezonesTest3.data_timezones.frozen?)
|
61
|
+
assert_equal(true, TimezonesTest4.data_timezones.frozen?)
|
62
|
+
end
|
63
|
+
|
64
|
+
def test_linked_timezones
|
65
|
+
assert_equal(['Test/Three', 'And/Yet/Another'], TimezonesTest1.linked_timezones)
|
66
|
+
assert_equal([], TimezonesTest2.linked_timezones)
|
67
|
+
assert_equal(['Test/B/One', 'Test/B/Two', 'Test/B/Three'], TimezonesTest3.linked_timezones)
|
68
|
+
assert_equal([], TimezonesTest4.linked_timezones)
|
69
|
+
|
70
|
+
assert_equal(true, TimezonesTest1.linked_timezones.frozen?)
|
71
|
+
assert_equal(true, TimezonesTest2.linked_timezones.frozen?)
|
72
|
+
assert_equal(true, TimezonesTest3.linked_timezones.frozen?)
|
73
|
+
assert_equal(true, TimezonesTest4.linked_timezones.frozen?)
|
74
|
+
end
|
75
|
+
end
|
@@ -0,0 +1,13 @@
|
|
1
|
+
$:.unshift File.join(File.dirname(__FILE__), "..", "lib")
|
2
|
+
require 'test/unit'
|
3
|
+
require 'tzinfo/timezone_info'
|
4
|
+
|
5
|
+
include TZInfo
|
6
|
+
|
7
|
+
class TCTimezoneInfo < Test::Unit::TestCase
|
8
|
+
|
9
|
+
def test_identifier
|
10
|
+
ti = TimezoneInfo.new('Test/Zone')
|
11
|
+
assert_equal('Test/Zone', ti.identifier)
|
12
|
+
end
|
13
|
+
end
|
@@ -0,0 +1,116 @@
|
|
1
|
+
$:.unshift File.join(File.dirname(__FILE__), "..", "lib")
|
2
|
+
require 'test/unit'
|
3
|
+
require 'tzinfo/timezone_offset_info'
|
4
|
+
|
5
|
+
include TZInfo
|
6
|
+
|
7
|
+
class TCTimezoneOffsetInfo < Test::Unit::TestCase
|
8
|
+
|
9
|
+
def test_utc_offset
|
10
|
+
o1 = TimezoneOffsetInfo.new(18000, 0, :TEST)
|
11
|
+
o2 = TimezoneOffsetInfo.new(-3600, 3600, :TEST2)
|
12
|
+
|
13
|
+
assert_equal(18000, o1.utc_offset)
|
14
|
+
assert_equal(-3600, o2.utc_offset)
|
15
|
+
end
|
16
|
+
|
17
|
+
def test_std_offset
|
18
|
+
o1 = TimezoneOffsetInfo.new(18000, 0, :TEST)
|
19
|
+
o2 = TimezoneOffsetInfo.new(-3600, 3600, :TEST2)
|
20
|
+
|
21
|
+
assert_equal(0, o1.std_offset)
|
22
|
+
assert_equal(3600, o2.std_offset)
|
23
|
+
end
|
24
|
+
|
25
|
+
def test_utc_total_offset
|
26
|
+
o1 = TimezoneOffsetInfo.new(18000, 0, :TEST)
|
27
|
+
o2 = TimezoneOffsetInfo.new(-3600, 3600, :TEST2)
|
28
|
+
|
29
|
+
assert_equal(18000, o1.utc_total_offset)
|
30
|
+
assert_equal(0, o2.utc_total_offset)
|
31
|
+
end
|
32
|
+
|
33
|
+
def test_abbreviation
|
34
|
+
o1 = TimezoneOffsetInfo.new(18000, 0, :TEST)
|
35
|
+
o2 = TimezoneOffsetInfo.new(-3600, 3600, :TEST2)
|
36
|
+
|
37
|
+
assert_equal(:TEST, o1.abbreviation)
|
38
|
+
assert_equal(:TEST2, o2.abbreviation)
|
39
|
+
end
|
40
|
+
|
41
|
+
def test_dst
|
42
|
+
o1 = TimezoneOffsetInfo.new(18000, 0, :TEST)
|
43
|
+
o2 = TimezoneOffsetInfo.new(-3600, 3600, :TEST2)
|
44
|
+
|
45
|
+
assert_equal(false, o1.dst?)
|
46
|
+
assert_equal(true, o2.dst?)
|
47
|
+
end
|
48
|
+
|
49
|
+
def test_to_local
|
50
|
+
o1 = TimezoneOffsetInfo.new(18000, 0, :TEST)
|
51
|
+
o2 = TimezoneOffsetInfo.new(-3600, 3600, :TEST2)
|
52
|
+
|
53
|
+
assert_equal(1148949080, o1.to_local(1148931080))
|
54
|
+
assert_equal(Time.utc(2006, 5, 30, 0, 31, 20), o1.to_local(Time.utc(2006, 5, 29, 19, 31, 20)))
|
55
|
+
assert_equal(DateTime.new(2006, 5, 30, 0, 31, 20), o1.to_local(DateTime.new(2006, 5, 29, 19, 31, 20)))
|
56
|
+
assert(TimeOrDateTime.new(1148949080).eql?(o1.to_local(TimeOrDateTime.new(1148931080))))
|
57
|
+
|
58
|
+
assert_equal(1148931080, o2.to_local(1148931080))
|
59
|
+
assert_equal(Time.utc(2006, 5, 29, 19, 31, 20), o2.to_local(Time.utc(2006, 5, 29, 19, 31, 20)))
|
60
|
+
assert_equal(DateTime.new(2006, 5, 29, 19, 31, 20), o2.to_local(DateTime.new(2006, 5, 29, 19, 31, 20)))
|
61
|
+
assert(TimeOrDateTime.new(1148931080).eql?(o2.to_local(TimeOrDateTime.new(1148931080))))
|
62
|
+
end
|
63
|
+
|
64
|
+
def test_to_utc
|
65
|
+
o1 = TimezoneOffsetInfo.new(18000, 0, :TEST)
|
66
|
+
o2 = TimezoneOffsetInfo.new(-3600, 3600, :TEST2)
|
67
|
+
|
68
|
+
assert_equal(1148913080, o1.to_utc(1148931080))
|
69
|
+
assert_equal(Time.utc(2006, 5, 29, 14, 31, 20), o1.to_utc(Time.utc(2006, 5, 29, 19, 31, 20)))
|
70
|
+
assert_equal(DateTime.new(2006, 5, 29, 14, 31, 20), o1.to_utc(DateTime.new(2006, 5, 29, 19, 31, 20)))
|
71
|
+
assert(TimeOrDateTime.new(1148913080).eql?(o1.to_utc(TimeOrDateTime.new(1148931080))))
|
72
|
+
|
73
|
+
assert_equal(1148931080, o2.to_local(1148931080))
|
74
|
+
assert_equal(Time.utc(2006, 5, 29, 19, 31, 20), o2.to_local(Time.utc(2006, 5, 29, 19, 31, 20)))
|
75
|
+
assert_equal(DateTime.new(2006, 5, 29, 19, 31, 20), o2.to_local(DateTime.new(2006, 5, 29, 19, 31, 20)))
|
76
|
+
assert(TimeOrDateTime.new(1148931080).eql?(o2.to_local(TimeOrDateTime.new(1148931080))))
|
77
|
+
end
|
78
|
+
|
79
|
+
def test_equality
|
80
|
+
o1 = TimezoneOffsetInfo.new(18000, 0, :TEST)
|
81
|
+
o2 = TimezoneOffsetInfo.new(18000, 0, :TEST)
|
82
|
+
o3 = TimezoneOffsetInfo.new(18001, 0, :TEST)
|
83
|
+
o4 = TimezoneOffsetInfo.new(18000, 1, :TEST)
|
84
|
+
o5 = TimezoneOffsetInfo.new(18000, 0, :TEST2)
|
85
|
+
|
86
|
+
assert_equal(true, o1 == o1)
|
87
|
+
assert_equal(true, o1 == o2)
|
88
|
+
assert_equal(false, o1 == o3)
|
89
|
+
assert_equal(false, o1 == o4)
|
90
|
+
assert_equal(false, o1 == o5)
|
91
|
+
assert_equal(false, o1 == Object.new)
|
92
|
+
end
|
93
|
+
|
94
|
+
def test_eql
|
95
|
+
o1 = TimezoneOffsetInfo.new(18000, 0, :TEST)
|
96
|
+
o2 = TimezoneOffsetInfo.new(18000, 0, :TEST)
|
97
|
+
o3 = TimezoneOffsetInfo.new(18001, 0, :TEST)
|
98
|
+
o4 = TimezoneOffsetInfo.new(18000, 1, :TEST)
|
99
|
+
o5 = TimezoneOffsetInfo.new(18000, 0, :TEST2)
|
100
|
+
|
101
|
+
assert_equal(true, o1.eql?(o1))
|
102
|
+
assert_equal(true, o1.eql?(o2))
|
103
|
+
assert_equal(false, o1.eql?(o3))
|
104
|
+
assert_equal(false, o1.eql?(o4))
|
105
|
+
assert_equal(false, o1.eql?(o5))
|
106
|
+
assert_equal(false, o1.eql?(Object.new))
|
107
|
+
end
|
108
|
+
|
109
|
+
def test_hash
|
110
|
+
o1 = TimezoneOffsetInfo.new(18000, 0, :TEST)
|
111
|
+
o2 = TimezoneOffsetInfo.new(-3600, 3600, :TEST2)
|
112
|
+
|
113
|
+
assert_equal(18000.hash ^ 0.hash ^ :TEST.hash, o1.hash)
|
114
|
+
assert_equal(-3600.hash ^ 3600.hash ^ :TEST2.hash, o2.hash)
|
115
|
+
end
|
116
|
+
end
|
data/test/tc_timezone_period.rb
CHANGED
@@ -1,84 +1,138 @@
|
|
1
1
|
$:.unshift File.join(File.dirname(__FILE__), "..", "lib")
|
2
2
|
require 'test/unit'
|
3
3
|
require 'tzinfo/timezone_period'
|
4
|
+
require 'tzinfo/timezone_offset_info'
|
5
|
+
require 'tzinfo/timezone_transition_info'
|
4
6
|
|
5
7
|
include TZInfo
|
6
8
|
|
7
9
|
class TCTimezonePeriod < Test::Unit::TestCase
|
8
|
-
def test_initialize_datetime
|
9
|
-
p = TimezonePeriod.new(DateTime.new(2005,1,1,0,0,0), DateTime.new(2005,1,2,0,0,0), -7200, 3600, :TEST)
|
10
|
-
|
11
|
-
assert_equal(DateTime.new(2005,1,1,0,0,0), p.utc_start)
|
12
|
-
assert_equal(DateTime.new(2005,1,2,0,0,0), p.utc_end)
|
13
|
-
assert_equal(-7200, p.utc_offset)
|
14
|
-
assert_equal(3600, p.std_offset)
|
15
|
-
assert_equal(:TEST, p.zone_identifier)
|
16
|
-
assert_equal(:TEST, p.abbreviation)
|
17
|
-
assert_equal(DateTime.new(2004,12,31,23,0,0), p.local_start)
|
18
|
-
assert_equal(DateTime.new(2005,1,1,23,0,0), p.local_end)
|
19
|
-
end
|
20
10
|
|
21
|
-
def
|
22
|
-
|
11
|
+
def test_initialize_start_end
|
12
|
+
std = TimezoneOffsetInfo.new(-7200, 0, :TEST)
|
13
|
+
dst = TimezoneOffsetInfo.new(-7200, 3600, :TEST)
|
14
|
+
start_t = TimezoneTransitionInfo.new(dst, std, 1136073600)
|
15
|
+
end_t = TimezoneTransitionInfo.new(std, dst, 1136160000)
|
16
|
+
|
17
|
+
p = TimezonePeriod.new(start_t, end_t)
|
23
18
|
|
24
|
-
assert_equal(
|
25
|
-
assert_equal(
|
19
|
+
assert_equal(start_t, p.start_transition)
|
20
|
+
assert_equal(end_t, p.end_transition)
|
21
|
+
assert_equal(dst, p.offset)
|
22
|
+
assert_equal(DateTime.new(2006,1,1,0,0,0), p.utc_start)
|
23
|
+
assert_equal(DateTime.new(2006,1,2,0,0,0), p.utc_end)
|
26
24
|
assert_equal(-7200, p.utc_offset)
|
27
25
|
assert_equal(3600, p.std_offset)
|
26
|
+
assert_equal(-3600, p.utc_total_offset)
|
27
|
+
assert_equal(Rational(-3600, 86400), p.utc_total_offset_rational)
|
28
28
|
assert_equal(:TEST, p.zone_identifier)
|
29
29
|
assert_equal(:TEST, p.abbreviation)
|
30
|
-
assert_equal(DateTime.new(
|
31
|
-
assert_equal(DateTime.new(
|
30
|
+
assert_equal(DateTime.new(2005,12,31,23,0,0), p.local_start)
|
31
|
+
assert_equal(DateTime.new(2006,1,1,23,0,0), p.local_end)
|
32
32
|
end
|
33
33
|
|
34
|
-
def
|
35
|
-
|
34
|
+
def test_initialize_start_end_offset
|
35
|
+
std = TimezoneOffsetInfo.new(-7200, 0, :TEST)
|
36
|
+
dst = TimezoneOffsetInfo.new(-7200, 3600, :TEST)
|
37
|
+
special = TimezoneOffsetInfo.new(0, 0, :SPECIAL)
|
38
|
+
start_t = TimezoneTransitionInfo.new(dst, std, 1136073600)
|
39
|
+
end_t = TimezoneTransitionInfo.new(std, dst, 1136160000)
|
40
|
+
|
41
|
+
assert_raise(ArgumentError) { TimezonePeriod.new(start_t, end_t, special) }
|
42
|
+
end
|
43
|
+
|
44
|
+
def test_initialize_start
|
45
|
+
std = TimezoneOffsetInfo.new(-7200, 0, :TEST)
|
46
|
+
dst = TimezoneOffsetInfo.new(-7200, 3600, :TEST)
|
47
|
+
start_t = TimezoneTransitionInfo.new(dst, std, 1136073600)
|
48
|
+
|
49
|
+
p = TimezonePeriod.new(start_t, nil)
|
36
50
|
|
37
|
-
assert_equal(
|
38
|
-
|
51
|
+
assert_equal(start_t, p.start_transition)
|
52
|
+
assert_nil(p.end_transition)
|
53
|
+
assert_equal(dst, p.offset)
|
54
|
+
assert_equal(DateTime.new(2006,1,1,0,0,0), p.utc_start)
|
55
|
+
assert_nil(p.utc_end)
|
39
56
|
assert_equal(-7200, p.utc_offset)
|
40
57
|
assert_equal(3600, p.std_offset)
|
58
|
+
assert_equal(-3600, p.utc_total_offset)
|
59
|
+
assert_equal(Rational(-3600, 86400), p.utc_total_offset_rational)
|
41
60
|
assert_equal(:TEST, p.zone_identifier)
|
42
61
|
assert_equal(:TEST, p.abbreviation)
|
43
|
-
assert_equal(DateTime.new(
|
44
|
-
|
62
|
+
assert_equal(DateTime.new(2005,12,31,23,0,0), p.local_start)
|
63
|
+
assert_nil(p.local_end)
|
45
64
|
end
|
46
65
|
|
47
|
-
def
|
48
|
-
|
66
|
+
def test_initialize_start_offset
|
67
|
+
std = TimezoneOffsetInfo.new(-7200, 0, :TEST)
|
68
|
+
dst = TimezoneOffsetInfo.new(-7200, 3600, :TEST)
|
69
|
+
special = TimezoneOffsetInfo.new(0, 0, :SPECIAL)
|
70
|
+
start_t = TimezoneTransitionInfo.new(dst, std, 1136073600)
|
71
|
+
|
72
|
+
assert_raise(ArgumentError) { TimezonePeriod.new(start_t, nil, special) }
|
73
|
+
end
|
74
|
+
|
75
|
+
def test_initialize_end
|
76
|
+
std = TimezoneOffsetInfo.new(-7200, 0, :TEST)
|
77
|
+
dst = TimezoneOffsetInfo.new(-7200, 3600, :TEST)
|
78
|
+
end_t = TimezoneTransitionInfo.new(std, dst, 1136160000)
|
79
|
+
|
80
|
+
p = TimezonePeriod.new(nil, end_t)
|
49
81
|
|
82
|
+
assert_nil(p.start_transition)
|
83
|
+
assert_equal(end_t, p.end_transition)
|
84
|
+
assert_equal(dst, p.offset)
|
50
85
|
assert_nil(p.utc_start)
|
51
|
-
|
86
|
+
assert_equal(DateTime.new(2006,1,2,0,0,0), p.utc_end)
|
52
87
|
assert_equal(-7200, p.utc_offset)
|
53
88
|
assert_equal(3600, p.std_offset)
|
54
|
-
assert_equal(
|
55
|
-
assert_equal(
|
89
|
+
assert_equal(-3600, p.utc_total_offset)
|
90
|
+
assert_equal(Rational(-3600, 86400), p.utc_total_offset_rational)
|
91
|
+
assert_equal(:TEST, p.zone_identifier)
|
92
|
+
assert_equal(:TEST, p.abbreviation)
|
56
93
|
assert_nil(p.local_start)
|
57
|
-
|
94
|
+
assert_equal(DateTime.new(2006,1,1,23,0,0), p.local_end)
|
58
95
|
end
|
59
96
|
|
60
|
-
def
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
assert_equal(10800, p3.utc_total_offset)
|
97
|
+
def test_initialize_end_offset
|
98
|
+
std = TimezoneOffsetInfo.new(-7200, 0, :TEST)
|
99
|
+
dst = TimezoneOffsetInfo.new(-7200, 3600, :TEST)
|
100
|
+
special = TimezoneOffsetInfo.new(0, 0, :SPECIAL)
|
101
|
+
end_t = TimezoneTransitionInfo.new(std, dst, 1136160000)
|
102
|
+
|
103
|
+
assert_raise(ArgumentError) { TimezonePeriod.new(nil, end_t, special) }
|
68
104
|
end
|
69
105
|
|
70
|
-
def
|
71
|
-
|
106
|
+
def test_initialize
|
107
|
+
assert_raise(ArgumentError) { TimezonePeriod.new(nil, nil) }
|
108
|
+
end
|
109
|
+
|
110
|
+
def test_initialize_offset
|
111
|
+
special = TimezoneOffsetInfo.new(0, 0, :SPECIAL)
|
112
|
+
|
113
|
+
p = TimezonePeriod.new(nil, nil, special)
|
72
114
|
|
73
|
-
|
115
|
+
assert_nil(p.start_transition)
|
116
|
+
assert_nil(p.end_transition)
|
117
|
+
assert_equal(special, p.offset)
|
118
|
+
assert_nil(p.utc_start)
|
119
|
+
assert_nil(p.utc_end)
|
120
|
+
assert_equal(0, p.utc_offset)
|
121
|
+
assert_equal(0, p.std_offset)
|
122
|
+
assert_equal(0, p.utc_total_offset)
|
123
|
+
assert_equal(Rational(0, 86400), p.utc_total_offset_rational)
|
124
|
+
assert_equal(:SPECIAL, p.zone_identifier)
|
125
|
+
assert_equal(:SPECIAL, p.abbreviation)
|
126
|
+
assert_nil(p.local_start)
|
127
|
+
assert_nil(p.local_end)
|
74
128
|
end
|
75
129
|
|
76
|
-
def test_dst
|
77
|
-
p1 = TimezonePeriod.new(
|
78
|
-
p2 = TimezonePeriod.new(
|
79
|
-
p3 = TimezonePeriod.new(
|
80
|
-
p4 = TimezonePeriod.new(
|
81
|
-
p5 = TimezonePeriod.new(
|
130
|
+
def test_dst
|
131
|
+
p1 = TimezonePeriod.new(nil, nil, TimezoneOffsetInfo.new(-14400, 3600, :TEST))
|
132
|
+
p2 = TimezonePeriod.new(nil, nil, TimezoneOffsetInfo.new(-14400, 0, :TEST))
|
133
|
+
p3 = TimezonePeriod.new(nil, nil, TimezoneOffsetInfo.new(-14400, -3600, :TEST))
|
134
|
+
p4 = TimezonePeriod.new(nil, nil, TimezoneOffsetInfo.new(-14400, 7200, :TEST))
|
135
|
+
p5 = TimezonePeriod.new(nil, nil, TimezoneOffsetInfo.new(-14400, -7200, :TEST))
|
82
136
|
|
83
137
|
assert_equal(true, p1.dst?)
|
84
138
|
assert_equal(false, p2.dst?)
|
@@ -88,11 +142,17 @@ class TCTimezonePeriod < Test::Unit::TestCase
|
|
88
142
|
end
|
89
143
|
|
90
144
|
def test_valid_for_utc
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
145
|
+
offset = TimezoneOffsetInfo.new(-7200, 3600, :TEST)
|
146
|
+
t1 = TimezoneTransitionInfo.new(offset, offset, 1104541261)
|
147
|
+
t2 = TimezoneTransitionInfo.new(offset, offset, 1107309722)
|
148
|
+
t3 = TimezoneTransitionInfo.new(offset, offset, 210551144461, 86400)
|
149
|
+
t4 = TimezoneTransitionInfo.new(offset, offset, 105276956461, 43200)
|
150
|
+
|
151
|
+
p1 = TimezonePeriod.new(t1, t2)
|
152
|
+
p2 = TimezonePeriod.new(nil, t2)
|
153
|
+
p3 = TimezonePeriod.new(t1, nil)
|
154
|
+
p4 = TimezonePeriod.new(nil, nil, offset)
|
155
|
+
p5 = TimezonePeriod.new(t3, t4)
|
96
156
|
|
97
157
|
assert_equal(true, p1.valid_for_utc?(DateTime.new(2005,1,1,1,1,1)))
|
98
158
|
assert_equal(true, p1.valid_for_utc?(Time.utc(2005,2,2,2,2,1)))
|
@@ -135,9 +195,15 @@ class TCTimezonePeriod < Test::Unit::TestCase
|
|
135
195
|
end
|
136
196
|
|
137
197
|
def test_utc_after_start
|
138
|
-
|
139
|
-
|
140
|
-
|
198
|
+
offset = TimezoneOffsetInfo.new(-7200, 3600, :TEST)
|
199
|
+
t1 = TimezoneTransitionInfo.new(offset, offset, 1104541261)
|
200
|
+
t2 = TimezoneTransitionInfo.new(offset, offset, 1107309722)
|
201
|
+
t3 = TimezoneTransitionInfo.new(offset, offset, 210077845261, 86400)
|
202
|
+
t4 = TimezoneTransitionInfo.new(offset, offset, 105040306861, 43200)
|
203
|
+
|
204
|
+
p1 = TimezonePeriod.new(t1, t2)
|
205
|
+
p2 = TimezonePeriod.new(nil, t2)
|
206
|
+
p3 = TimezonePeriod.new(t3, t4)
|
141
207
|
|
142
208
|
assert_equal(true, p1.utc_after_start?(DateTime.new(2005,1,1,1,1,1)))
|
143
209
|
assert_equal(true, p1.utc_after_start?(Time.utc(2005,1,1,1,1,2)))
|
@@ -154,10 +220,16 @@ class TCTimezonePeriod < Test::Unit::TestCase
|
|
154
220
|
end
|
155
221
|
|
156
222
|
def test_utc_before_end
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
223
|
+
offset = TimezoneOffsetInfo.new(-7200, 3600, :TEST)
|
224
|
+
t1 = TimezoneTransitionInfo.new(offset, offset, 1104541261)
|
225
|
+
t2 = TimezoneTransitionInfo.new(offset, offset, 1107309722)
|
226
|
+
t3 = TimezoneTransitionInfo.new(offset, offset, 210077845261, 86400)
|
227
|
+
t4 = TimezoneTransitionInfo.new(offset, offset, 105040306861, 43200)
|
228
|
+
|
229
|
+
p1 = TimezonePeriod.new(t1, t2)
|
230
|
+
p2 = TimezonePeriod.new(t1, nil)
|
231
|
+
p3 = TimezonePeriod.new(t3, t4)
|
232
|
+
|
161
233
|
assert_equal(true, p1.utc_before_end?(DateTime.new(2005,2,2,2,2,1)))
|
162
234
|
assert_equal(true, p1.utc_before_end?(Time.utc(2005,2,2,2,2,0)))
|
163
235
|
assert_equal(false, p1.utc_before_end?(1107309723))
|
@@ -173,11 +245,18 @@ class TCTimezonePeriod < Test::Unit::TestCase
|
|
173
245
|
end
|
174
246
|
|
175
247
|
def test_valid_for_local
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
248
|
+
offset = TimezoneOffsetInfo.new(-7200, 3600, :TEST)
|
249
|
+
t1 = TimezoneTransitionInfo.new(offset, offset, 1104544861)
|
250
|
+
t2 = TimezoneTransitionInfo.new(offset, offset, 1107313322)
|
251
|
+
t3 = TimezoneTransitionInfo.new(offset, offset, 1104544861)
|
252
|
+
t4 = TimezoneTransitionInfo.new(offset, offset, 210551144461, 86400)
|
253
|
+
t5 = TimezoneTransitionInfo.new(offset, offset, 105276956461, 43200)
|
254
|
+
|
255
|
+
p1 = TimezonePeriod.new(t1, t2)
|
256
|
+
p2 = TimezonePeriod.new(nil, t2)
|
257
|
+
p3 = TimezonePeriod.new(t3, nil)
|
258
|
+
p4 = TimezonePeriod.new(nil, nil, offset)
|
259
|
+
p5 = TimezonePeriod.new(t4, t5)
|
181
260
|
|
182
261
|
assert_equal(true, p1.valid_for_local?(DateTime.new(2005,1,1,1,1,1)))
|
183
262
|
assert_equal(true, p1.valid_for_local?(Time.utc(2005,2,2,2,2,1)))
|
@@ -220,9 +299,15 @@ class TCTimezonePeriod < Test::Unit::TestCase
|
|
220
299
|
end
|
221
300
|
|
222
301
|
def test_local_after_start
|
223
|
-
|
224
|
-
|
225
|
-
|
302
|
+
offset = TimezoneOffsetInfo.new(-7200, 3600, :TEST)
|
303
|
+
t1 = TimezoneTransitionInfo.new(offset, offset, 1104544861)
|
304
|
+
t2 = TimezoneTransitionInfo.new(offset, offset, 1107313322)
|
305
|
+
t3 = TimezoneTransitionInfo.new(offset, offset, 210077845261, 86400)
|
306
|
+
t4 = TimezoneTransitionInfo.new(offset, offset, 105040306861, 43200)
|
307
|
+
|
308
|
+
p1 = TimezonePeriod.new(t1, t2)
|
309
|
+
p2 = TimezonePeriod.new(nil, t2)
|
310
|
+
p3 = TimezonePeriod.new(t3, t4)
|
226
311
|
|
227
312
|
assert_equal(true, p1.local_after_start?(DateTime.new(2005,1,1,1,1,1)))
|
228
313
|
assert_equal(true, p1.local_after_start?(Time.utc(2005,1,1,1,1,2)))
|
@@ -239,9 +324,15 @@ class TCTimezonePeriod < Test::Unit::TestCase
|
|
239
324
|
end
|
240
325
|
|
241
326
|
def test_local_before_end
|
242
|
-
|
243
|
-
|
244
|
-
|
327
|
+
offset = TimezoneOffsetInfo.new(-7200, 3600, :TEST)
|
328
|
+
t1 = TimezoneTransitionInfo.new(offset, offset, 1104544861)
|
329
|
+
t2 = TimezoneTransitionInfo.new(offset, offset, 1107313322)
|
330
|
+
t3 = TimezoneTransitionInfo.new(offset, offset, 210077845261, 86400)
|
331
|
+
t4 = TimezoneTransitionInfo.new(offset, offset, 105040306861, 43200)
|
332
|
+
|
333
|
+
p1 = TimezonePeriod.new(t1, t2)
|
334
|
+
p2 = TimezonePeriod.new(t1, nil)
|
335
|
+
p3 = TimezonePeriod.new(t3, t4)
|
245
336
|
|
246
337
|
assert_equal(true, p1.local_before_end?(DateTime.new(2005,2,2,2,2,1)))
|
247
338
|
assert_equal(true, p1.local_before_end?(Time.utc(2005,2,2,2,2,0)))
|
@@ -258,9 +349,9 @@ class TCTimezonePeriod < Test::Unit::TestCase
|
|
258
349
|
end
|
259
350
|
|
260
351
|
def test_to_local
|
261
|
-
p1 = TimezonePeriod.new(
|
262
|
-
p2 = TimezonePeriod.new(
|
263
|
-
p3 = TimezonePeriod.new(
|
352
|
+
p1 = TimezonePeriod.new(nil, nil, TimezoneOffsetInfo.new(-14400, 3600, :TEST))
|
353
|
+
p2 = TimezonePeriod.new(nil, nil, TimezoneOffsetInfo.new(-14400, 0, :TEST))
|
354
|
+
p3 = TimezonePeriod.new(nil, nil, TimezoneOffsetInfo.new(7200, 3600, :TEST))
|
264
355
|
|
265
356
|
assert_equal(DateTime.new(2005,1,19,22,0,0), p1.to_local(DateTime.new(2005,1,20,1,0,0)))
|
266
357
|
assert_equal(Time.utc(2005,1,19,21,0,0), p2.to_local(Time.utc(2005,1,20,1,0,0)))
|
@@ -268,9 +359,9 @@ class TCTimezonePeriod < Test::Unit::TestCase
|
|
268
359
|
end
|
269
360
|
|
270
361
|
def test_to_utc
|
271
|
-
p1 = TimezonePeriod.new(
|
272
|
-
p2 = TimezonePeriod.new(
|
273
|
-
p3 = TimezonePeriod.new(
|
362
|
+
p1 = TimezonePeriod.new(nil, nil, TimezoneOffsetInfo.new(-14400, 3600, :TEST))
|
363
|
+
p2 = TimezonePeriod.new(nil, nil, TimezoneOffsetInfo.new(-14400, 0, :TEST))
|
364
|
+
p3 = TimezonePeriod.new(nil, nil, TimezoneOffsetInfo.new(7200, 3600, :TEST))
|
274
365
|
|
275
366
|
assert_equal(DateTime.new(2005,1,20,4,0,0), p1.to_utc(DateTime.new(2005,1,20,1,0,0)))
|
276
367
|
assert_equal(Time.utc(2005,1,20,5,0,0), p2.to_utc(Time.utc(2005,1,20,1,0,0)))
|
@@ -278,14 +369,143 @@ class TCTimezonePeriod < Test::Unit::TestCase
|
|
278
369
|
end
|
279
370
|
|
280
371
|
def test_time_boundary_start
|
281
|
-
|
372
|
+
o1 = TimezoneOffsetInfo.new(-3600, 0, :TEST)
|
373
|
+
o2 = TimezoneOffsetInfo.new(-3600, 3600, :TEST)
|
374
|
+
t1 = TimezoneTransitionInfo.new(o1, o2, 0)
|
375
|
+
|
376
|
+
p1 = TimezonePeriod.new(t1, nil)
|
282
377
|
|
283
378
|
assert_equal(DateTime.new(1969,12,31,23,0,0), p1.local_start)
|
284
379
|
end
|
285
380
|
|
286
381
|
def test_time_boundary_end
|
287
|
-
|
382
|
+
o1 = TimezoneOffsetInfo.new(0, 3600, :TEST)
|
383
|
+
o2 = TimezoneOffsetInfo.new(0, 0, :TEST)
|
384
|
+
t1 = TimezoneTransitionInfo.new(o2, o1, 2147482800)
|
385
|
+
|
386
|
+
p1 = TimezonePeriod.new(nil, t1)
|
288
387
|
|
289
388
|
assert_equal(DateTime.new(2038,1,19,4,0,0), p1.local_end)
|
290
389
|
end
|
390
|
+
|
391
|
+
def test_equality
|
392
|
+
o1 = TimezoneOffsetInfo.new(0, 3600, :TEST)
|
393
|
+
o2 = TimezoneOffsetInfo.new(0, 0, :TEST)
|
394
|
+
t1 = TimezoneTransitionInfo.new(o1, o2, 1149368400)
|
395
|
+
t2 = TimezoneTransitionInfo.new(o1, o2, 19631123, 8)
|
396
|
+
t3 = TimezoneTransitionInfo.new(o1, o2, 1149454800)
|
397
|
+
t4 = TimezoneTransitionInfo.new(o1, o2, 1149541200)
|
398
|
+
|
399
|
+
p1 = TimezonePeriod.new(t1, t3)
|
400
|
+
p2 = TimezonePeriod.new(t1, t3)
|
401
|
+
p3 = TimezonePeriod.new(t2, t3)
|
402
|
+
p4 = TimezonePeriod.new(t3, nil)
|
403
|
+
p5 = TimezonePeriod.new(t3, nil)
|
404
|
+
p6 = TimezonePeriod.new(t4, nil)
|
405
|
+
p7 = TimezonePeriod.new(nil, t3)
|
406
|
+
p8 = TimezonePeriod.new(nil, t3)
|
407
|
+
p9 = TimezonePeriod.new(nil, t4)
|
408
|
+
p10 = TimezonePeriod.new(nil, nil, o1)
|
409
|
+
p11 = TimezonePeriod.new(nil, nil, o1)
|
410
|
+
p12 = TimezonePeriod.new(nil, nil, o2)
|
411
|
+
|
412
|
+
assert_equal(true, p1 == p1)
|
413
|
+
assert_equal(true, p1 == p2)
|
414
|
+
assert_equal(true, p1 == p3)
|
415
|
+
assert_equal(false, p1 == p4)
|
416
|
+
assert_equal(false, p1 == p5)
|
417
|
+
assert_equal(false, p1 == p6)
|
418
|
+
assert_equal(false, p1 == p7)
|
419
|
+
assert_equal(false, p1 == p8)
|
420
|
+
assert_equal(false, p1 == p9)
|
421
|
+
assert_equal(false, p1 == p10)
|
422
|
+
assert_equal(false, p1 == p11)
|
423
|
+
assert_equal(false, p1 == p12)
|
424
|
+
assert_equal(false, p1 == Object.new)
|
425
|
+
|
426
|
+
assert_equal(true, p4 == p4)
|
427
|
+
assert_equal(true, p4 == p5)
|
428
|
+
assert_equal(false, p4 == p6)
|
429
|
+
assert_equal(false, p4 == Object.new)
|
430
|
+
|
431
|
+
assert_equal(true, p7 == p7)
|
432
|
+
assert_equal(true, p7 == p8)
|
433
|
+
assert_equal(false, p7 == p9)
|
434
|
+
assert_equal(false, p7 == Object.new)
|
435
|
+
|
436
|
+
assert_equal(true, p10 == p10)
|
437
|
+
assert_equal(true, p10 == p11)
|
438
|
+
assert_equal(false, p10 == p12)
|
439
|
+
assert_equal(false, p10 == Object.new)
|
440
|
+
end
|
441
|
+
|
442
|
+
def test_eql
|
443
|
+
o1 = TimezoneOffsetInfo.new(0, 3600, :TEST)
|
444
|
+
o2 = TimezoneOffsetInfo.new(0, 0, :TEST)
|
445
|
+
t1 = TimezoneTransitionInfo.new(o1, o2, 1149368400)
|
446
|
+
t2 = TimezoneTransitionInfo.new(o1, o2, 19631123, 8)
|
447
|
+
t3 = TimezoneTransitionInfo.new(o1, o2, 1149454800)
|
448
|
+
t4 = TimezoneTransitionInfo.new(o1, o2, 1149541200)
|
449
|
+
|
450
|
+
p1 = TimezonePeriod.new(t1, t3)
|
451
|
+
p2 = TimezonePeriod.new(t1, t3)
|
452
|
+
p3 = TimezonePeriod.new(t2, t3)
|
453
|
+
p4 = TimezonePeriod.new(t3, nil)
|
454
|
+
p5 = TimezonePeriod.new(t3, nil)
|
455
|
+
p6 = TimezonePeriod.new(t4, nil)
|
456
|
+
p7 = TimezonePeriod.new(nil, t3)
|
457
|
+
p8 = TimezonePeriod.new(nil, t3)
|
458
|
+
p9 = TimezonePeriod.new(nil, t4)
|
459
|
+
p10 = TimezonePeriod.new(nil, nil, o1)
|
460
|
+
p11 = TimezonePeriod.new(nil, nil, o1)
|
461
|
+
p12 = TimezonePeriod.new(nil, nil, o2)
|
462
|
+
|
463
|
+
assert_equal(true, p1.eql?(p1))
|
464
|
+
assert_equal(true, p1.eql?(p2))
|
465
|
+
assert_equal(false, p1.eql?(p3))
|
466
|
+
assert_equal(false, p1.eql?(p4))
|
467
|
+
assert_equal(false, p1.eql?(p5))
|
468
|
+
assert_equal(false, p1.eql?(p6))
|
469
|
+
assert_equal(false, p1.eql?(p7))
|
470
|
+
assert_equal(false, p1.eql?(p8))
|
471
|
+
assert_equal(false, p1.eql?(p9))
|
472
|
+
assert_equal(false, p1.eql?(p10))
|
473
|
+
assert_equal(false, p1.eql?(p11))
|
474
|
+
assert_equal(false, p1.eql?(p12))
|
475
|
+
assert_equal(false, p1.eql?(Object.new))
|
476
|
+
|
477
|
+
assert_equal(true, p4.eql?(p4))
|
478
|
+
assert_equal(true, p4.eql?(p5))
|
479
|
+
assert_equal(false, p4.eql?(p6))
|
480
|
+
assert_equal(false, p4.eql?(Object.new))
|
481
|
+
|
482
|
+
assert_equal(true, p7.eql?(p7))
|
483
|
+
assert_equal(true, p7.eql?(p8))
|
484
|
+
assert_equal(false, p7.eql?(p9))
|
485
|
+
assert_equal(false, p7.eql?(Object.new))
|
486
|
+
|
487
|
+
assert_equal(true, p10.eql?(p10))
|
488
|
+
assert_equal(true, p10.eql?(p11))
|
489
|
+
assert_equal(false, p10.eql?(p12))
|
490
|
+
assert_equal(false, p10.eql?(Object.new))
|
491
|
+
end
|
492
|
+
|
493
|
+
def test_hash
|
494
|
+
o1 = TimezoneOffsetInfo.new(0, 3600, :TEST)
|
495
|
+
o2 = TimezoneOffsetInfo.new(0, 0, :TEST)
|
496
|
+
t1 = TimezoneTransitionInfo.new(o1, o2, 1149368400)
|
497
|
+
t2 = TimezoneTransitionInfo.new(o1, o2, 19631123, 8)
|
498
|
+
t3 = TimezoneTransitionInfo.new(o1, o2, 1149454800)
|
499
|
+
t4 = TimezoneTransitionInfo.new(o1, o2, 1149541200)
|
500
|
+
|
501
|
+
p1 = TimezonePeriod.new(t1, t3)
|
502
|
+
p2 = TimezonePeriod.new(t3, nil)
|
503
|
+
p3 = TimezonePeriod.new(nil, t3)
|
504
|
+
p4 = TimezonePeriod.new(nil, nil, o1)
|
505
|
+
|
506
|
+
assert_equal(t1.hash ^ t3.hash, p1.hash)
|
507
|
+
assert_equal(t3.hash ^ nil.hash, p2.hash)
|
508
|
+
assert_equal(nil.hash ^ t3.hash, p3.hash)
|
509
|
+
assert_equal(nil.hash ^ nil.hash ^ o1.hash, p4.hash)
|
510
|
+
end
|
291
511
|
end
|