tzinfo 0.1.2 → 0.2.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 +24 -0
- data/LICENSE +1 -1
- data/Rakefile +5 -1
- data/lib/tzinfo/countries/AD.rb +12 -12
- data/lib/tzinfo/countries/AE.rb +12 -12
- data/lib/tzinfo/countries/AF.rb +12 -12
- data/lib/tzinfo/countries/AG.rb +12 -12
- data/lib/tzinfo/countries/AI.rb +12 -12
- data/lib/tzinfo/countries/AL.rb +12 -12
- data/lib/tzinfo/countries/AM.rb +12 -12
- data/lib/tzinfo/countries/AN.rb +12 -12
- data/lib/tzinfo/countries/AO.rb +12 -12
- data/lib/tzinfo/countries/AQ.rb +21 -21
- data/lib/tzinfo/countries/AR.rb +21 -21
- data/lib/tzinfo/countries/AS.rb +12 -12
- data/lib/tzinfo/countries/AT.rb +12 -12
- data/lib/tzinfo/countries/AU.rb +22 -22
- data/lib/tzinfo/countries/AW.rb +12 -12
- data/lib/tzinfo/countries/AX.rb +12 -12
- data/lib/tzinfo/countries/AZ.rb +12 -12
- data/lib/tzinfo/countries/BA.rb +12 -12
- data/lib/tzinfo/countries/BB.rb +12 -12
- data/lib/tzinfo/countries/BD.rb +12 -12
- data/lib/tzinfo/countries/BE.rb +12 -12
- data/lib/tzinfo/countries/BF.rb +12 -12
- data/lib/tzinfo/countries/BG.rb +12 -12
- data/lib/tzinfo/countries/BH.rb +12 -12
- data/lib/tzinfo/countries/BI.rb +12 -12
- data/lib/tzinfo/countries/BJ.rb +12 -12
- data/lib/tzinfo/countries/BM.rb +12 -12
- data/lib/tzinfo/countries/BN.rb +12 -12
- data/lib/tzinfo/countries/BO.rb +12 -12
- data/lib/tzinfo/countries/BR.rb +26 -26
- data/lib/tzinfo/countries/BS.rb +12 -12
- data/lib/tzinfo/countries/BT.rb +12 -12
- data/lib/tzinfo/countries/BV.rb +11 -11
- data/lib/tzinfo/countries/BW.rb +12 -12
- data/lib/tzinfo/countries/BY.rb +12 -12
- data/lib/tzinfo/countries/BZ.rb +12 -12
- data/lib/tzinfo/countries/CA.rb +36 -36
- data/lib/tzinfo/countries/CC.rb +12 -12
- data/lib/tzinfo/countries/CD.rb +13 -13
- data/lib/tzinfo/countries/CF.rb +12 -12
- data/lib/tzinfo/countries/CG.rb +12 -12
- data/lib/tzinfo/countries/CH.rb +12 -12
- data/lib/tzinfo/countries/CI.rb +12 -12
- data/lib/tzinfo/countries/CK.rb +12 -12
- data/lib/tzinfo/countries/CL.rb +13 -13
- data/lib/tzinfo/countries/CM.rb +12 -12
- data/lib/tzinfo/countries/CN.rb +16 -16
- data/lib/tzinfo/countries/CO.rb +12 -12
- data/lib/tzinfo/countries/CR.rb +12 -12
- data/lib/tzinfo/countries/CS.rb +12 -12
- data/lib/tzinfo/countries/CU.rb +12 -12
- data/lib/tzinfo/countries/CV.rb +12 -12
- data/lib/tzinfo/countries/CX.rb +12 -12
- data/lib/tzinfo/countries/CY.rb +12 -12
- data/lib/tzinfo/countries/CZ.rb +12 -12
- data/lib/tzinfo/countries/DE.rb +12 -12
- data/lib/tzinfo/countries/DJ.rb +12 -12
- data/lib/tzinfo/countries/DK.rb +12 -12
- data/lib/tzinfo/countries/DM.rb +12 -12
- data/lib/tzinfo/countries/DO.rb +12 -12
- data/lib/tzinfo/countries/DZ.rb +12 -12
- data/lib/tzinfo/countries/EC.rb +13 -13
- data/lib/tzinfo/countries/EE.rb +12 -12
- data/lib/tzinfo/countries/EG.rb +12 -12
- data/lib/tzinfo/countries/EH.rb +12 -12
- data/lib/tzinfo/countries/ER.rb +12 -12
- data/lib/tzinfo/countries/ES.rb +14 -14
- data/lib/tzinfo/countries/ET.rb +12 -12
- data/lib/tzinfo/countries/FI.rb +12 -12
- data/lib/tzinfo/countries/FJ.rb +12 -12
- data/lib/tzinfo/countries/FK.rb +12 -12
- data/lib/tzinfo/countries/FM.rb +14 -14
- data/lib/tzinfo/countries/FO.rb +12 -12
- data/lib/tzinfo/countries/FR.rb +12 -12
- data/lib/tzinfo/countries/GA.rb +12 -12
- data/lib/tzinfo/countries/GB.rb +12 -12
- data/lib/tzinfo/countries/GD.rb +12 -12
- data/lib/tzinfo/countries/GE.rb +12 -12
- data/lib/tzinfo/countries/GF.rb +12 -12
- data/lib/tzinfo/countries/GH.rb +12 -12
- data/lib/tzinfo/countries/GI.rb +12 -12
- data/lib/tzinfo/countries/GL.rb +15 -15
- data/lib/tzinfo/countries/GM.rb +12 -12
- data/lib/tzinfo/countries/GN.rb +12 -12
- data/lib/tzinfo/countries/GP.rb +12 -12
- data/lib/tzinfo/countries/GQ.rb +12 -12
- data/lib/tzinfo/countries/GR.rb +12 -12
- data/lib/tzinfo/countries/GS.rb +12 -12
- data/lib/tzinfo/countries/GT.rb +12 -12
- data/lib/tzinfo/countries/GU.rb +12 -12
- data/lib/tzinfo/countries/GW.rb +12 -12
- data/lib/tzinfo/countries/GY.rb +12 -12
- data/lib/tzinfo/countries/HK.rb +12 -12
- data/lib/tzinfo/countries/HM.rb +11 -11
- data/lib/tzinfo/countries/HN.rb +12 -12
- data/lib/tzinfo/countries/HR.rb +12 -12
- data/lib/tzinfo/countries/HT.rb +12 -12
- data/lib/tzinfo/countries/HU.rb +12 -12
- data/lib/tzinfo/countries/ID.rb +15 -15
- data/lib/tzinfo/countries/IE.rb +12 -12
- data/lib/tzinfo/countries/IL.rb +12 -12
- data/lib/tzinfo/countries/IN.rb +12 -12
- data/lib/tzinfo/countries/IO.rb +12 -12
- data/lib/tzinfo/countries/IQ.rb +12 -12
- data/lib/tzinfo/countries/IR.rb +12 -12
- data/lib/tzinfo/countries/IS.rb +12 -12
- data/lib/tzinfo/countries/IT.rb +12 -12
- data/lib/tzinfo/countries/JM.rb +12 -12
- data/lib/tzinfo/countries/JO.rb +12 -12
- data/lib/tzinfo/countries/JP.rb +12 -12
- data/lib/tzinfo/countries/KE.rb +12 -12
- data/lib/tzinfo/countries/KG.rb +12 -12
- data/lib/tzinfo/countries/KH.rb +12 -12
- data/lib/tzinfo/countries/KI.rb +14 -14
- data/lib/tzinfo/countries/KM.rb +12 -12
- data/lib/tzinfo/countries/KN.rb +12 -12
- data/lib/tzinfo/countries/KP.rb +12 -12
- data/lib/tzinfo/countries/KR.rb +12 -12
- data/lib/tzinfo/countries/KW.rb +12 -12
- data/lib/tzinfo/countries/KY.rb +12 -12
- data/lib/tzinfo/countries/KZ.rb +16 -16
- data/lib/tzinfo/countries/LA.rb +12 -12
- data/lib/tzinfo/countries/LB.rb +12 -12
- data/lib/tzinfo/countries/LC.rb +12 -12
- data/lib/tzinfo/countries/LI.rb +12 -12
- data/lib/tzinfo/countries/LK.rb +12 -12
- data/lib/tzinfo/countries/LR.rb +12 -12
- data/lib/tzinfo/countries/LS.rb +12 -12
- data/lib/tzinfo/countries/LT.rb +12 -12
- data/lib/tzinfo/countries/LU.rb +12 -12
- data/lib/tzinfo/countries/LV.rb +12 -12
- data/lib/tzinfo/countries/LY.rb +12 -12
- data/lib/tzinfo/countries/MA.rb +12 -12
- data/lib/tzinfo/countries/MC.rb +12 -12
- data/lib/tzinfo/countries/MD.rb +12 -12
- data/lib/tzinfo/countries/MG.rb +12 -12
- data/lib/tzinfo/countries/MH.rb +13 -13
- data/lib/tzinfo/countries/MK.rb +12 -12
- data/lib/tzinfo/countries/ML.rb +12 -12
- data/lib/tzinfo/countries/MM.rb +12 -12
- data/lib/tzinfo/countries/MN.rb +14 -14
- data/lib/tzinfo/countries/MO.rb +12 -12
- data/lib/tzinfo/countries/MP.rb +12 -12
- data/lib/tzinfo/countries/MQ.rb +12 -12
- data/lib/tzinfo/countries/MR.rb +12 -12
- data/lib/tzinfo/countries/MS.rb +12 -12
- data/lib/tzinfo/countries/MT.rb +12 -12
- data/lib/tzinfo/countries/MU.rb +12 -12
- data/lib/tzinfo/countries/MV.rb +12 -12
- data/lib/tzinfo/countries/MW.rb +12 -12
- data/lib/tzinfo/countries/MX.rb +19 -19
- data/lib/tzinfo/countries/MY.rb +13 -13
- data/lib/tzinfo/countries/MZ.rb +12 -12
- data/lib/tzinfo/countries/NA.rb +12 -12
- data/lib/tzinfo/countries/NC.rb +12 -12
- data/lib/tzinfo/countries/NE.rb +12 -12
- data/lib/tzinfo/countries/NF.rb +12 -12
- data/lib/tzinfo/countries/NG.rb +12 -12
- data/lib/tzinfo/countries/NI.rb +12 -12
- data/lib/tzinfo/countries/NL.rb +12 -12
- data/lib/tzinfo/countries/NO.rb +12 -12
- data/lib/tzinfo/countries/NP.rb +12 -12
- data/lib/tzinfo/countries/NR.rb +12 -12
- data/lib/tzinfo/countries/NU.rb +12 -12
- data/lib/tzinfo/countries/NZ.rb +13 -13
- data/lib/tzinfo/countries/OM.rb +12 -12
- data/lib/tzinfo/countries/PA.rb +12 -12
- data/lib/tzinfo/countries/PE.rb +12 -12
- data/lib/tzinfo/countries/PF.rb +14 -14
- data/lib/tzinfo/countries/PG.rb +12 -12
- data/lib/tzinfo/countries/PH.rb +12 -12
- data/lib/tzinfo/countries/PK.rb +12 -12
- data/lib/tzinfo/countries/PL.rb +12 -12
- data/lib/tzinfo/countries/PM.rb +12 -12
- data/lib/tzinfo/countries/PN.rb +12 -12
- data/lib/tzinfo/countries/PR.rb +12 -12
- data/lib/tzinfo/countries/PS.rb +12 -12
- data/lib/tzinfo/countries/PT.rb +14 -14
- data/lib/tzinfo/countries/PW.rb +12 -12
- data/lib/tzinfo/countries/PY.rb +12 -12
- data/lib/tzinfo/countries/QA.rb +12 -12
- data/lib/tzinfo/countries/RE.rb +12 -12
- data/lib/tzinfo/countries/RO.rb +12 -12
- data/lib/tzinfo/countries/RU.rb +25 -25
- data/lib/tzinfo/countries/RW.rb +12 -12
- data/lib/tzinfo/countries/SA.rb +12 -12
- data/lib/tzinfo/countries/SB.rb +12 -12
- data/lib/tzinfo/countries/SC.rb +12 -12
- data/lib/tzinfo/countries/SD.rb +12 -12
- data/lib/tzinfo/countries/SE.rb +12 -12
- data/lib/tzinfo/countries/SG.rb +12 -12
- data/lib/tzinfo/countries/SH.rb +12 -12
- data/lib/tzinfo/countries/SI.rb +12 -12
- data/lib/tzinfo/countries/SJ.rb +13 -13
- data/lib/tzinfo/countries/SK.rb +12 -12
- data/lib/tzinfo/countries/SL.rb +12 -12
- data/lib/tzinfo/countries/SM.rb +12 -12
- data/lib/tzinfo/countries/SN.rb +12 -12
- data/lib/tzinfo/countries/SO.rb +12 -12
- data/lib/tzinfo/countries/SR.rb +12 -12
- data/lib/tzinfo/countries/ST.rb +12 -12
- data/lib/tzinfo/countries/SV.rb +12 -12
- data/lib/tzinfo/countries/SY.rb +12 -12
- data/lib/tzinfo/countries/SZ.rb +12 -12
- data/lib/tzinfo/countries/TC.rb +12 -12
- data/lib/tzinfo/countries/TD.rb +12 -12
- data/lib/tzinfo/countries/TF.rb +12 -12
- data/lib/tzinfo/countries/TG.rb +12 -12
- data/lib/tzinfo/countries/TH.rb +12 -12
- data/lib/tzinfo/countries/TJ.rb +12 -12
- data/lib/tzinfo/countries/TK.rb +12 -12
- data/lib/tzinfo/countries/TL.rb +12 -12
- data/lib/tzinfo/countries/TM.rb +12 -12
- data/lib/tzinfo/countries/TN.rb +12 -12
- data/lib/tzinfo/countries/TO.rb +12 -12
- data/lib/tzinfo/countries/TR.rb +12 -12
- data/lib/tzinfo/countries/TT.rb +12 -12
- data/lib/tzinfo/countries/TV.rb +12 -12
- data/lib/tzinfo/countries/TW.rb +12 -12
- data/lib/tzinfo/countries/TZ.rb +12 -12
- data/lib/tzinfo/countries/UA.rb +15 -15
- data/lib/tzinfo/countries/UG.rb +12 -12
- data/lib/tzinfo/countries/UM.rb +14 -14
- data/lib/tzinfo/countries/US.rb +36 -35
- data/lib/tzinfo/countries/UY.rb +12 -12
- data/lib/tzinfo/countries/UZ.rb +13 -13
- data/lib/tzinfo/countries/VA.rb +12 -12
- data/lib/tzinfo/countries/VC.rb +12 -12
- data/lib/tzinfo/countries/VE.rb +12 -12
- data/lib/tzinfo/countries/VG.rb +12 -12
- data/lib/tzinfo/countries/VI.rb +12 -12
- data/lib/tzinfo/countries/VN.rb +12 -12
- data/lib/tzinfo/countries/VU.rb +12 -12
- data/lib/tzinfo/countries/WF.rb +12 -12
- data/lib/tzinfo/countries/WS.rb +12 -12
- data/lib/tzinfo/countries/YE.rb +12 -12
- data/lib/tzinfo/countries/YT.rb +12 -12
- data/lib/tzinfo/countries/ZA.rb +12 -12
- data/lib/tzinfo/countries/ZM.rb +12 -12
- data/lib/tzinfo/countries/ZW.rb +12 -12
- data/lib/tzinfo/definitions/Africa/Abidjan.rb +13 -13
- data/lib/tzinfo/definitions/Africa/Accra.rb +27 -27
- data/lib/tzinfo/definitions/Africa/Addis_Ababa.rb +14 -14
- data/lib/tzinfo/definitions/Africa/Algiers.rb +46 -46
- data/lib/tzinfo/definitions/Africa/Asmera.rb +15 -15
- data/lib/tzinfo/definitions/Africa/Bamako.rb +15 -15
- data/lib/tzinfo/definitions/Africa/Bangui.rb +13 -13
- data/lib/tzinfo/definitions/Africa/Banjul.rb +15 -15
- data/lib/tzinfo/definitions/Africa/Bissau.rb +14 -14
- data/lib/tzinfo/definitions/Africa/Blantyre.rb +13 -13
- data/lib/tzinfo/definitions/Africa/Brazzaville.rb +13 -13
- data/lib/tzinfo/definitions/Africa/Bujumbura.rb +13 -13
- data/lib/tzinfo/definitions/Africa/Cairo.rb +213 -203
- data/lib/tzinfo/definitions/Africa/Casablanca.rb +31 -31
- data/lib/tzinfo/definitions/Africa/Ceuta.rb +164 -157
- data/lib/tzinfo/definitions/Africa/Conakry.rb +15 -15
- data/lib/tzinfo/definitions/Africa/Dakar.rb +14 -14
- data/lib/tzinfo/definitions/Africa/Dar_es_Salaam.rb +15 -15
- data/lib/tzinfo/definitions/Africa/Djibouti.rb +13 -13
- data/lib/tzinfo/definitions/Africa/Douala.rb +13 -13
- data/lib/tzinfo/definitions/Africa/El_Aaiun.rb +14 -14
- data/lib/tzinfo/definitions/Africa/Freetown.rb +43 -43
- data/lib/tzinfo/definitions/Africa/Gaborone.rb +15 -15
- data/lib/tzinfo/definitions/Africa/Harare.rb +13 -13
- data/lib/tzinfo/definitions/Africa/Johannesburg.rb +18 -18
- data/lib/tzinfo/definitions/Africa/Kampala.rb +16 -16
- data/lib/tzinfo/definitions/Africa/Khartoum.rb +46 -46
- data/lib/tzinfo/definitions/Africa/Kigali.rb +13 -13
- data/lib/tzinfo/definitions/Africa/Kinshasa.rb +13 -13
- data/lib/tzinfo/definitions/Africa/Lagos.rb +13 -13
- data/lib/tzinfo/definitions/Africa/Libreville.rb +13 -13
- data/lib/tzinfo/definitions/Africa/Lome.rb +13 -13
- data/lib/tzinfo/definitions/Africa/Luanda.rb +14 -14
- data/lib/tzinfo/definitions/Africa/Lubumbashi.rb +13 -13
- data/lib/tzinfo/definitions/Africa/Lusaka.rb +13 -13
- data/lib/tzinfo/definitions/Africa/Malabo.rb +14 -14
- data/lib/tzinfo/definitions/Africa/Maputo.rb +13 -13
- data/lib/tzinfo/definitions/Africa/Maseru.rb +15 -15
- data/lib/tzinfo/definitions/Africa/Mbabane.rb +13 -13
- data/lib/tzinfo/definitions/Africa/Mogadishu.rb +15 -15
- data/lib/tzinfo/definitions/Africa/Monrovia.rb +15 -15
- data/lib/tzinfo/definitions/Africa/Nairobi.rb +16 -16
- data/lib/tzinfo/definitions/Africa/Ndjamena.rb +15 -15
- data/lib/tzinfo/definitions/Africa/Niamey.rb +15 -15
- data/lib/tzinfo/definitions/Africa/Nouakchott.rb +15 -15
- data/lib/tzinfo/definitions/Africa/Ouagadougou.rb +13 -13
- data/lib/tzinfo/definitions/Africa/Porto__m__Novo.rb +14 -14
- data/lib/tzinfo/definitions/Africa/Sao_Tome.rb +14 -14
- data/lib/tzinfo/definitions/Africa/Timbuktu.rb +11 -11
- data/lib/tzinfo/definitions/Africa/Tripoli.rb +41 -41
- data/lib/tzinfo/definitions/Africa/Tunis.rb +130 -40
- data/lib/tzinfo/definitions/Africa/Windhoek.rb +130 -121
- data/lib/tzinfo/definitions/America/Adak.rb +183 -175
- data/lib/tzinfo/definitions/America/Anchorage.rb +183 -175
- data/lib/tzinfo/definitions/America/Anguilla.rb +13 -13
- data/lib/tzinfo/definitions/America/Antigua.rb +14 -14
- data/lib/tzinfo/definitions/America/Araguaina.rb +61 -64
- data/lib/tzinfo/definitions/America/Argentina/Buenos_Aires.rb +71 -71
- data/lib/tzinfo/definitions/America/Argentina/Catamarca.rb +73 -73
- data/lib/tzinfo/definitions/America/Argentina/ComodRivadavia.rb +13 -13
- data/lib/tzinfo/definitions/America/Argentina/Cordoba.rb +71 -71
- data/lib/tzinfo/definitions/America/Argentina/Jujuy.rb +71 -72
- data/lib/tzinfo/definitions/America/Argentina/La_Rioja.rb +74 -74
- data/lib/tzinfo/definitions/America/Argentina/Mendoza.rb +73 -73
- data/lib/tzinfo/definitions/America/Argentina/Rio_Gallegos.rb +73 -73
- data/lib/tzinfo/definitions/America/Argentina/San_Juan.rb +74 -74
- data/lib/tzinfo/definitions/America/Argentina/Tucuman.rb +73 -73
- data/lib/tzinfo/definitions/America/Argentina/Ushuaia.rb +73 -73
- data/lib/tzinfo/definitions/America/Aruba.rb +14 -14
- data/lib/tzinfo/definitions/America/Asuncion.rb +166 -157
- data/lib/tzinfo/definitions/America/Atka.rb +11 -11
- data/lib/tzinfo/definitions/America/Bahia.rb +71 -72
- data/lib/tzinfo/definitions/America/Barbados.rb +22 -22
- data/lib/tzinfo/definitions/America/Belem.rb +41 -42
- data/lib/tzinfo/definitions/America/Belize.rb +67 -67
- data/lib/tzinfo/definitions/America/Boa_Vista.rb +45 -47
- data/lib/tzinfo/definitions/America/Bogota.rb +16 -16
- data/lib/tzinfo/definitions/America/Boise.rb +189 -178
- data/lib/tzinfo/definitions/America/Buenos_Aires.rb +11 -11
- data/lib/tzinfo/definitions/America/Cambridge_Bay.rb +165 -154
- data/lib/tzinfo/definitions/America/Campo_Grande.rb +165 -156
- data/lib/tzinfo/definitions/America/Cancun.rb +125 -115
- data/lib/tzinfo/definitions/America/Caracas.rb +15 -15
- data/lib/tzinfo/definitions/America/Catamarca.rb +11 -11
- data/lib/tzinfo/definitions/America/Cayenne.rb +14 -14
- data/lib/tzinfo/definitions/America/Cayman.rb +14 -14
- data/lib/tzinfo/definitions/America/Chicago.rb +274 -267
- data/lib/tzinfo/definitions/America/Chihuahua.rb +128 -120
- data/lib/tzinfo/definitions/America/Coral_Harbour.rb +20 -20
- data/lib/tzinfo/definitions/America/Cordoba.rb +11 -11
- data/lib/tzinfo/definitions/America/Costa_Rica.rb +22 -22
- data/lib/tzinfo/definitions/America/Cuiaba.rb +163 -156
- data/lib/tzinfo/definitions/America/Curacao.rb +14 -14
- data/lib/tzinfo/definitions/America/Danmarkshavn.rb +46 -46
- data/lib/tzinfo/definitions/America/Dawson.rb +165 -154
- data/lib/tzinfo/definitions/America/Dawson_Creek.rb +70 -70
- data/lib/tzinfo/definitions/America/Denver.rb +196 -189
- data/lib/tzinfo/definitions/America/Detroit.rb +177 -169
- data/lib/tzinfo/definitions/America/Dominica.rb +13 -13
- data/lib/tzinfo/definitions/America/Edmonton.rb +192 -181
- data/lib/tzinfo/definitions/America/Eirunepe.rb +43 -46
- data/lib/tzinfo/definitions/America/El_Salvador.rb +17 -17
- data/lib/tzinfo/definitions/America/Ensenada.rb +11 -11
- data/lib/tzinfo/definitions/America/Fort_Wayne.rb +11 -11
- data/lib/tzinfo/definitions/America/Fortaleza.rb +51 -55
- data/lib/tzinfo/definitions/America/Glace_Bay.rb +178 -171
- data/lib/tzinfo/definitions/America/Godthab.rb +155 -145
- data/lib/tzinfo/definitions/America/Goose_Bay.rb +242 -236
- data/lib/tzinfo/definitions/America/Grand_Turk.rb +158 -148
- data/lib/tzinfo/definitions/America/Grenada.rb +13 -13
- data/lib/tzinfo/definitions/America/Guadeloupe.rb +13 -13
- data/lib/tzinfo/definitions/America/Guatemala.rb +19 -19
- data/lib/tzinfo/definitions/America/Guayaquil.rb +14 -14
- data/lib/tzinfo/definitions/America/Guyana.rb +16 -16
- data/lib/tzinfo/definitions/America/Halifax.rb +266 -259
- data/lib/tzinfo/definitions/America/Havana.rb +194 -184
- data/lib/tzinfo/definitions/America/Hermosillo.rb +27 -28
- data/lib/tzinfo/definitions/America/Indiana/Indianapolis.rb +139 -134
- data/lib/tzinfo/definitions/America/Indiana/Knox.rb +194 -184
- data/lib/tzinfo/definitions/America/Indiana/Marengo.rb +143 -136
- data/lib/tzinfo/definitions/America/Indiana/Petersburg.rb +156 -146
- data/lib/tzinfo/definitions/America/Indiana/Vevay.rb +121 -113
- data/lib/tzinfo/definitions/America/Indiana/Vincennes.rb +141 -133
- data/lib/tzinfo/definitions/America/Indianapolis.rb +11 -11
- data/lib/tzinfo/definitions/America/Inuvik.rb +165 -154
- data/lib/tzinfo/definitions/America/Iqaluit.rb +164 -153
- data/lib/tzinfo/definitions/America/Jamaica.rb +34 -34
- data/lib/tzinfo/definitions/America/Jujuy.rb +11 -11
- data/lib/tzinfo/definitions/America/Juneau.rb +182 -174
- data/lib/tzinfo/definitions/America/Kentucky/Louisville.rb +218 -211
- data/lib/tzinfo/definitions/America/Kentucky/Monticello.rb +188 -179
- data/lib/tzinfo/definitions/America/Knox_IN.rb +11 -11
- data/lib/tzinfo/definitions/America/La_Paz.rb +15 -15
- data/lib/tzinfo/definitions/America/Lima.rb +28 -28
- data/lib/tzinfo/definitions/America/Los_Angeles.rb +224 -215
- data/lib/tzinfo/definitions/America/Louisville.rb +11 -11
- data/lib/tzinfo/definitions/America/Maceio.rb +53 -59
- data/lib/tzinfo/definitions/America/Managua.rb +26 -26
- data/lib/tzinfo/definitions/America/Manaus.rb +43 -46
- data/lib/tzinfo/definitions/America/Martinique.rb +16 -16
- data/lib/tzinfo/definitions/America/Mazatlan.rb +131 -121
- data/lib/tzinfo/definitions/America/Mendoza.rb +11 -11
- data/lib/tzinfo/definitions/America/Menominee.rb +181 -171
- data/lib/tzinfo/definitions/America/Merida.rb +125 -115
- data/lib/tzinfo/definitions/America/Mexico_City.rb +136 -127
- data/lib/tzinfo/definitions/America/Miquelon.rb +142 -133
- data/lib/tzinfo/definitions/America/Moncton.rb +245 -239
- data/lib/tzinfo/definitions/America/Monterrey.rb +125 -117
- data/lib/tzinfo/definitions/America/Montevideo.rb +81 -80
- data/lib/tzinfo/definitions/America/Montreal.rb +271 -264
- data/lib/tzinfo/definitions/America/Montserrat.rb +13 -13
- data/lib/tzinfo/definitions/America/Nassau.rb +187 -177
- data/lib/tzinfo/definitions/America/New_York.rb +274 -267
- data/lib/tzinfo/definitions/America/Nipigon.rb +173 -162
- data/lib/tzinfo/definitions/America/Nome.rb +183 -175
- data/lib/tzinfo/definitions/America/Noronha.rb +51 -55
- data/lib/tzinfo/definitions/America/North_Dakota/Center.rb +190 -179
- data/lib/tzinfo/definitions/America/North_Dakota/New_Salem.rb +190 -0
- data/lib/tzinfo/definitions/America/Panama.rb +14 -14
- data/lib/tzinfo/definitions/America/Pangnirtung.rb +164 -153
- data/lib/tzinfo/definitions/America/Paramaribo.rb +17 -17
- data/lib/tzinfo/definitions/America/Phoenix.rb +23 -25
- data/lib/tzinfo/definitions/America/Port__m__au__m__Prince.rb +46 -46
- data/lib/tzinfo/definitions/America/Port_of_Spain.rb +13 -13
- data/lib/tzinfo/definitions/America/Porto_Acre.rb +11 -11
- data/lib/tzinfo/definitions/America/Porto_Velho.rb +41 -42
- data/lib/tzinfo/definitions/America/Puerto_Rico.rb +16 -15
- data/lib/tzinfo/definitions/America/Rainy_River.rb +173 -162
- data/lib/tzinfo/definitions/America/Rankin_Inlet.rb +164 -153
- data/lib/tzinfo/definitions/America/Recife.rb +51 -55
- data/lib/tzinfo/definitions/America/Regina.rb +65 -64
- data/lib/tzinfo/definitions/America/Rio_Branco.rb +41 -42
- data/lib/tzinfo/definitions/America/Rosario.rb +11 -11
- data/lib/tzinfo/definitions/America/Santiago.rb +195 -186
- data/lib/tzinfo/definitions/America/Santo_Domingo.rb +29 -29
- data/lib/tzinfo/definitions/America/Sao_Paulo.rb +165 -157
- data/lib/tzinfo/definitions/America/Scoresbysund.rb +155 -145
- data/lib/tzinfo/definitions/America/Shiprock.rb +11 -11
- data/lib/tzinfo/definitions/America/St_Johns.rb +277 -270
- data/lib/tzinfo/definitions/America/St_Kitts.rb +13 -13
- data/lib/tzinfo/definitions/America/St_Lucia.rb +14 -14
- data/lib/tzinfo/definitions/America/St_Thomas.rb +13 -13
- data/lib/tzinfo/definitions/America/St_Vincent.rb +14 -14
- data/lib/tzinfo/definitions/America/Swift_Current.rb +35 -34
- data/lib/tzinfo/definitions/America/Tegucigalpa.rb +17 -17
- data/lib/tzinfo/definitions/America/Thule.rb +133 -123
- data/lib/tzinfo/definitions/America/Thunder_Bay.rb +177 -170
- data/lib/tzinfo/definitions/America/Tijuana.rb +187 -182
- data/lib/tzinfo/definitions/America/Toronto.rb +271 -263
- data/lib/tzinfo/definitions/America/Tortola.rb +13 -13
- data/lib/tzinfo/definitions/America/Vancouver.rb +228 -217
- data/lib/tzinfo/definitions/America/Virgin.rb +11 -11
- data/lib/tzinfo/definitions/America/Whitehorse.rb +165 -154
- data/lib/tzinfo/definitions/America/Winnipeg.rb +224 -213
- data/lib/tzinfo/definitions/America/Yakutat.rb +182 -174
- data/lib/tzinfo/definitions/America/Yellowknife.rb +164 -153
- data/lib/tzinfo/definitions/Antarctica/Casey.rb +13 -13
- data/lib/tzinfo/definitions/Antarctica/Davis.rb +15 -15
- data/lib/tzinfo/definitions/Antarctica/DumontDUrville.rb +15 -15
- data/lib/tzinfo/definitions/Antarctica/Mawson.rb +13 -13
- data/lib/tzinfo/definitions/Antarctica/McMurdo.rb +165 -156
- data/lib/tzinfo/definitions/Antarctica/Palmer.rb +168 -158
- data/lib/tzinfo/definitions/Antarctica/Rothera.rb +13 -13
- data/lib/tzinfo/definitions/Antarctica/South_Pole.rb +11 -11
- data/lib/tzinfo/definitions/Antarctica/Syowa.rb +13 -13
- data/lib/tzinfo/definitions/Antarctica/Vostok.rb +13 -13
- data/lib/tzinfo/definitions/Arctic/Longyearbyen.rb +11 -11
- data/lib/tzinfo/definitions/Asia/Aden.rb +13 -13
- data/lib/tzinfo/definitions/Asia/Almaty.rb +60 -63
- data/lib/tzinfo/definitions/Asia/Amman.rb +157 -147
- data/lib/tzinfo/definitions/Asia/Anadyr.rb +155 -145
- data/lib/tzinfo/definitions/Asia/Aqtau.rb +62 -63
- data/lib/tzinfo/definitions/Asia/Aqtobe.rb +61 -63
- data/lib/tzinfo/definitions/Asia/Ashgabat.rb +38 -38
- data/lib/tzinfo/definitions/Asia/Ashkhabad.rb +11 -11
- data/lib/tzinfo/definitions/Asia/Baghdad.rb +152 -142
- data/lib/tzinfo/definitions/Asia/Bahrain.rb +14 -14
- data/lib/tzinfo/definitions/Asia/Baku.rb +149 -141
- data/lib/tzinfo/definitions/Asia/Bangkok.rb +14 -14
- data/lib/tzinfo/definitions/Asia/Beirut.rb +179 -169
- data/lib/tzinfo/definitions/Asia/Bishkek.rb +64 -63
- data/lib/tzinfo/definitions/Asia/Brunei.rb +14 -14
- data/lib/tzinfo/definitions/Asia/Calcutta.rb +17 -17
- data/lib/tzinfo/definitions/Asia/Choibalsan.rb +146 -136
- data/lib/tzinfo/definitions/Asia/Chongqing.rb +26 -26
- data/lib/tzinfo/definitions/Asia/Chungking.rb +11 -11
- data/lib/tzinfo/definitions/Asia/Colombo.rb +20 -19
- data/lib/tzinfo/definitions/Asia/Dacca.rb +11 -11
- data/lib/tzinfo/definitions/Asia/Damascus.rb +189 -179
- data/lib/tzinfo/definitions/Asia/Dhaka.rb +18 -18
- data/lib/tzinfo/definitions/Asia/Dili.rb +17 -17
- data/lib/tzinfo/definitions/Asia/Dubai.rb +13 -13
- data/lib/tzinfo/definitions/Asia/Dushanbe.rb +36 -36
- data/lib/tzinfo/definitions/Asia/Gaza.rb +182 -173
- data/lib/tzinfo/definitions/Asia/Harbin.rb +29 -29
- data/lib/tzinfo/definitions/Asia/Hong_Kong.rb +81 -81
- data/lib/tzinfo/definitions/Asia/Hovd.rb +146 -136
- data/lib/tzinfo/definitions/Asia/Irkutsk.rb +156 -146
- data/lib/tzinfo/definitions/Asia/Istanbul.rb +11 -11
- data/lib/tzinfo/definitions/Asia/Jakarta.rb +20 -20
- data/lib/tzinfo/definitions/Asia/Jayapura.rb +15 -15
- data/lib/tzinfo/definitions/Asia/Jerusalem.rb +155 -155
- data/lib/tzinfo/definitions/Asia/Kabul.rb +14 -14
- data/lib/tzinfo/definitions/Asia/Kamchatka.rb +155 -145
- data/lib/tzinfo/definitions/Asia/Karachi.rb +19 -19
- data/lib/tzinfo/definitions/Asia/Kashgar.rb +27 -27
- data/lib/tzinfo/definitions/Asia/Katmandu.rb +14 -14
- data/lib/tzinfo/definitions/Asia/Krasnoyarsk.rb +155 -145
- data/lib/tzinfo/definitions/Asia/Kuala_Lumpur.rb +20 -20
- data/lib/tzinfo/definitions/Asia/Kuching.rb +31 -31
- data/lib/tzinfo/definitions/Asia/Kuwait.rb +13 -13
- data/lib/tzinfo/definitions/Asia/Macao.rb +11 -11
- data/lib/tzinfo/definitions/Asia/Macau.rb +54 -54
- data/lib/tzinfo/definitions/Asia/Magadan.rb +155 -145
- data/lib/tzinfo/definitions/Asia/Makassar.rb +16 -16
- data/lib/tzinfo/definitions/Asia/Manila.rb +22 -22
- data/lib/tzinfo/definitions/Asia/Muscat.rb +13 -13
- data/lib/tzinfo/definitions/Asia/Nicosia.rb +165 -156
- data/lib/tzinfo/definitions/Asia/Novosibirsk.rb +156 -146
- data/lib/tzinfo/definitions/Asia/Omsk.rb +155 -145
- data/lib/tzinfo/definitions/Asia/Oral.rb +62 -63
- data/lib/tzinfo/definitions/Asia/Phnom_Penh.rb +16 -16
- data/lib/tzinfo/definitions/Asia/Pontianak.rb +20 -20
- data/lib/tzinfo/definitions/Asia/Pyongyang.rb +18 -18
- data/lib/tzinfo/definitions/Asia/Qatar.rb +14 -14
- data/lib/tzinfo/definitions/Asia/Qyzylorda.rb +62 -64
- data/lib/tzinfo/definitions/Asia/Rangoon.rb +16 -16
- data/lib/tzinfo/definitions/Asia/Riyadh.rb +13 -13
- data/lib/tzinfo/definitions/Asia/Riyadh87.rb +348 -0
- data/lib/tzinfo/definitions/Asia/Riyadh88.rb +349 -0
- data/lib/tzinfo/definitions/Asia/Riyadh89.rb +349 -0
- data/lib/tzinfo/definitions/Asia/Saigon.rb +16 -16
- data/lib/tzinfo/definitions/Asia/Sakhalin.rb +156 -146
- data/lib/tzinfo/definitions/Asia/Samarkand.rb +37 -41
- data/lib/tzinfo/definitions/Asia/Seoul.rb +25 -25
- data/lib/tzinfo/definitions/Asia/Shanghai.rb +29 -30
- data/lib/tzinfo/definitions/Asia/Singapore.rb +21 -21
- data/lib/tzinfo/definitions/Asia/Taipei.rb +53 -53
- data/lib/tzinfo/definitions/Asia/Tashkent.rb +37 -41
- data/lib/tzinfo/definitions/Asia/Tbilisi.rb +65 -67
- data/lib/tzinfo/definitions/Asia/Tehran.rb +52 -116
- data/lib/tzinfo/definitions/Asia/Tel_Aviv.rb +11 -11
- data/lib/tzinfo/definitions/Asia/Thimbu.rb +11 -11
- data/lib/tzinfo/definitions/Asia/Thimphu.rb +14 -14
- data/lib/tzinfo/definitions/Asia/Tokyo.rb +23 -23
- data/lib/tzinfo/definitions/Asia/Ujung_Pandang.rb +11 -11
- data/lib/tzinfo/definitions/Asia/Ulaanbaatar.rb +146 -136
- data/lib/tzinfo/definitions/Asia/Ulan_Bator.rb +11 -11
- data/lib/tzinfo/definitions/Asia/Urumqi.rb +26 -26
- data/lib/tzinfo/definitions/Asia/Vientiane.rb +16 -16
- data/lib/tzinfo/definitions/Asia/Vladivostok.rb +155 -145
- data/lib/tzinfo/definitions/Asia/Yakutsk.rb +155 -145
- data/lib/tzinfo/definitions/Asia/Yekaterinburg.rb +155 -145
- data/lib/tzinfo/definitions/Asia/Yerevan.rb +153 -144
- data/lib/tzinfo/definitions/Atlantic/Azores.rb +259 -249
- data/lib/tzinfo/definitions/Atlantic/Bermuda.rb +167 -157
- data/lib/tzinfo/definitions/Atlantic/Canary.rb +156 -147
- data/lib/tzinfo/definitions/Atlantic/Cape_Verde.rb +16 -16
- data/lib/tzinfo/definitions/Atlantic/Faeroe.rb +153 -144
- data/lib/tzinfo/definitions/Atlantic/Jan_Mayen.rb +11 -11
- data/lib/tzinfo/definitions/Atlantic/Madeira.rb +259 -249
- data/lib/tzinfo/definitions/Atlantic/Reykjavik.rb +77 -77
- data/lib/tzinfo/definitions/Atlantic/South_Georgia.rb +13 -13
- data/lib/tzinfo/definitions/Atlantic/St_Helena.rb +14 -14
- data/lib/tzinfo/definitions/Atlantic/Stanley.rb +161 -152
- data/lib/tzinfo/definitions/Australia/ACT.rb +11 -11
- data/lib/tzinfo/definitions/Australia/Adelaide.rb +180 -172
- data/lib/tzinfo/definitions/Australia/Brisbane.rb +29 -30
- data/lib/tzinfo/definitions/Australia/Broken_Hill.rb +181 -174
- data/lib/tzinfo/definitions/Australia/Canberra.rb +11 -11
- data/lib/tzinfo/definitions/Australia/Currie.rb +179 -172
- data/lib/tzinfo/definitions/Australia/Darwin.rb +22 -22
- data/lib/tzinfo/definitions/Australia/Hobart.rb +187 -180
- data/lib/tzinfo/definitions/Australia/LHI.rb +11 -11
- data/lib/tzinfo/definitions/Australia/Lindeman.rb +33 -35
- data/lib/tzinfo/definitions/Australia/Lord_Howe.rb +152 -143
- data/lib/tzinfo/definitions/Australia/Melbourne.rb +179 -171
- data/lib/tzinfo/definitions/Australia/NSW.rb +11 -11
- data/lib/tzinfo/definitions/Australia/North.rb +11 -11
- data/lib/tzinfo/definitions/Australia/Perth.rb +25 -26
- data/lib/tzinfo/definitions/Australia/Queensland.rb +11 -11
- data/lib/tzinfo/definitions/Australia/South.rb +11 -11
- data/lib/tzinfo/definitions/Australia/Sydney.rb +179 -171
- data/lib/tzinfo/definitions/Australia/Tasmania.rb +11 -11
- data/lib/tzinfo/definitions/Australia/Victoria.rb +11 -11
- data/lib/tzinfo/definitions/Australia/West.rb +11 -11
- data/lib/tzinfo/definitions/Australia/Yancowinna.rb +11 -11
- data/lib/tzinfo/definitions/Brazil/Acre.rb +11 -11
- data/lib/tzinfo/definitions/Brazil/DeNoronha.rb +11 -11
- data/lib/tzinfo/definitions/Brazil/East.rb +11 -11
- data/lib/tzinfo/definitions/Brazil/West.rb +11 -11
- data/lib/tzinfo/definitions/CET.rb +170 -160
- data/lib/tzinfo/definitions/CST6CDT.rb +185 -174
- data/lib/tzinfo/definitions/Canada/Atlantic.rb +11 -11
- data/lib/tzinfo/definitions/Canada/Central.rb +11 -11
- data/lib/tzinfo/definitions/Canada/East__m__Saskatchewan.rb +11 -11
- data/lib/tzinfo/definitions/Canada/Eastern.rb +11 -11
- data/lib/tzinfo/definitions/Canada/Mountain.rb +11 -11
- data/lib/tzinfo/definitions/Canada/Newfoundland.rb +11 -11
- data/lib/tzinfo/definitions/Canada/Pacific.rb +11 -11
- data/lib/tzinfo/definitions/Canada/Saskatchewan.rb +11 -11
- data/lib/tzinfo/definitions/Canada/Yukon.rb +11 -11
- data/lib/tzinfo/definitions/Chile/Continental.rb +11 -11
- data/lib/tzinfo/definitions/Chile/EasterIsland.rb +11 -11
- data/lib/tzinfo/definitions/Cuba.rb +9 -9
- data/lib/tzinfo/definitions/EET.rb +158 -148
- data/lib/tzinfo/definitions/EST.rb +10 -10
- data/lib/tzinfo/definitions/EST5EDT.rb +185 -174
- data/lib/tzinfo/definitions/Egypt.rb +9 -9
- data/lib/tzinfo/definitions/Eire.rb +9 -9
- data/lib/tzinfo/definitions/Etc/GMT.rb +12 -12
- data/lib/tzinfo/definitions/Etc/GMT0.rb +11 -11
- data/lib/tzinfo/definitions/Etc/GMT__m__0.rb +11 -11
- data/lib/tzinfo/definitions/Etc/GMT__m__1.rb +12 -12
- data/lib/tzinfo/definitions/Etc/GMT__m__10.rb +12 -12
- data/lib/tzinfo/definitions/Etc/GMT__m__11.rb +12 -12
- data/lib/tzinfo/definitions/Etc/GMT__m__12.rb +12 -12
- data/lib/tzinfo/definitions/Etc/GMT__m__13.rb +12 -12
- data/lib/tzinfo/definitions/Etc/GMT__m__14.rb +12 -12
- data/lib/tzinfo/definitions/Etc/GMT__m__2.rb +12 -12
- data/lib/tzinfo/definitions/Etc/GMT__m__3.rb +12 -12
- data/lib/tzinfo/definitions/Etc/GMT__m__4.rb +12 -12
- data/lib/tzinfo/definitions/Etc/GMT__m__5.rb +12 -12
- data/lib/tzinfo/definitions/Etc/GMT__m__6.rb +12 -12
- data/lib/tzinfo/definitions/Etc/GMT__m__7.rb +12 -12
- data/lib/tzinfo/definitions/Etc/GMT__m__8.rb +12 -12
- data/lib/tzinfo/definitions/Etc/GMT__m__9.rb +12 -12
- data/lib/tzinfo/definitions/Etc/GMT__p__0.rb +11 -11
- data/lib/tzinfo/definitions/Etc/GMT__p__1.rb +12 -12
- data/lib/tzinfo/definitions/Etc/GMT__p__10.rb +12 -12
- data/lib/tzinfo/definitions/Etc/GMT__p__11.rb +12 -12
- data/lib/tzinfo/definitions/Etc/GMT__p__12.rb +12 -12
- data/lib/tzinfo/definitions/Etc/GMT__p__2.rb +12 -12
- data/lib/tzinfo/definitions/Etc/GMT__p__3.rb +12 -12
- data/lib/tzinfo/definitions/Etc/GMT__p__4.rb +12 -12
- data/lib/tzinfo/definitions/Etc/GMT__p__5.rb +12 -12
- data/lib/tzinfo/definitions/Etc/GMT__p__6.rb +12 -12
- data/lib/tzinfo/definitions/Etc/GMT__p__7.rb +12 -12
- data/lib/tzinfo/definitions/Etc/GMT__p__8.rb +12 -12
- data/lib/tzinfo/definitions/Etc/GMT__p__9.rb +12 -12
- data/lib/tzinfo/definitions/Etc/Greenwich.rb +11 -11
- data/lib/tzinfo/definitions/Etc/UCT.rb +12 -12
- data/lib/tzinfo/definitions/Etc/UTC.rb +12 -12
- data/lib/tzinfo/definitions/Etc/Universal.rb +11 -11
- data/lib/tzinfo/definitions/Etc/Zulu.rb +11 -11
- data/lib/tzinfo/definitions/Europe/Amsterdam.rb +218 -208
- data/lib/tzinfo/definitions/Europe/Andorra.rb +146 -136
- data/lib/tzinfo/definitions/Europe/Athens.rb +176 -167
- data/lib/tzinfo/definitions/Europe/Belfast.rb +11 -11
- data/lib/tzinfo/definitions/Europe/Belgrade.rb +157 -147
- data/lib/tzinfo/definitions/Europe/Berlin.rb +181 -172
- data/lib/tzinfo/definitions/Europe/Bratislava.rb +11 -11
- data/lib/tzinfo/definitions/Europe/Brussels.rb +223 -214
- data/lib/tzinfo/definitions/Europe/Bucharest.rb +174 -167
- data/lib/tzinfo/definitions/Europe/Budapest.rb +191 -181
- data/lib/tzinfo/definitions/Europe/Chisinau.rb +177 -170
- data/lib/tzinfo/definitions/Europe/Copenhagen.rb +172 -163
- data/lib/tzinfo/definitions/Europe/Dublin.rb +265 -257
- data/lib/tzinfo/definitions/Europe/Gibraltar.rb +236 -227
- data/lib/tzinfo/definitions/Europe/Helsinki.rb +156 -147
- data/lib/tzinfo/definitions/Europe/Istanbul.rb +209 -201
- data/lib/tzinfo/definitions/Europe/Kaliningrad.rb +169 -159
- data/lib/tzinfo/definitions/Europe/Kiev.rb +157 -149
- data/lib/tzinfo/definitions/Europe/Lisbon.rb +259 -250
- data/lib/tzinfo/definitions/Europe/Ljubljana.rb +11 -11
- data/lib/tzinfo/definitions/Europe/London.rb +279 -271
- data/lib/tzinfo/definitions/Europe/Luxembourg.rb +221 -211
- data/lib/tzinfo/definitions/Europe/Madrid.rb +202 -193
- data/lib/tzinfo/definitions/Europe/Malta.rb +207 -198
- data/lib/tzinfo/definitions/Europe/Mariehamn.rb +11 -11
- data/lib/tzinfo/definitions/Europe/Minsk.rb +159 -147
- data/lib/tzinfo/definitions/Europe/Monaco.rb +223 -214
- data/lib/tzinfo/definitions/Europe/Moscow.rb +168 -158
- data/lib/tzinfo/definitions/Europe/Nicosia.rb +11 -11
- data/lib/tzinfo/definitions/Europe/Oslo.rb +179 -169
- data/lib/tzinfo/definitions/Europe/Paris.rb +222 -212
- data/lib/tzinfo/definitions/Europe/Prague.rb +180 -170
- data/lib/tzinfo/definitions/Europe/Riga.rb +164 -156
- data/lib/tzinfo/definitions/Europe/Rome.rb +208 -200
- data/lib/tzinfo/definitions/Europe/Samara.rb +155 -145
- data/lib/tzinfo/definitions/Europe/San_Marino.rb +11 -11
- data/lib/tzinfo/definitions/Europe/Sarajevo.rb +11 -11
- data/lib/tzinfo/definitions/Europe/Simferopol.rb +159 -151
- data/lib/tzinfo/definitions/Europe/Skopje.rb +11 -11
- data/lib/tzinfo/definitions/Europe/Sofia.rb +164 -157
- data/lib/tzinfo/definitions/Europe/Stockholm.rb +158 -149
- data/lib/tzinfo/definitions/Europe/Tallinn.rb +161 -152
- data/lib/tzinfo/definitions/Europe/Tirane.rb +171 -162
- data/lib/tzinfo/definitions/Europe/Tiraspol.rb +11 -11
- data/lib/tzinfo/definitions/Europe/Uzhgorod.rb +158 -153
- data/lib/tzinfo/definitions/Europe/Vaduz.rb +153 -144
- data/lib/tzinfo/definitions/Europe/Vatican.rb +11 -11
- data/lib/tzinfo/definitions/Europe/Vienna.rb +177 -170
- data/lib/tzinfo/definitions/Europe/Vilnius.rb +158 -148
- data/lib/tzinfo/definitions/Europe/Warsaw.rb +203 -195
- data/lib/tzinfo/definitions/Europe/Zagreb.rb +11 -11
- data/lib/tzinfo/definitions/Europe/Zaporozhye.rb +160 -150
- data/lib/tzinfo/definitions/Europe/Zurich.rb +160 -151
- data/lib/tzinfo/definitions/GB.rb +9 -9
- data/lib/tzinfo/definitions/GB__m__Eire.rb +9 -9
- data/lib/tzinfo/definitions/GMT.rb +9 -9
- data/lib/tzinfo/definitions/GMT0.rb +9 -9
- data/lib/tzinfo/definitions/GMT__m__0.rb +9 -9
- data/lib/tzinfo/definitions/GMT__p__0.rb +9 -9
- data/lib/tzinfo/definitions/Greenwich.rb +9 -9
- data/lib/tzinfo/definitions/HST.rb +10 -10
- data/lib/tzinfo/definitions/Hongkong.rb +9 -9
- data/lib/tzinfo/definitions/Iceland.rb +9 -9
- data/lib/tzinfo/definitions/Indian/Antananarivo.rb +15 -15
- data/lib/tzinfo/definitions/Indian/Chagos.rb +14 -14
- data/lib/tzinfo/definitions/Indian/Christmas.rb +13 -13
- data/lib/tzinfo/definitions/Indian/Cocos.rb +13 -13
- data/lib/tzinfo/definitions/Indian/Comoro.rb +13 -13
- data/lib/tzinfo/definitions/Indian/Kerguelen.rb +13 -13
- data/lib/tzinfo/definitions/Indian/Mahe.rb +13 -13
- data/lib/tzinfo/definitions/Indian/Maldives.rb +14 -14
- data/lib/tzinfo/definitions/Indian/Mauritius.rb +13 -13
- data/lib/tzinfo/definitions/Indian/Mayotte.rb +13 -13
- data/lib/tzinfo/definitions/Indian/Reunion.rb +13 -13
- data/lib/tzinfo/definitions/Iran.rb +9 -9
- data/lib/tzinfo/definitions/Israel.rb +9 -9
- data/lib/tzinfo/definitions/Jamaica.rb +9 -9
- data/lib/tzinfo/definitions/Japan.rb +9 -9
- data/lib/tzinfo/definitions/Kwajalein.rb +9 -9
- data/lib/tzinfo/definitions/Libya.rb +9 -9
- data/lib/tzinfo/definitions/MET.rb +170 -160
- data/lib/tzinfo/definitions/MST.rb +10 -10
- data/lib/tzinfo/definitions/MST7MDT.rb +185 -174
- data/lib/tzinfo/definitions/Mexico/BajaNorte.rb +11 -11
- data/lib/tzinfo/definitions/Mexico/BajaSur.rb +11 -11
- data/lib/tzinfo/definitions/Mexico/General.rb +11 -11
- data/lib/tzinfo/definitions/Mideast/Riyadh87.rb +11 -0
- data/lib/tzinfo/definitions/Mideast/Riyadh88.rb +11 -0
- data/lib/tzinfo/definitions/Mideast/Riyadh89.rb +11 -0
- data/lib/tzinfo/definitions/NZ.rb +9 -9
- data/lib/tzinfo/definitions/NZ__m__CHAT.rb +9 -9
- data/lib/tzinfo/definitions/Navajo.rb +9 -9
- data/lib/tzinfo/definitions/PRC.rb +9 -9
- data/lib/tzinfo/definitions/PST8PDT.rb +185 -174
- data/lib/tzinfo/definitions/Pacific/Apia.rb +15 -15
- data/lib/tzinfo/definitions/Pacific/Auckland.rb +192 -184
- data/lib/tzinfo/definitions/Pacific/Chatham.rb +165 -156
- data/lib/tzinfo/definitions/Pacific/Easter.rb +182 -174
- data/lib/tzinfo/definitions/Pacific/Efate.rb +33 -33
- data/lib/tzinfo/definitions/Pacific/Enderbury.rb +15 -15
- data/lib/tzinfo/definitions/Pacific/Fakaofo.rb +13 -13
- data/lib/tzinfo/definitions/Pacific/Fiji.rb +17 -17
- data/lib/tzinfo/definitions/Pacific/Funafuti.rb +13 -13
- data/lib/tzinfo/definitions/Pacific/Galapagos.rb +14 -14
- data/lib/tzinfo/definitions/Pacific/Gambier.rb +13 -13
- data/lib/tzinfo/definitions/Pacific/Guadalcanal.rb +13 -13
- data/lib/tzinfo/definitions/Pacific/Guam.rb +15 -15
- data/lib/tzinfo/definitions/Pacific/Honolulu.rb +19 -17
- data/lib/tzinfo/definitions/Pacific/Johnston.rb +12 -12
- data/lib/tzinfo/definitions/Pacific/Kiritimati.rb +15 -15
- data/lib/tzinfo/definitions/Pacific/Kosrae.rb +15 -15
- data/lib/tzinfo/definitions/Pacific/Kwajalein.rb +15 -15
- data/lib/tzinfo/definitions/Pacific/Majuro.rb +14 -14
- data/lib/tzinfo/definitions/Pacific/Marquesas.rb +13 -13
- data/lib/tzinfo/definitions/Pacific/Midway.rb +17 -17
- data/lib/tzinfo/definitions/Pacific/Nauru.rb +16 -16
- data/lib/tzinfo/definitions/Pacific/Niue.rb +15 -15
- data/lib/tzinfo/definitions/Pacific/Norfolk.rb +14 -14
- data/lib/tzinfo/definitions/Pacific/Noumea.rb +19 -19
- data/lib/tzinfo/definitions/Pacific/Pago_Pago.rb +17 -17
- data/lib/tzinfo/definitions/Pacific/Palau.rb +13 -13
- data/lib/tzinfo/definitions/Pacific/Pitcairn.rb +14 -14
- data/lib/tzinfo/definitions/Pacific/Ponape.rb +13 -13
- data/lib/tzinfo/definitions/Pacific/Port_Moresby.rb +14 -14
- data/lib/tzinfo/definitions/Pacific/Rarotonga.rb +39 -39
- data/lib/tzinfo/definitions/Pacific/Saipan.rb +16 -16
- data/lib/tzinfo/definitions/Pacific/Samoa.rb +11 -11
- data/lib/tzinfo/definitions/Pacific/Tahiti.rb +13 -13
- data/lib/tzinfo/definitions/Pacific/Tarawa.rb +13 -13
- data/lib/tzinfo/definitions/Pacific/Tongatapu.rb +20 -21
- data/lib/tzinfo/definitions/Pacific/Truk.rb +13 -13
- data/lib/tzinfo/definitions/Pacific/Wake.rb +13 -13
- data/lib/tzinfo/definitions/Pacific/Wallis.rb +13 -13
- data/lib/tzinfo/definitions/Pacific/Yap.rb +11 -11
- data/lib/tzinfo/definitions/Poland.rb +9 -9
- data/lib/tzinfo/definitions/Portugal.rb +9 -9
- data/lib/tzinfo/definitions/ROC.rb +9 -9
- data/lib/tzinfo/definitions/ROK.rb +9 -9
- data/lib/tzinfo/definitions/Singapore.rb +9 -9
- data/lib/tzinfo/definitions/Turkey.rb +9 -9
- data/lib/tzinfo/definitions/UCT.rb +9 -9
- data/lib/tzinfo/definitions/US/Alaska.rb +11 -11
- data/lib/tzinfo/definitions/US/Aleutian.rb +11 -11
- data/lib/tzinfo/definitions/US/Arizona.rb +11 -11
- data/lib/tzinfo/definitions/US/Central.rb +11 -11
- data/lib/tzinfo/definitions/US/East__m__Indiana.rb +11 -11
- data/lib/tzinfo/definitions/US/Eastern.rb +11 -11
- data/lib/tzinfo/definitions/US/Hawaii.rb +11 -11
- data/lib/tzinfo/definitions/US/Indiana__m__Starke.rb +11 -11
- data/lib/tzinfo/definitions/US/Michigan.rb +11 -11
- data/lib/tzinfo/definitions/US/Mountain.rb +11 -11
- data/lib/tzinfo/definitions/US/Pacific.rb +11 -11
- data/lib/tzinfo/definitions/US/Pacific__m__New.rb +11 -11
- data/lib/tzinfo/definitions/US/Samoa.rb +11 -11
- data/lib/tzinfo/definitions/UTC.rb +9 -9
- data/lib/tzinfo/definitions/Universal.rb +9 -9
- data/lib/tzinfo/definitions/WET.rb +158 -148
- data/lib/tzinfo/definitions/W__m__SU.rb +9 -9
- data/lib/tzinfo/definitions/Zulu.rb +9 -9
- data/lib/tzinfo/offset_rationals.rb +95 -0
- data/lib/tzinfo/time_or_datetime.rb +269 -0
- data/lib/tzinfo/timezone.rb +25 -44
- data/lib/tzinfo/timezone_period.rb +54 -87
- data/lib/tzinfo/timezone_period_list.rb +7 -2
- data/lib/tzinfo/tzdataparser.rb +378 -325
- data/test/tc_offset_rationals.rb +25 -0
- data/test/tc_time_or_datetime.rb +386 -0
- data/test/tc_timezone.rb +43 -7
- data/test/tc_timezone_london.rb +61 -1
- data/test/tc_timezone_melbourne.rb +61 -1
- data/test/tc_timezone_new_york.rb +61 -1
- data/test/tc_timezone_period.rb +152 -65
- data/test/ts_all.rb +4 -0
- metadata +14 -2
@@ -0,0 +1,25 @@
|
|
1
|
+
$:.unshift File.join(File.dirname(__FILE__), "..", "lib")
|
2
|
+
require 'test/unit'
|
3
|
+
require 'tzinfo/offset_rationals'
|
4
|
+
|
5
|
+
include TZInfo
|
6
|
+
|
7
|
+
class TCOffsetRationals < Test::Unit::TestCase
|
8
|
+
def test_rational_for_offset
|
9
|
+
[0,1,2,3,4,-1,-2,-3,-4,30*60,-30*60,61*60,-61*60,14*60*60,-14*60*60,20*60*60,-20*60*60].each {|seconds|
|
10
|
+
assert_equal(Rational(seconds, 86400), OffsetRationals.rational_for_offset(seconds))
|
11
|
+
}
|
12
|
+
end
|
13
|
+
|
14
|
+
def test_rational_for_offset_constant
|
15
|
+
-28.upto(28) {|i|
|
16
|
+
seconds = i * 30 * 60
|
17
|
+
|
18
|
+
r1 = OffsetRationals.rational_for_offset(seconds)
|
19
|
+
r2 = OffsetRationals.rational_for_offset(seconds)
|
20
|
+
|
21
|
+
assert_equal(Rational(seconds, 86400), r1)
|
22
|
+
assert_same(r1, r2)
|
23
|
+
}
|
24
|
+
end
|
25
|
+
end
|
@@ -0,0 +1,386 @@
|
|
1
|
+
$:.unshift File.join(File.dirname(__FILE__), "..", "lib")
|
2
|
+
require 'test/unit'
|
3
|
+
require 'tzinfo/time_or_datetime'
|
4
|
+
|
5
|
+
include TZInfo
|
6
|
+
|
7
|
+
class TCTimeOrDateTime < Test::Unit::TestCase
|
8
|
+
def test_initialize_time
|
9
|
+
TimeOrDateTime.new(Time.utc(2006, 3, 24, 15, 32, 3))
|
10
|
+
end
|
11
|
+
|
12
|
+
def test_initialize_time_local
|
13
|
+
tdt = TimeOrDateTime.new(Time.local(2006, 3, 24, 15, 32, 3))
|
14
|
+
assert_equal(Time.utc(2006, 3, 24, 15, 32, 3), tdt.to_time)
|
15
|
+
assert_equal('UTC', tdt.to_time.zone)
|
16
|
+
end
|
17
|
+
|
18
|
+
def test_initialize_datetime
|
19
|
+
TimeOrDateTime.new(DateTime.new(2006, 3, 24, 15, 32, 3))
|
20
|
+
end
|
21
|
+
|
22
|
+
def test_initialize_int
|
23
|
+
TimeOrDateTime.new(1143214323)
|
24
|
+
end
|
25
|
+
|
26
|
+
def test_initialize_string
|
27
|
+
TimeOrDateTime.new('1143214323')
|
28
|
+
end
|
29
|
+
|
30
|
+
def test_to_time
|
31
|
+
assert_equal(Time.utc(2006, 3, 24, 15, 32, 3),
|
32
|
+
TimeOrDateTime.new(Time.utc(2006, 3, 24, 15, 32, 3)).to_time)
|
33
|
+
assert_equal(Time.utc(2006, 3, 24, 15, 32, 3),
|
34
|
+
TimeOrDateTime.new(DateTime.new(2006, 3, 24, 15, 32, 3)).to_time)
|
35
|
+
assert_equal(Time.utc(2006, 3, 24, 15, 32, 3),
|
36
|
+
TimeOrDateTime.new(1143214323).to_time)
|
37
|
+
assert_equal(Time.utc(2006, 3, 24, 15, 32, 3),
|
38
|
+
TimeOrDateTime.new('1143214323').to_time)
|
39
|
+
end
|
40
|
+
|
41
|
+
def test_to_datetime
|
42
|
+
assert_equal(DateTime.new(2006, 3, 24, 15, 32, 3),
|
43
|
+
TimeOrDateTime.new(Time.utc(2006, 3, 24, 15, 32, 3)).to_datetime)
|
44
|
+
assert_equal(DateTime.new(2006, 3, 24, 15, 32, 3),
|
45
|
+
TimeOrDateTime.new(DateTime.new(2006, 3, 24, 15, 32, 3)).to_datetime)
|
46
|
+
assert_equal(DateTime.new(2006, 3, 24, 15, 32, 3),
|
47
|
+
TimeOrDateTime.new(1143214323).to_datetime)
|
48
|
+
assert_equal(DateTime.new(2006, 3, 24, 15, 32, 3),
|
49
|
+
TimeOrDateTime.new('1143214323').to_datetime)
|
50
|
+
end
|
51
|
+
|
52
|
+
def test_to_i
|
53
|
+
assert_equal(1143214323,
|
54
|
+
TimeOrDateTime.new(Time.utc(2006, 3, 24, 15, 32, 3)).to_i)
|
55
|
+
assert_equal(1143214323,
|
56
|
+
TimeOrDateTime.new(DateTime.new(2006, 3, 24, 15, 32, 3)).to_i)
|
57
|
+
assert_equal(1143214323,
|
58
|
+
TimeOrDateTime.new(1143214323).to_i)
|
59
|
+
assert_equal(1143214323,
|
60
|
+
TimeOrDateTime.new('1143214323').to_i)
|
61
|
+
end
|
62
|
+
|
63
|
+
def test_to_orig
|
64
|
+
assert_equal(Time.utc(2006, 3, 24, 15, 32, 3),
|
65
|
+
TimeOrDateTime.new(Time.utc(2006, 3, 24, 15, 32, 3)).to_orig)
|
66
|
+
assert_equal(DateTime.new(2006, 3, 24, 15, 32, 3),
|
67
|
+
TimeOrDateTime.new(DateTime.new(2006, 3, 24, 15, 32, 3)).to_orig)
|
68
|
+
assert_equal(1143214323,
|
69
|
+
TimeOrDateTime.new(1143214323).to_orig)
|
70
|
+
assert_equal(1143214323,
|
71
|
+
TimeOrDateTime.new('1143214323').to_orig)
|
72
|
+
end
|
73
|
+
|
74
|
+
def test_to_s
|
75
|
+
assert_equal("Time: #{Time.utc(2006, 3, 24, 15, 32, 3).to_s}",
|
76
|
+
TimeOrDateTime.new(Time.utc(2006, 3, 24, 15, 32, 3)).to_s)
|
77
|
+
assert_equal("DateTime: #{DateTime.new(2006, 3, 24, 15, 32, 3)}",
|
78
|
+
TimeOrDateTime.new(DateTime.new(2006, 3, 24, 15, 32, 3)).to_s)
|
79
|
+
assert_equal('Timestamp: 1143214323',
|
80
|
+
TimeOrDateTime.new(1143214323).to_s)
|
81
|
+
assert_equal('Timestamp: 1143214323',
|
82
|
+
TimeOrDateTime.new('1143214323').to_s)
|
83
|
+
end
|
84
|
+
|
85
|
+
def test_year
|
86
|
+
assert_equal(2006, TimeOrDateTime.new(Time.utc(2006, 3, 24, 15, 32, 3)).year)
|
87
|
+
assert_equal(2006, TimeOrDateTime.new(DateTime.new(2006, 3, 24, 15, 32, 3)).year)
|
88
|
+
assert_equal(2006, TimeOrDateTime.new(1143214323).year)
|
89
|
+
end
|
90
|
+
|
91
|
+
def test_mon
|
92
|
+
assert_equal(3, TimeOrDateTime.new(Time.utc(2006, 3, 24, 15, 32, 3)).mon)
|
93
|
+
assert_equal(3, TimeOrDateTime.new(DateTime.new(2006, 3, 24, 15, 32, 3)).mon)
|
94
|
+
assert_equal(3, TimeOrDateTime.new(1143214323).mon)
|
95
|
+
end
|
96
|
+
|
97
|
+
def test_month
|
98
|
+
assert_equal(3, TimeOrDateTime.new(Time.utc(2006, 3, 24, 15, 32, 3)).month)
|
99
|
+
assert_equal(3, TimeOrDateTime.new(DateTime.new(2006, 3, 24, 15, 32, 3)).month)
|
100
|
+
assert_equal(3, TimeOrDateTime.new(1143214323).month)
|
101
|
+
end
|
102
|
+
|
103
|
+
def test_mday
|
104
|
+
assert_equal(24, TimeOrDateTime.new(Time.utc(2006, 3, 24, 15, 32, 3)).mday)
|
105
|
+
assert_equal(24, TimeOrDateTime.new(DateTime.new(2006, 3, 24, 15, 32, 3)).mday)
|
106
|
+
assert_equal(24, TimeOrDateTime.new(1143214323).mday)
|
107
|
+
end
|
108
|
+
|
109
|
+
def test_day
|
110
|
+
assert_equal(24, TimeOrDateTime.new(Time.utc(2006, 3, 24, 15, 32, 3)).day)
|
111
|
+
assert_equal(24, TimeOrDateTime.new(DateTime.new(2006, 3, 24, 15, 32, 3)).day)
|
112
|
+
assert_equal(24, TimeOrDateTime.new(1143214323).day)
|
113
|
+
end
|
114
|
+
|
115
|
+
def test_hour
|
116
|
+
assert_equal(15, TimeOrDateTime.new(Time.utc(2006, 3, 24, 15, 32, 3)).hour)
|
117
|
+
assert_equal(15, TimeOrDateTime.new(DateTime.new(2006, 3, 24, 15, 32, 3)).hour)
|
118
|
+
assert_equal(15, TimeOrDateTime.new(1143214323).hour)
|
119
|
+
end
|
120
|
+
|
121
|
+
def test_min
|
122
|
+
assert_equal(32, TimeOrDateTime.new(Time.utc(2006, 3, 24, 15, 32, 3)).min)
|
123
|
+
assert_equal(32, TimeOrDateTime.new(DateTime.new(2006, 3, 24, 15, 32, 3)).min)
|
124
|
+
assert_equal(32, TimeOrDateTime.new(1143214323).min)
|
125
|
+
end
|
126
|
+
|
127
|
+
def test_sec
|
128
|
+
assert_equal(3, TimeOrDateTime.new(Time.utc(2006, 3, 24, 15, 32, 3)).sec)
|
129
|
+
assert_equal(3, TimeOrDateTime.new(DateTime.new(2006, 3, 24, 15, 32, 3)).sec)
|
130
|
+
assert_equal(3, TimeOrDateTime.new(1143214323).sec)
|
131
|
+
end
|
132
|
+
|
133
|
+
def test_compare_timeordatetime_time
|
134
|
+
assert_equal(-1, TimeOrDateTime.new(Time.utc(2006, 3, 24, 15, 32, 3)) <=> TimeOrDateTime.new(Time.utc(2006, 3, 24, 15, 32, 4)))
|
135
|
+
assert_equal(-1, TimeOrDateTime.new(Time.utc(2006, 3, 24, 15, 32, 3)) <=> TimeOrDateTime.new(Time.utc(2007, 3, 24, 15, 32, 3)))
|
136
|
+
assert_equal(0, TimeOrDateTime.new(Time.utc(2006, 3, 24, 15, 32, 3)) <=> TimeOrDateTime.new(Time.utc(2006, 3, 24, 15, 32, 3)))
|
137
|
+
assert_equal(1, TimeOrDateTime.new(Time.utc(2006, 3, 24, 15, 32, 3)) <=> TimeOrDateTime.new(Time.utc(2006, 3, 24, 15, 32, 2)))
|
138
|
+
assert_equal(1, TimeOrDateTime.new(Time.utc(2006, 3, 24, 15, 32, 3)) <=> TimeOrDateTime.new(Time.utc(2005, 3, 24, 15, 32, 3)))
|
139
|
+
assert_equal(-1, TimeOrDateTime.new(DateTime.new(2006, 3, 24, 15, 32, 3)) <=> TimeOrDateTime.new(Time.utc(2006, 3, 24, 15, 32, 4)))
|
140
|
+
assert_equal(-1, TimeOrDateTime.new(DateTime.new(2006, 3, 24, 15, 32, 3)) <=> TimeOrDateTime.new(Time.utc(2007, 3, 24, 15, 32, 3)))
|
141
|
+
assert_equal(0, TimeOrDateTime.new(DateTime.new(2006, 3, 24, 15, 32, 3)) <=> TimeOrDateTime.new(Time.utc(2006, 3, 24, 15, 32, 3)))
|
142
|
+
assert_equal(1, TimeOrDateTime.new(DateTime.new(2006, 3, 24, 15, 32, 3)) <=> TimeOrDateTime.new(Time.utc(2006, 3, 24, 15, 32, 2)))
|
143
|
+
assert_equal(1, TimeOrDateTime.new(DateTime.new(2006, 3, 24, 15, 32, 3)) <=> TimeOrDateTime.new(Time.utc(2005, 3, 24, 15, 32, 3)))
|
144
|
+
assert_equal(-1, TimeOrDateTime.new(DateTime.new(1960, 3, 24, 15, 32, 3)) <=> TimeOrDateTime.new(Time.utc(2006, 3, 24, 15, 32, 3)))
|
145
|
+
assert_equal(1, TimeOrDateTime.new(DateTime.new(2040, 3, 24, 15, 32, 3)) <=> TimeOrDateTime.new(Time.utc(2006, 3, 24, 15, 32, 3)))
|
146
|
+
assert_equal(-1, TimeOrDateTime.new(1143214323) <=> TimeOrDateTime.new(Time.utc(2006, 3, 24, 15, 32, 4)))
|
147
|
+
assert_equal(-1, TimeOrDateTime.new(1143214323) <=> TimeOrDateTime.new(Time.utc(2007, 3, 24, 15, 32, 3)))
|
148
|
+
assert_equal(0, TimeOrDateTime.new(1143214323) <=> TimeOrDateTime.new(Time.utc(2006, 3, 24, 15, 32, 3)))
|
149
|
+
assert_equal(1, TimeOrDateTime.new(1143214323) <=> TimeOrDateTime.new(Time.utc(2006, 3, 24, 15, 32, 2)))
|
150
|
+
assert_equal(1, TimeOrDateTime.new(1143214323) <=> TimeOrDateTime.new(Time.utc(2005, 3, 24, 15, 32, 3)))
|
151
|
+
end
|
152
|
+
|
153
|
+
def test_compare_timeordatetime_datetime
|
154
|
+
assert_equal(-1, TimeOrDateTime.new(Time.utc(2006, 3, 24, 15, 32, 3)) <=> TimeOrDateTime.new(DateTime.new(2006, 3, 24, 15, 32, 4)))
|
155
|
+
assert_equal(-1, TimeOrDateTime.new(Time.utc(2006, 3, 24, 15, 32, 3)) <=> TimeOrDateTime.new(DateTime.new(2040, 3, 24, 15, 32, 3)))
|
156
|
+
assert_equal(0, TimeOrDateTime.new(Time.utc(2006, 3, 24, 15, 32, 3)) <=> TimeOrDateTime.new(DateTime.new(2006, 3, 24, 15, 32, 3)))
|
157
|
+
assert_equal(1, TimeOrDateTime.new(Time.utc(2006, 3, 24, 15, 32, 3)) <=> TimeOrDateTime.new(DateTime.new(2006, 3, 24, 15, 32, 2)))
|
158
|
+
assert_equal(1, TimeOrDateTime.new(Time.utc(2006, 3, 24, 15, 32, 3)) <=> TimeOrDateTime.new(DateTime.new(1960, 3, 24, 15, 32, 3)))
|
159
|
+
assert_equal(-1, TimeOrDateTime.new(DateTime.new(2006, 3, 24, 15, 32, 3)) <=> TimeOrDateTime.new(DateTime.new(2006, 3, 24, 15, 32, 4)))
|
160
|
+
assert_equal(-1, TimeOrDateTime.new(DateTime.new(2006, 3, 24, 15, 32, 3)) <=> TimeOrDateTime.new(DateTime.new(2040, 3, 24, 15, 32, 3)))
|
161
|
+
assert_equal(0, TimeOrDateTime.new(DateTime.new(2006, 3, 24, 15, 32, 3)) <=> TimeOrDateTime.new(DateTime.new(2006, 3, 24, 15, 32, 3)))
|
162
|
+
assert_equal(1, TimeOrDateTime.new(DateTime.new(2006, 3, 24, 15, 32, 3)) <=> TimeOrDateTime.new(DateTime.new(2006, 3, 24, 15, 32, 2)))
|
163
|
+
assert_equal(1, TimeOrDateTime.new(DateTime.new(2006, 3, 24, 15, 32, 3)) <=> TimeOrDateTime.new(DateTime.new(1960, 3, 24, 15, 32, 3)))
|
164
|
+
assert_equal(-1, TimeOrDateTime.new(DateTime.new(1960, 3, 24, 15, 32, 3)) <=> TimeOrDateTime.new(DateTime.new(2006, 3, 24, 15, 32, 3)))
|
165
|
+
assert_equal(1, TimeOrDateTime.new(DateTime.new(2040, 3, 24, 15, 32, 3)) <=> TimeOrDateTime.new(DateTime.new(2006, 3, 24, 15, 32, 3)))
|
166
|
+
assert_equal(-1, TimeOrDateTime.new(1143214323) <=> TimeOrDateTime.new(DateTime.new(2006, 3, 24, 15, 32, 4)))
|
167
|
+
assert_equal(-1, TimeOrDateTime.new(1143214323) <=> TimeOrDateTime.new(DateTime.new(2040, 3, 24, 15, 32, 3)))
|
168
|
+
assert_equal(0, TimeOrDateTime.new(1143214323) <=> TimeOrDateTime.new(DateTime.new(2006, 3, 24, 15, 32, 3)))
|
169
|
+
assert_equal(1, TimeOrDateTime.new(1143214323) <=> TimeOrDateTime.new(DateTime.new(2006, 3, 24, 15, 32, 2)))
|
170
|
+
assert_equal(1, TimeOrDateTime.new(1143214323) <=> TimeOrDateTime.new(DateTime.new(1960, 3, 24, 15, 32, 3)))
|
171
|
+
end
|
172
|
+
|
173
|
+
def test_compare_timeordatetime_timestamp
|
174
|
+
assert_equal(-1, TimeOrDateTime.new(Time.utc(2006, 3, 24, 15, 32, 3)) <=> TimeOrDateTime.new(1143214324))
|
175
|
+
assert_equal(-1, TimeOrDateTime.new(Time.utc(2006, 3, 24, 15, 32, 3)) <=> TimeOrDateTime.new(1174750323))
|
176
|
+
assert_equal(0, TimeOrDateTime.new(Time.utc(2006, 3, 24, 15, 32, 3)) <=> TimeOrDateTime.new(1143214323))
|
177
|
+
assert_equal(1, TimeOrDateTime.new(Time.utc(2006, 3, 24, 15, 32, 3)) <=> TimeOrDateTime.new(1143214322))
|
178
|
+
assert_equal(1, TimeOrDateTime.new(Time.utc(2006, 3, 24, 15, 32, 3)) <=> TimeOrDateTime.new(1111678323))
|
179
|
+
assert_equal(-1, TimeOrDateTime.new(DateTime.new(2006, 3, 24, 15, 32, 3)) <=> TimeOrDateTime.new(1143214324))
|
180
|
+
assert_equal(-1, TimeOrDateTime.new(DateTime.new(2006, 3, 24, 15, 32, 3)) <=> TimeOrDateTime.new(1174750323))
|
181
|
+
assert_equal(0, TimeOrDateTime.new(DateTime.new(2006, 3, 24, 15, 32, 3)) <=> TimeOrDateTime.new(1143214323))
|
182
|
+
assert_equal(1, TimeOrDateTime.new(DateTime.new(2006, 3, 24, 15, 32, 3)) <=> TimeOrDateTime.new(1143214322))
|
183
|
+
assert_equal(1, TimeOrDateTime.new(DateTime.new(2006, 3, 24, 15, 32, 3)) <=> TimeOrDateTime.new(1111678323))
|
184
|
+
assert_equal(-1, TimeOrDateTime.new(DateTime.new(1960, 3, 24, 15, 32, 3)) <=> TimeOrDateTime.new(1143214323))
|
185
|
+
assert_equal(1, TimeOrDateTime.new(DateTime.new(2040, 3, 24, 15, 32, 3)) <=> TimeOrDateTime.new(1143214323))
|
186
|
+
assert_equal(-1, TimeOrDateTime.new(1143214323) <=> TimeOrDateTime.new(1143214324))
|
187
|
+
assert_equal(-1, TimeOrDateTime.new(1143214323) <=> TimeOrDateTime.new(1174750323))
|
188
|
+
assert_equal(0, TimeOrDateTime.new(1143214323) <=> TimeOrDateTime.new(1143214323))
|
189
|
+
assert_equal(1, TimeOrDateTime.new(1143214323) <=> TimeOrDateTime.new(1143214322))
|
190
|
+
assert_equal(1, TimeOrDateTime.new(1143214323) <=> TimeOrDateTime.new(1111678323))
|
191
|
+
end
|
192
|
+
|
193
|
+
def test_compare_time
|
194
|
+
assert_equal(-1, TimeOrDateTime.new(Time.utc(2006, 3, 24, 15, 32, 3)) <=> Time.utc(2006, 3, 24, 15, 32, 4))
|
195
|
+
assert_equal(-1, TimeOrDateTime.new(Time.utc(2006, 3, 24, 15, 32, 3)) <=> Time.utc(2007, 3, 24, 15, 32, 3))
|
196
|
+
assert_equal(0, TimeOrDateTime.new(Time.utc(2006, 3, 24, 15, 32, 3)) <=> Time.utc(2006, 3, 24, 15, 32, 3))
|
197
|
+
assert_equal(1, TimeOrDateTime.new(Time.utc(2006, 3, 24, 15, 32, 3)) <=> Time.utc(2006, 3, 24, 15, 32, 2))
|
198
|
+
assert_equal(1, TimeOrDateTime.new(Time.utc(2006, 3, 24, 15, 32, 3)) <=> Time.utc(2005, 3, 24, 15, 32, 3))
|
199
|
+
assert_equal(-1, TimeOrDateTime.new(DateTime.new(2006, 3, 24, 15, 32, 3)) <=> Time.utc(2006, 3, 24, 15, 32, 4))
|
200
|
+
assert_equal(-1, TimeOrDateTime.new(DateTime.new(2006, 3, 24, 15, 32, 3)) <=> Time.utc(2007, 3, 24, 15, 32, 3))
|
201
|
+
assert_equal(0, TimeOrDateTime.new(DateTime.new(2006, 3, 24, 15, 32, 3)) <=> Time.utc(2006, 3, 24, 15, 32, 3))
|
202
|
+
assert_equal(1, TimeOrDateTime.new(DateTime.new(2006, 3, 24, 15, 32, 3)) <=> Time.utc(2006, 3, 24, 15, 32, 2))
|
203
|
+
assert_equal(1, TimeOrDateTime.new(DateTime.new(2006, 3, 24, 15, 32, 3)) <=> Time.utc(2005, 3, 24, 15, 32, 3))
|
204
|
+
assert_equal(-1, TimeOrDateTime.new(DateTime.new(1960, 3, 24, 15, 32, 3)) <=> Time.utc(2006, 3, 24, 15, 32, 3))
|
205
|
+
assert_equal(1, TimeOrDateTime.new(DateTime.new(2040, 3, 24, 15, 32, 3)) <=> Time.utc(2006, 3, 24, 15, 32, 3))
|
206
|
+
assert_equal(-1, TimeOrDateTime.new(1143214323) <=> Time.utc(2006, 3, 24, 15, 32, 4))
|
207
|
+
assert_equal(-1, TimeOrDateTime.new(1143214323) <=> Time.utc(2007, 3, 24, 15, 32, 3))
|
208
|
+
assert_equal(0, TimeOrDateTime.new(1143214323) <=> Time.utc(2006, 3, 24, 15, 32, 3))
|
209
|
+
assert_equal(1, TimeOrDateTime.new(1143214323) <=> Time.utc(2006, 3, 24, 15, 32, 2))
|
210
|
+
assert_equal(1, TimeOrDateTime.new(1143214323) <=> Time.utc(2005, 3, 24, 15, 32, 3))
|
211
|
+
end
|
212
|
+
|
213
|
+
def test_compare_datetime
|
214
|
+
assert_equal(-1, TimeOrDateTime.new(Time.utc(2006, 3, 24, 15, 32, 3)) <=> DateTime.new(2006, 3, 24, 15, 32, 4))
|
215
|
+
assert_equal(-1, TimeOrDateTime.new(Time.utc(2006, 3, 24, 15, 32, 3)) <=> DateTime.new(2040, 3, 24, 15, 32, 3))
|
216
|
+
assert_equal(0, TimeOrDateTime.new(Time.utc(2006, 3, 24, 15, 32, 3)) <=> DateTime.new(2006, 3, 24, 15, 32, 3))
|
217
|
+
assert_equal(1, TimeOrDateTime.new(Time.utc(2006, 3, 24, 15, 32, 3)) <=> DateTime.new(2006, 3, 24, 15, 32, 2))
|
218
|
+
assert_equal(1, TimeOrDateTime.new(Time.utc(2006, 3, 24, 15, 32, 3)) <=> DateTime.new(1960, 3, 24, 15, 32, 3))
|
219
|
+
assert_equal(-1, TimeOrDateTime.new(DateTime.new(2006, 3, 24, 15, 32, 3)) <=> DateTime.new(2006, 3, 24, 15, 32, 4))
|
220
|
+
assert_equal(-1, TimeOrDateTime.new(DateTime.new(2006, 3, 24, 15, 32, 3)) <=> DateTime.new(2040, 3, 24, 15, 32, 3))
|
221
|
+
assert_equal(0, TimeOrDateTime.new(DateTime.new(2006, 3, 24, 15, 32, 3)) <=> DateTime.new(2006, 3, 24, 15, 32, 3))
|
222
|
+
assert_equal(1, TimeOrDateTime.new(DateTime.new(2006, 3, 24, 15, 32, 3)) <=> DateTime.new(2006, 3, 24, 15, 32, 2))
|
223
|
+
assert_equal(1, TimeOrDateTime.new(DateTime.new(2006, 3, 24, 15, 32, 3)) <=> DateTime.new(1960, 3, 24, 15, 32, 3))
|
224
|
+
assert_equal(-1, TimeOrDateTime.new(DateTime.new(1960, 3, 24, 15, 32, 3)) <=> DateTime.new(2006, 3, 24, 15, 32, 3))
|
225
|
+
assert_equal(1, TimeOrDateTime.new(DateTime.new(2040, 3, 24, 15, 32, 3)) <=> DateTime.new(2006, 3, 24, 15, 32, 3))
|
226
|
+
assert_equal(-1, TimeOrDateTime.new(1143214323) <=> DateTime.new(2006, 3, 24, 15, 32, 4))
|
227
|
+
assert_equal(-1, TimeOrDateTime.new(1143214323) <=> DateTime.new(2040, 3, 24, 15, 32, 3))
|
228
|
+
assert_equal(0, TimeOrDateTime.new(1143214323) <=> DateTime.new(2006, 3, 24, 15, 32, 3))
|
229
|
+
assert_equal(1, TimeOrDateTime.new(1143214323) <=> DateTime.new(2006, 3, 24, 15, 32, 2))
|
230
|
+
assert_equal(1, TimeOrDateTime.new(1143214323) <=> DateTime.new(1960, 3, 24, 15, 32, 3))
|
231
|
+
end
|
232
|
+
|
233
|
+
def test_compare_timestamp
|
234
|
+
assert_equal(-1, TimeOrDateTime.new(Time.utc(2006, 3, 24, 15, 32, 3)) <=> 1143214324)
|
235
|
+
assert_equal(-1, TimeOrDateTime.new(Time.utc(2006, 3, 24, 15, 32, 3)) <=> 1174750323)
|
236
|
+
assert_equal(0, TimeOrDateTime.new(Time.utc(2006, 3, 24, 15, 32, 3)) <=> 1143214323)
|
237
|
+
assert_equal(1, TimeOrDateTime.new(Time.utc(2006, 3, 24, 15, 32, 3)) <=> 1143214322)
|
238
|
+
assert_equal(1, TimeOrDateTime.new(Time.utc(2006, 3, 24, 15, 32, 3)) <=> 1111678323)
|
239
|
+
assert_equal(-1, TimeOrDateTime.new(DateTime.new(2006, 3, 24, 15, 32, 3)) <=> 1143214324)
|
240
|
+
assert_equal(-1, TimeOrDateTime.new(DateTime.new(2006, 3, 24, 15, 32, 3)) <=> 1174750323)
|
241
|
+
assert_equal(0, TimeOrDateTime.new(DateTime.new(2006, 3, 24, 15, 32, 3)) <=> 1143214323)
|
242
|
+
assert_equal(1, TimeOrDateTime.new(DateTime.new(2006, 3, 24, 15, 32, 3)) <=> 1143214322)
|
243
|
+
assert_equal(1, TimeOrDateTime.new(DateTime.new(2006, 3, 24, 15, 32, 3)) <=> 1111678323)
|
244
|
+
assert_equal(-1, TimeOrDateTime.new(DateTime.new(1960, 3, 24, 15, 32, 3)) <=> 1143214323)
|
245
|
+
assert_equal(1, TimeOrDateTime.new(DateTime.new(2040, 3, 24, 15, 32, 3)) <=> 1143214323)
|
246
|
+
assert_equal(-1, TimeOrDateTime.new(1143214323) <=> 1143214324)
|
247
|
+
assert_equal(-1, TimeOrDateTime.new(1143214323) <=> 1174750323)
|
248
|
+
assert_equal(0, TimeOrDateTime.new(1143214323) <=> 1143214323)
|
249
|
+
assert_equal(1, TimeOrDateTime.new(1143214323) <=> 1143214322)
|
250
|
+
assert_equal(1, TimeOrDateTime.new(1143214323) <=> 1111678323)
|
251
|
+
end
|
252
|
+
|
253
|
+
def test_compare_timestamp_str
|
254
|
+
assert_equal(-1, TimeOrDateTime.new(Time.utc(2006, 3, 24, 15, 32, 3)) <=> '1143214324')
|
255
|
+
assert_equal(-1, TimeOrDateTime.new(Time.utc(2006, 3, 24, 15, 32, 3)) <=> '1174750323')
|
256
|
+
assert_equal(0, TimeOrDateTime.new(Time.utc(2006, 3, 24, 15, 32, 3)) <=> '1143214323')
|
257
|
+
assert_equal(1, TimeOrDateTime.new(Time.utc(2006, 3, 24, 15, 32, 3)) <=> '1143214322')
|
258
|
+
assert_equal(1, TimeOrDateTime.new(Time.utc(2006, 3, 24, 15, 32, 3)) <=> '1111678323')
|
259
|
+
assert_equal(-1, TimeOrDateTime.new(DateTime.new(2006, 3, 24, 15, 32, 3)) <=> '1143214324')
|
260
|
+
assert_equal(-1, TimeOrDateTime.new(DateTime.new(2006, 3, 24, 15, 32, 3)) <=> '1174750323')
|
261
|
+
assert_equal(0, TimeOrDateTime.new(DateTime.new(2006, 3, 24, 15, 32, 3)) <=> '1143214323')
|
262
|
+
assert_equal(1, TimeOrDateTime.new(DateTime.new(2006, 3, 24, 15, 32, 3)) <=> '1143214322')
|
263
|
+
assert_equal(1, TimeOrDateTime.new(DateTime.new(2006, 3, 24, 15, 32, 3)) <=> '1111678323')
|
264
|
+
assert_equal(-1, TimeOrDateTime.new(DateTime.new(1960, 3, 24, 15, 32, 3)) <=> '1143214323')
|
265
|
+
assert_equal(1, TimeOrDateTime.new(DateTime.new(2040, 3, 24, 15, 32, 3)) <=> '1143214323')
|
266
|
+
assert_equal(-1, TimeOrDateTime.new(1143214323) <=> '1143214324')
|
267
|
+
assert_equal(-1, TimeOrDateTime.new(1143214323) <=> '1174750323')
|
268
|
+
assert_equal(0, TimeOrDateTime.new(1143214323) <=> '1143214323')
|
269
|
+
assert_equal(1, TimeOrDateTime.new(1143214323) <=> '1143214322')
|
270
|
+
assert_equal(1, TimeOrDateTime.new(1143214323) <=> '1111678323')
|
271
|
+
end
|
272
|
+
|
273
|
+
def test_add
|
274
|
+
assert_equal(Time.utc(2006, 3, 24, 15, 32, 3), (TimeOrDateTime.new(Time.utc(2006, 3, 24, 15, 32, 3)) + 0).to_orig)
|
275
|
+
assert_equal(DateTime.new(2006, 3, 24, 15, 32, 3), (TimeOrDateTime.new(DateTime.new(2006, 3, 24, 15, 32, 3)) + 0).to_orig)
|
276
|
+
assert_equal(1143214323, (TimeOrDateTime.new(1143214323) + 0).to_orig)
|
277
|
+
assert_equal(Time.utc(2006, 3, 24, 15, 32, 4), (TimeOrDateTime.new(Time.utc(2006, 3, 24, 15, 32, 3)) + 1).to_orig)
|
278
|
+
assert_equal(DateTime.new(2006, 3, 24, 15, 32, 4), (TimeOrDateTime.new(DateTime.new(2006, 3, 24, 15, 32, 3)) + 1).to_orig)
|
279
|
+
assert_equal(1143214324, (TimeOrDateTime.new(1143214323) + 1).to_orig)
|
280
|
+
assert_equal(Time.utc(2006, 3, 24, 15, 32, 2), (TimeOrDateTime.new(Time.utc(2006, 3, 24, 15, 32, 3)) + (-1)).to_orig)
|
281
|
+
assert_equal(DateTime.new(2006, 3, 24, 15, 32, 2), (TimeOrDateTime.new(DateTime.new(2006, 3, 24, 15, 32, 3)) + (-1)).to_orig)
|
282
|
+
assert_equal(1143214322, (TimeOrDateTime.new(1143214323) + (-1)).to_orig)
|
283
|
+
end
|
284
|
+
|
285
|
+
def test_subtract
|
286
|
+
assert_equal(Time.utc(2006, 3, 24, 15, 32, 3), (TimeOrDateTime.new(Time.utc(2006, 3, 24, 15, 32, 3)) - 0).to_orig)
|
287
|
+
assert_equal(DateTime.new(2006, 3, 24, 15, 32, 3), (TimeOrDateTime.new(DateTime.new(2006, 3, 24, 15, 32, 3)) - 0).to_orig)
|
288
|
+
assert_equal(1143214323, (TimeOrDateTime.new(1143214323) - 0).to_orig)
|
289
|
+
assert_equal(Time.utc(2006, 3, 24, 15, 32, 2), (TimeOrDateTime.new(Time.utc(2006, 3, 24, 15, 32, 3)) - 1).to_orig)
|
290
|
+
assert_equal(DateTime.new(2006, 3, 24, 15, 32, 2), (TimeOrDateTime.new(DateTime.new(2006, 3, 24, 15, 32, 3)) - 1).to_orig)
|
291
|
+
assert_equal(1143214322, (TimeOrDateTime.new(1143214323) - 1).to_orig)
|
292
|
+
assert_equal(Time.utc(2006, 3, 24, 15, 32, 4), (TimeOrDateTime.new(Time.utc(2006, 3, 24, 15, 32, 3)) - (-1)).to_orig)
|
293
|
+
assert_equal(DateTime.new(2006, 3, 24, 15, 32, 4), (TimeOrDateTime.new(DateTime.new(2006, 3, 24, 15, 32, 3)) - (-1)).to_orig)
|
294
|
+
assert_equal(1143214324, (TimeOrDateTime.new(1143214323) - (-1)).to_orig)
|
295
|
+
end
|
296
|
+
|
297
|
+
def test_add_with_convert
|
298
|
+
assert_equal(Time.utc(2006, 3, 24, 15, 32, 3), TimeOrDateTime.new(Time.utc(2006, 3, 24, 15, 32, 3)).add_with_convert(0).to_orig)
|
299
|
+
assert_equal(DateTime.new(2006, 3, 24, 15, 32, 3), TimeOrDateTime.new(DateTime.new(2006, 3, 24, 15, 32, 3)).add_with_convert(0).to_orig)
|
300
|
+
assert_equal(1143214323, TimeOrDateTime.new(1143214323).add_with_convert(0).to_orig)
|
301
|
+
assert_equal(Time.utc(2006, 3, 24, 15, 32, 4), TimeOrDateTime.new(Time.utc(2006, 3, 24, 15, 32, 3)).add_with_convert(1).to_orig)
|
302
|
+
assert_equal(DateTime.new(2006, 3, 24, 15, 32, 4), TimeOrDateTime.new(DateTime.new(2006, 3, 24, 15, 32, 3)).add_with_convert(1).to_orig)
|
303
|
+
assert_equal(1143214324, TimeOrDateTime.new(1143214323).add_with_convert(1).to_orig)
|
304
|
+
assert_equal(Time.utc(2006, 3, 24, 15, 32, 2), TimeOrDateTime.new(Time.utc(2006, 3, 24, 15, 32, 3)).add_with_convert(-1).to_orig)
|
305
|
+
assert_equal(DateTime.new(2006, 3, 24, 15, 32, 2), TimeOrDateTime.new(DateTime.new(2006, 3, 24, 15, 32, 3)).add_with_convert(-1).to_orig)
|
306
|
+
assert_equal(1143214322, TimeOrDateTime.new(1143214323).add_with_convert(-1).to_orig)
|
307
|
+
|
308
|
+
assert_equal(DateTime.new(1969, 12, 31, 23, 59, 59), TimeOrDateTime.new(Time.utc(1970, 1, 1, 0, 0, 0)).add_with_convert(-1).to_orig)
|
309
|
+
assert_equal(DateTime.new(2038, 1, 19, 3, 14, 8), TimeOrDateTime.new(Time.utc(2038, 1, 19, 3, 14, 7)).add_with_convert(1).to_orig)
|
310
|
+
end
|
311
|
+
|
312
|
+
def test_wrap_time
|
313
|
+
t = TimeOrDateTime.wrap(Time.utc(2006, 3, 24, 15, 32, 3))
|
314
|
+
assert_instance_of(TimeOrDateTime, t)
|
315
|
+
assert_equal(Time.utc(2006, 3, 24, 15, 32, 3), t.to_orig)
|
316
|
+
end
|
317
|
+
|
318
|
+
def test_wrap_datetime
|
319
|
+
t = TimeOrDateTime.wrap(DateTime.new(2006, 3, 24, 15, 32, 3))
|
320
|
+
assert_instance_of(TimeOrDateTime, t)
|
321
|
+
assert_equal(DateTime.new(2006, 3, 24, 15, 32, 3), t.to_orig)
|
322
|
+
end
|
323
|
+
|
324
|
+
def test_wrap_timestamp
|
325
|
+
t = TimeOrDateTime.wrap(1143214323)
|
326
|
+
assert_instance_of(TimeOrDateTime, t)
|
327
|
+
assert_equal(1143214323, t.to_orig)
|
328
|
+
end
|
329
|
+
|
330
|
+
def test_wrap_timestamp_str
|
331
|
+
t = TimeOrDateTime.wrap('1143214323')
|
332
|
+
assert_instance_of(TimeOrDateTime, t)
|
333
|
+
assert_equal(1143214323, t.to_orig)
|
334
|
+
end
|
335
|
+
|
336
|
+
def test_wrap_timeordatetime
|
337
|
+
t = TimeOrDateTime.new(1143214323)
|
338
|
+
t2 = TimeOrDateTime.wrap(t)
|
339
|
+
assert_same(t, t2)
|
340
|
+
end
|
341
|
+
|
342
|
+
def test_wrap_block_time
|
343
|
+
assert_equal(Time.utc(2006, 3, 24, 15, 32, 4), TimeOrDateTime.wrap(Time.utc(2006, 3, 24, 15, 32, 3)) {|t|
|
344
|
+
assert_instance_of(TimeOrDateTime, t)
|
345
|
+
assert_equal(Time.utc(2006, 3, 24, 15, 32, 3), t.to_orig)
|
346
|
+
t + 1
|
347
|
+
})
|
348
|
+
end
|
349
|
+
|
350
|
+
def test_wrap_block_datetime
|
351
|
+
assert_equal(DateTime.new(2006, 3, 24, 15, 32, 4), TimeOrDateTime.wrap(DateTime.new(2006, 3, 24, 15, 32, 3)) {|t|
|
352
|
+
assert_instance_of(TimeOrDateTime, t)
|
353
|
+
assert_equal(DateTime.new(2006, 3, 24, 15, 32, 3), t.to_orig)
|
354
|
+
t + 1
|
355
|
+
})
|
356
|
+
end
|
357
|
+
|
358
|
+
def test_wrap_block_timestamp
|
359
|
+
assert_equal(1143214324, TimeOrDateTime.wrap(1143214323) {|t|
|
360
|
+
assert_instance_of(TimeOrDateTime, t)
|
361
|
+
assert_equal(1143214323, t.to_orig)
|
362
|
+
t + 1
|
363
|
+
})
|
364
|
+
end
|
365
|
+
|
366
|
+
def test_wrap_block_timestamp_str
|
367
|
+
assert_equal(1143214324, TimeOrDateTime.wrap('1143214323') {|t|
|
368
|
+
assert_instance_of(TimeOrDateTime, t)
|
369
|
+
assert_equal(1143214323, t.to_orig)
|
370
|
+
t + 1
|
371
|
+
})
|
372
|
+
end
|
373
|
+
|
374
|
+
def test_wrap_block_timeordatetime
|
375
|
+
t1 = TimeOrDateTime.new(1143214323)
|
376
|
+
|
377
|
+
t2 = TimeOrDateTime.wrap(t1) {|t|
|
378
|
+
assert_same(t1, t)
|
379
|
+
t + 1
|
380
|
+
}
|
381
|
+
|
382
|
+
assert_not_nil(t2)
|
383
|
+
assert_instance_of(TimeOrDateTime, t2)
|
384
|
+
assert_equal(1143214324, t2.to_orig)
|
385
|
+
end
|
386
|
+
end
|
data/test/tc_timezone.rb
CHANGED
@@ -216,29 +216,49 @@ class TCTimezone < Test::Unit::TestCase
|
|
216
216
|
def test_period_for_utc
|
217
217
|
dt = DateTime.new(2005,2,18,16,24,23)
|
218
218
|
t = Time.utc(2005,2,18,16,24,23)
|
219
|
+
t2 = Time.local(2005,2,18,16,24,23)
|
220
|
+
ts = t.to_i
|
219
221
|
|
220
222
|
dt_period = Timezone.get('Europe/London').period_for_utc(dt)
|
221
223
|
t_period = Timezone.get('Europe/London').period_for_utc(t)
|
224
|
+
t2_period = Timezone.get('Europe/London').period_for_utc(t2)
|
225
|
+
ts_period = Timezone.get('Europe/London').period_for_utc(ts)
|
222
226
|
|
223
227
|
assert_equal(DateTime.new(2004,10,31,1,0,0), dt_period.utc_start)
|
224
|
-
assert_equal(DateTime.new(2005,3,27,1,0,0), dt_period.utc_end)
|
228
|
+
assert_equal(DateTime.new(2005,3,27,1,0,0), dt_period.utc_end)
|
225
229
|
|
226
230
|
assert_equal(DateTime.new(2004,10,31,1,0,0), t_period.utc_start)
|
227
231
|
assert_equal(DateTime.new(2005,3,27,1,0,0), t_period.utc_end)
|
232
|
+
|
233
|
+
assert_equal(DateTime.new(2004,10,31,1,0,0), t2_period.utc_start)
|
234
|
+
assert_equal(DateTime.new(2005,3,27,1,0,0), t2_period.utc_end)
|
235
|
+
|
236
|
+
assert_equal(DateTime.new(2004,10,31,1,0,0), ts_period.utc_start)
|
237
|
+
assert_equal(DateTime.new(2005,3,27,1,0,0), ts_period.utc_end)
|
228
238
|
end
|
229
239
|
|
230
240
|
def test_period_for_local
|
231
241
|
dt = DateTime.new(2005,2,18,16,24,23)
|
232
242
|
t = Time.utc(2005,2,18,16,24,23)
|
243
|
+
t2 = Time.local(2005,2,18,16,24,23)
|
244
|
+
ts = t.to_i
|
233
245
|
|
234
246
|
dt_period = Timezone.get('Europe/London').period_for_local(dt)
|
235
247
|
t_period = Timezone.get('Europe/London').period_for_local(t)
|
248
|
+
t2_period = Timezone.get('Europe/London').period_for_local(t2)
|
249
|
+
ts_period = Timezone.get('Europe/London').period_for_local(ts)
|
236
250
|
|
237
251
|
assert_equal(DateTime.new(2004,10,31,1,0,0), dt_period.utc_start)
|
238
252
|
assert_equal(DateTime.new(2005,3,27,1,0,0), dt_period.utc_end)
|
239
253
|
|
240
254
|
assert_equal(DateTime.new(2004,10,31,1,0,0), t_period.utc_start)
|
241
255
|
assert_equal(DateTime.new(2005,3,27,1,0,0), t_period.utc_end)
|
256
|
+
|
257
|
+
assert_equal(DateTime.new(2004,10,31,1,0,0), t2_period.utc_start)
|
258
|
+
assert_equal(DateTime.new(2005,3,27,1,0,0), t2_period.utc_end)
|
259
|
+
|
260
|
+
assert_equal(DateTime.new(2004,10,31,1,0,0), ts_period.utc_start)
|
261
|
+
assert_equal(DateTime.new(2005,3,27,1,0,0), ts_period.utc_end)
|
242
262
|
end
|
243
263
|
|
244
264
|
def test_period_for_local_invalid
|
@@ -339,33 +359,49 @@ class TCTimezone < Test::Unit::TestCase
|
|
339
359
|
def test_utc_to_local
|
340
360
|
dt = DateTime.new(2005,2,18,16,24,23)
|
341
361
|
t = Time.utc(2005,2,18,16,24,23)
|
362
|
+
t2 = Time.local(2005,2,18,16,24,23)
|
363
|
+
ts = t.to_i
|
342
364
|
|
343
|
-
assert_equal(dt, Timezone.get('Europe/London').utc_to_local(dt))
|
344
|
-
assert_not_equal(t, Timezone.get('Europe/London').utc_to_local(dt))
|
365
|
+
assert_equal(dt, Timezone.get('Europe/London').utc_to_local(dt))
|
345
366
|
assert_equal(t, Timezone.get('Europe/London').utc_to_local(t))
|
346
|
-
|
367
|
+
assert_equal(t, Timezone.get('Europe/London').utc_to_local(t2))
|
368
|
+
assert_equal(ts, Timezone.get('Europe/London').utc_to_local(ts))
|
347
369
|
end
|
348
370
|
|
349
371
|
def test_local_to_utc
|
350
372
|
dt = DateTime.new(2005,2,18,16,24,23)
|
351
373
|
t = Time.utc(2005,2,18,16,24,23)
|
374
|
+
t2 = Time.local(2005,2,18,16,24,23)
|
375
|
+
ts = t.to_i
|
352
376
|
|
353
|
-
assert_equal(dt, Timezone.get('Europe/London').local_to_utc(dt))
|
354
|
-
assert_not_equal(t, Timezone.get('Europe/London').local_to_utc(dt))
|
377
|
+
assert_equal(dt, Timezone.get('Europe/London').local_to_utc(dt))
|
355
378
|
assert_equal(t, Timezone.get('Europe/London').local_to_utc(t))
|
356
|
-
|
379
|
+
assert_equal(t, Timezone.get('Europe/London').local_to_utc(t2))
|
380
|
+
assert_equal(ts, Timezone.get('Europe/London').local_to_utc(ts))
|
357
381
|
end
|
358
382
|
|
359
383
|
def test_local_to_utc_invalid
|
360
384
|
assert_raise(PeriodNotFound) {
|
361
385
|
Timezone.get('America/New_York').local_to_utc(DateTime.new(2004,4,4,2,30,0))
|
362
386
|
}
|
387
|
+
assert_raise(PeriodNotFound) {
|
388
|
+
Timezone.get('America/New_York').local_to_utc(Time.utc(2004,4,4,2,30,0))
|
389
|
+
}
|
390
|
+
assert_raise(PeriodNotFound) {
|
391
|
+
Timezone.get('America/New_York').local_to_utc(Time.utc(2004,4,4,2,30,0).to_i)
|
392
|
+
}
|
363
393
|
end
|
364
394
|
|
365
395
|
def test_local_to_utc_ambiguous
|
366
396
|
assert_raise(AmbiguousTime) {
|
367
397
|
Timezone.get('America/New_York').local_to_utc(DateTime.new(2004,10,31,1,30,0))
|
368
398
|
}
|
399
|
+
assert_raise(AmbiguousTime) {
|
400
|
+
Timezone.get('America/New_York').local_to_utc(Time.utc(2004,10,31,1,30,0))
|
401
|
+
}
|
402
|
+
assert_raise(AmbiguousTime) {
|
403
|
+
Timezone.get('America/New_York').local_to_utc(Time.utc(2004,10,31,1,30,0).to_i)
|
404
|
+
}
|
369
405
|
end
|
370
406
|
|
371
407
|
def test_local_to_utc_dst_flag_resolved
|